chore: import upstream snapshot with attribution
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,166 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { UserError } from "@cloudflare/workers-utils";
|
||||
import { verifyDockerInstalled } from "./utils";
|
||||
import type {
|
||||
BuildArgs,
|
||||
ContainerDevOptions,
|
||||
ImageURIConfig,
|
||||
WranglerLogger,
|
||||
} from "./types";
|
||||
|
||||
export async function constructBuildCommand(
|
||||
options: BuildArgs,
|
||||
logger?: WranglerLogger
|
||||
) {
|
||||
const platform = options.platform ?? "linux/amd64";
|
||||
const buildCmd = [
|
||||
"build",
|
||||
"--load",
|
||||
"-t",
|
||||
options.tag,
|
||||
"--platform",
|
||||
platform,
|
||||
"--provenance=false",
|
||||
];
|
||||
|
||||
if (options.args) {
|
||||
for (const arg in options.args) {
|
||||
buildCmd.push("--build-arg", `${arg}=${options.args[arg]}`);
|
||||
}
|
||||
}
|
||||
if (options.setNetworkToHost) {
|
||||
buildCmd.push("--network", "host");
|
||||
}
|
||||
|
||||
const dockerfile = readFileSync(options.pathToDockerfile, "utf-8");
|
||||
// pipe in the dockerfile
|
||||
buildCmd.push("-f", "-");
|
||||
buildCmd.push(options.buildContext);
|
||||
logger?.debug(`Building image with command: ${buildCmd.join(" ")}`);
|
||||
return { buildCmd, dockerfile };
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawns a Docker build process and returns a handle to abort or await the build.
|
||||
*
|
||||
* By default this function first verifies that the Docker daemon is reachable.
|
||||
* Callers that have already performed this check (e.g. the dev and deploy flows)
|
||||
* should pass `verifyDockerIsRunning: false` to avoid a redundant check.
|
||||
*
|
||||
* @param dockerPath - Path to the Docker CLI executable.
|
||||
* @param options - Build options including the command arguments and Dockerfile content.
|
||||
* @param options.buildCmd - The Docker build command arguments.
|
||||
* @param options.dockerfile - The Dockerfile content to pipe into stdin.
|
||||
* @param options.verifyDockerIsRunning - When `true` (the default), verifies Docker is installed
|
||||
* and the daemon is running before spawning the build. Set to `false` to skip the check.
|
||||
*
|
||||
* @returns An object with an `abort` function and a `ready` promise.
|
||||
*/
|
||||
export async function dockerBuild(
|
||||
dockerPath: string,
|
||||
options: {
|
||||
buildCmd: string[];
|
||||
dockerfile: string;
|
||||
verifyDockerIsRunning?: boolean;
|
||||
}
|
||||
): Promise<{ abort: () => void; ready: Promise<void> }> {
|
||||
if (options.verifyDockerIsRunning !== false) {
|
||||
await verifyDockerInstalled({
|
||||
dockerPath,
|
||||
imageNoun: "the image",
|
||||
});
|
||||
}
|
||||
|
||||
let errorHandled = false;
|
||||
let resolve: () => void;
|
||||
let reject: (err: unknown) => void;
|
||||
const ready = new Promise<void>((res, rej) => {
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
|
||||
const child = spawn(dockerPath, options.buildCmd, {
|
||||
stdio: ["pipe", "inherit", "inherit"],
|
||||
// We need to set detached to true so that the child process
|
||||
// will control all of its child processes and we can kill
|
||||
// all of them in case we need to abort the build process.
|
||||
// On Windows, detached: true opens a new console window per child
|
||||
// process, so we only set it on non-Windows platforms.
|
||||
detached: process.platform !== "win32",
|
||||
// Prevent child processes from opening visible console windows on Windows.
|
||||
// This is a no-op on non-Windows platforms.
|
||||
windowsHide: true,
|
||||
});
|
||||
if (child.stdin !== null) {
|
||||
child.stdin.write(options.dockerfile);
|
||||
child.stdin.end();
|
||||
}
|
||||
|
||||
child.on("exit", (code) => {
|
||||
if (code === 0) {
|
||||
resolve();
|
||||
} else if (!errorHandled) {
|
||||
errorHandled = true;
|
||||
reject(
|
||||
new UserError(`Docker build exited with code: ${code}`, {
|
||||
telemetryMessage: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
child.on("error", (err) => {
|
||||
if (!errorHandled) {
|
||||
errorHandled = true;
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
return {
|
||||
abort: () => {
|
||||
child.unref();
|
||||
if (child.pid !== undefined) {
|
||||
if (process.platform === "win32") {
|
||||
// On Windows, negative-PID process group kill is not supported.
|
||||
// Kill the child process directly instead.
|
||||
child.kill();
|
||||
} else {
|
||||
// Kill using the negative PID to terminate the whole process group
|
||||
// controlled by the child process.
|
||||
process.kill(-child.pid);
|
||||
}
|
||||
}
|
||||
},
|
||||
ready,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a container image from the given container dev options.
|
||||
*
|
||||
* @param dockerPath - Path to the Docker CLI executable.
|
||||
* @param options - Container configuration including the Dockerfile path, build context, and image tag.
|
||||
* @param verifyDockerIsRunning - When `true` (the default), verifies Docker is installed
|
||||
* and the daemon is running before building. Set to `false` when the caller has already
|
||||
* performed this check.
|
||||
*
|
||||
* @returns An object with an `abort` function and a `ready` promise.
|
||||
*/
|
||||
export async function buildImage(
|
||||
dockerPath: string,
|
||||
options: Exclude<ContainerDevOptions, ImageURIConfig>,
|
||||
verifyDockerIsRunning?: boolean
|
||||
) {
|
||||
const { buildCmd, dockerfile } = await constructBuildCommand({
|
||||
tag: options.image_tag,
|
||||
pathToDockerfile: options.dockerfile,
|
||||
buildContext: options.image_build_context,
|
||||
args: options.image_vars,
|
||||
platform: "linux/amd64",
|
||||
});
|
||||
|
||||
return dockerBuild(dockerPath, {
|
||||
buildCmd,
|
||||
dockerfile,
|
||||
verifyDockerIsRunning,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
import type { ApiResult } from "./ApiResult";
|
||||
|
||||
export class ApiError extends Error {
|
||||
public readonly url: string;
|
||||
public readonly status: number;
|
||||
public readonly statusText: string;
|
||||
public readonly body: any;
|
||||
public readonly request: ApiRequestOptions;
|
||||
|
||||
constructor(
|
||||
request: ApiRequestOptions,
|
||||
response: ApiResult,
|
||||
message: string
|
||||
) {
|
||||
super(message);
|
||||
|
||||
this.name = "ApiError";
|
||||
this.url = response.url;
|
||||
this.status = response.status;
|
||||
this.statusText = response.statusText;
|
||||
this.body = response.body;
|
||||
this.request = request;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ApiRequestOptions = {
|
||||
readonly method:
|
||||
| "GET"
|
||||
| "PUT"
|
||||
| "POST"
|
||||
| "DELETE"
|
||||
| "OPTIONS"
|
||||
| "HEAD"
|
||||
| "PATCH";
|
||||
readonly url: string;
|
||||
readonly path?: Record<string, any>;
|
||||
readonly cookies?: Record<string, any>;
|
||||
readonly headers?: Record<string, any>;
|
||||
readonly query?: Record<string, any>;
|
||||
readonly formData?: Record<string, any>;
|
||||
readonly body?: any;
|
||||
readonly mediaType?: string;
|
||||
readonly responseHeader?: string;
|
||||
readonly errors?: Record<number, string>;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export type ApiResult = {
|
||||
readonly url: string;
|
||||
readonly ok: boolean;
|
||||
readonly status: number;
|
||||
readonly statusText: string;
|
||||
readonly body: any;
|
||||
};
|
||||
@@ -0,0 +1,129 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export class CancelError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = "CancelError";
|
||||
}
|
||||
|
||||
public get isCancelled(): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export interface OnCancel {
|
||||
readonly isResolved: boolean;
|
||||
readonly isRejected: boolean;
|
||||
readonly isCancelled: boolean;
|
||||
|
||||
(cancelHandler: () => void): void;
|
||||
}
|
||||
|
||||
export class CancelablePromise<T> implements Promise<T> {
|
||||
#isResolved: boolean;
|
||||
#isRejected: boolean;
|
||||
#isCancelled: boolean;
|
||||
readonly #cancelHandlers: (() => void)[];
|
||||
readonly #promise: Promise<T>;
|
||||
#resolve?: (value: T | PromiseLike<T>) => void;
|
||||
#reject?: (reason?: any) => void;
|
||||
|
||||
constructor(
|
||||
executor: (
|
||||
resolve: (value: T | PromiseLike<T>) => void,
|
||||
reject: (reason?: any) => void,
|
||||
onCancel: OnCancel
|
||||
) => void
|
||||
) {
|
||||
this.#isResolved = false;
|
||||
this.#isRejected = false;
|
||||
this.#isCancelled = false;
|
||||
this.#cancelHandlers = [];
|
||||
this.#promise = new Promise<T>((resolve, reject) => {
|
||||
this.#resolve = resolve;
|
||||
this.#reject = reject;
|
||||
|
||||
const onResolve = (value: T | PromiseLike<T>): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isResolved = true;
|
||||
this.#resolve?.(value);
|
||||
};
|
||||
|
||||
const onReject = (reason?: any): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isRejected = true;
|
||||
this.#reject?.(reason);
|
||||
};
|
||||
|
||||
const onCancel = (cancelHandler: () => void): void => {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#cancelHandlers.push(cancelHandler);
|
||||
};
|
||||
|
||||
Object.defineProperty(onCancel, "isResolved", {
|
||||
get: (): boolean => this.#isResolved,
|
||||
});
|
||||
|
||||
Object.defineProperty(onCancel, "isRejected", {
|
||||
get: (): boolean => this.#isRejected,
|
||||
});
|
||||
|
||||
Object.defineProperty(onCancel, "isCancelled", {
|
||||
get: (): boolean => this.#isCancelled,
|
||||
});
|
||||
|
||||
return executor(onResolve, onReject, onCancel as OnCancel);
|
||||
});
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return "Cancellable Promise";
|
||||
}
|
||||
|
||||
public then<TResult1 = T, TResult2 = never>(
|
||||
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
|
||||
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
|
||||
): Promise<TResult1 | TResult2> {
|
||||
return this.#promise.then(onFulfilled, onRejected);
|
||||
}
|
||||
|
||||
public catch<TResult = never>(
|
||||
onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null
|
||||
): Promise<T | TResult> {
|
||||
return this.#promise.catch(onRejected);
|
||||
}
|
||||
|
||||
public finally(onFinally?: (() => void) | null): Promise<T> {
|
||||
return this.#promise.finally(onFinally);
|
||||
}
|
||||
|
||||
public cancel(): void {
|
||||
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
||||
return;
|
||||
}
|
||||
this.#isCancelled = true;
|
||||
if (this.#cancelHandlers.length) {
|
||||
try {
|
||||
for (const cancelHandler of this.#cancelHandlers) {
|
||||
cancelHandler();
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("Cancellation threw an error", error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.#cancelHandlers.length = 0;
|
||||
this.#reject?.(new CancelError("Request aborted"));
|
||||
}
|
||||
|
||||
public get isCancelled(): boolean {
|
||||
return this.#isCancelled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
import type { WranglerLogger } from "../../types";
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
|
||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||
type Headers = Record<string, string>;
|
||||
|
||||
export type OpenAPIConfig = {
|
||||
BASE: string;
|
||||
VERSION: string;
|
||||
WITH_CREDENTIALS: boolean;
|
||||
CREDENTIALS: "include" | "omit" | "same-origin";
|
||||
TOKEN?: string | Resolver<string>;
|
||||
USERNAME?: string | Resolver<string>;
|
||||
PASSWORD?: string | Resolver<string>;
|
||||
HEADERS?: Headers | Resolver<Headers>;
|
||||
ENCODE_PATH?: (path: string) => string;
|
||||
LOGGER?: WranglerLogger | undefined;
|
||||
};
|
||||
|
||||
export const OpenAPI: OpenAPIConfig = {
|
||||
BASE: "",
|
||||
VERSION: "1.0.0",
|
||||
WITH_CREDENTIALS: false,
|
||||
CREDENTIALS: "include",
|
||||
TOKEN: undefined,
|
||||
USERNAME: undefined,
|
||||
PASSWORD: undefined,
|
||||
HEADERS: undefined,
|
||||
ENCODE_PATH: undefined,
|
||||
LOGGER: undefined,
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type ResultInfo = {
|
||||
page_token?: string;
|
||||
per_page?: number;
|
||||
next_page_token?: string;
|
||||
};
|
||||
|
||||
export type PaginatedResult<T> = {
|
||||
data: T;
|
||||
resultInfo?: ResultInfo;
|
||||
};
|
||||
@@ -0,0 +1,526 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import { ApiError } from "./ApiError";
|
||||
import { CancelablePromise } from "./CancelablePromise";
|
||||
import { type OpenAPIConfig } from "./OpenAPI";
|
||||
import type { ApiRequestOptions } from "./ApiRequestOptions";
|
||||
import type { ApiResult } from "./ApiResult";
|
||||
import type { OnCancel } from "./CancelablePromise";
|
||||
import type { PaginatedResult, ResultInfo } from "./PaginatedResult";
|
||||
|
||||
type FetchResponseInfo = {
|
||||
code: number;
|
||||
message: string;
|
||||
};
|
||||
|
||||
type FetchResult<ResponseType = unknown> = {
|
||||
success: boolean;
|
||||
result?: ResponseType;
|
||||
errors?: FetchResponseInfo[];
|
||||
messages?: FetchResponseInfo[];
|
||||
result_info?: ResultInfo;
|
||||
};
|
||||
|
||||
type ErrorResponse = {
|
||||
error: string;
|
||||
};
|
||||
|
||||
const isDefined = <T>(
|
||||
value: T | null | undefined
|
||||
): value is Exclude<T, null | undefined> => {
|
||||
return value !== undefined && value !== null;
|
||||
};
|
||||
|
||||
const isString = (value: any): value is string => {
|
||||
return typeof value === "string";
|
||||
};
|
||||
|
||||
const isStringWithValue = (value: any): value is string => {
|
||||
return isString(value) && value !== "";
|
||||
};
|
||||
|
||||
const isBlob = (value: any): value is Blob => {
|
||||
return (
|
||||
typeof value === "object" &&
|
||||
typeof value.type === "string" &&
|
||||
typeof value.stream === "function" &&
|
||||
typeof value.arrayBuffer === "function" &&
|
||||
typeof value.constructor === "function" &&
|
||||
typeof value.constructor.name === "string" &&
|
||||
/^(Blob|File)$/.test(value.constructor.name) &&
|
||||
/^(Blob|File)$/.test(value[Symbol.toStringTag])
|
||||
);
|
||||
};
|
||||
|
||||
const isErrorResponse = (value: unknown): value is ErrorResponse => {
|
||||
return (
|
||||
typeof value === "object" &&
|
||||
value !== null &&
|
||||
"error" in value &&
|
||||
typeof value.error === "string"
|
||||
);
|
||||
};
|
||||
|
||||
const base64 = (str: string): string => {
|
||||
try {
|
||||
return btoa(str);
|
||||
} catch (err) {
|
||||
return Buffer.from(str).toString("base64");
|
||||
}
|
||||
};
|
||||
|
||||
const getQueryString = (params: Record<string, any>): string => {
|
||||
const qs: string[] = [];
|
||||
|
||||
const append = (key: string, value: any) => {
|
||||
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
||||
};
|
||||
|
||||
const process = (key: string, value: any) => {
|
||||
if (isDefined(value)) {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((v) => {
|
||||
process(key, v);
|
||||
});
|
||||
} else if (typeof value === "object") {
|
||||
Object.entries(value).forEach(([k, v]) => {
|
||||
process(`${key}[${k}]`, v);
|
||||
});
|
||||
} else {
|
||||
append(key, value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
process(key, value);
|
||||
});
|
||||
|
||||
if (qs.length > 0) {
|
||||
return `?${qs.join("&")}`;
|
||||
}
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => {
|
||||
const encoder = config.ENCODE_PATH || encodeURI;
|
||||
|
||||
const path = options.url
|
||||
.replace("{api-version}", config.VERSION)
|
||||
.replace(/{(.*?)}/g, (substring: string, group: string) => {
|
||||
if (options.path?.hasOwnProperty(group)) {
|
||||
return encoder(String(options.path[group]));
|
||||
}
|
||||
return substring;
|
||||
});
|
||||
|
||||
const url = `${config.BASE}${path}`;
|
||||
if (options.query) {
|
||||
return `${url}${getQueryString(options.query)}`;
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
const getFormData = (options: ApiRequestOptions): FormData | undefined => {
|
||||
if (options.formData) {
|
||||
const formData = new FormData();
|
||||
|
||||
const process = async (key: string, value: any) => {
|
||||
if (isString(value)) {
|
||||
formData.append(key, value);
|
||||
} else {
|
||||
formData.append(key, JSON.stringify(value));
|
||||
}
|
||||
};
|
||||
|
||||
Object.entries(options.formData)
|
||||
.filter(([_, value]) => isDefined(value))
|
||||
.forEach(([key, value]) => {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((v) => process(key, v));
|
||||
} else {
|
||||
process(key, value);
|
||||
}
|
||||
});
|
||||
|
||||
return formData;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
||||
|
||||
const resolve = async <T>(
|
||||
options: ApiRequestOptions,
|
||||
resolver?: T | Resolver<T>
|
||||
): Promise<T | undefined> => {
|
||||
if (typeof resolver === "function") {
|
||||
return (resolver as Resolver<T>)(options);
|
||||
}
|
||||
return resolver;
|
||||
};
|
||||
|
||||
const getHeaders = async (
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions
|
||||
): Promise<Headers> => {
|
||||
const token = await resolve(options, config.TOKEN);
|
||||
const username = await resolve(options, config.USERNAME);
|
||||
const password = await resolve(options, config.PASSWORD);
|
||||
const additionalHeaders = await resolve(options, config.HEADERS);
|
||||
|
||||
const headers = Object.entries({
|
||||
Accept: "application/json",
|
||||
...additionalHeaders,
|
||||
...options.headers,
|
||||
})
|
||||
.filter(([_, value]) => isDefined(value))
|
||||
.reduce(
|
||||
(headers, [key, value]) => ({
|
||||
...headers,
|
||||
[key]: String(value),
|
||||
}),
|
||||
{} as Record<string, string>
|
||||
);
|
||||
|
||||
if (isStringWithValue(token)) {
|
||||
headers["Authorization"] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
if (isStringWithValue(username) && isStringWithValue(password)) {
|
||||
const credentials = base64(`${username}:${password}`);
|
||||
headers["Authorization"] = `Basic ${credentials}`;
|
||||
}
|
||||
|
||||
if (options.body) {
|
||||
if (options.mediaType) {
|
||||
headers["Content-Type"] = options.mediaType;
|
||||
} else if (isBlob(options.body)) {
|
||||
headers["Content-Type"] = options.body.type || "application/octet-stream";
|
||||
} else if (isString(options.body)) {
|
||||
headers["Content-Type"] = "text/plain";
|
||||
} else {
|
||||
headers["Content-Type"] = "application/json";
|
||||
}
|
||||
}
|
||||
|
||||
return new Headers(headers);
|
||||
};
|
||||
|
||||
const getRequestBody = (options: ApiRequestOptions): any => {
|
||||
if (options.body !== undefined) {
|
||||
if (options.mediaType?.includes("/json")) {
|
||||
return JSON.stringify(options.body);
|
||||
} else if (isString(options.body) || isBlob(options.body)) {
|
||||
return options.body;
|
||||
} else {
|
||||
return JSON.stringify(options.body);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const isResponseSchemaV4 = (
|
||||
config: OpenAPIConfig,
|
||||
_options: ApiRequestOptions
|
||||
): boolean => {
|
||||
return config.BASE.endsWith("/containers");
|
||||
};
|
||||
|
||||
const parseResponseSchemaV4 = <T>(
|
||||
url: string,
|
||||
response: Response,
|
||||
responseHeader: string | undefined,
|
||||
responseBody: any
|
||||
): ApiResult => {
|
||||
const fetchResult = (
|
||||
typeof responseBody === "object" ? responseBody : JSON.parse(responseBody)
|
||||
) as FetchResult<T>;
|
||||
const ok = response.ok && fetchResult.success;
|
||||
let result: any;
|
||||
if (ok) {
|
||||
if (fetchResult.result !== undefined) {
|
||||
result = fetchResult.result;
|
||||
} else {
|
||||
result = {};
|
||||
}
|
||||
} else if (isErrorResponse(fetchResult)) {
|
||||
result = fetchResult;
|
||||
} else {
|
||||
result = { error: fetchResult.errors?.[0]?.message };
|
||||
}
|
||||
return {
|
||||
url,
|
||||
ok,
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
body: responseHeader ?? result,
|
||||
};
|
||||
};
|
||||
|
||||
export const sendRequest = async (
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions,
|
||||
url: string,
|
||||
body: any,
|
||||
formData: FormData | undefined,
|
||||
headers: Headers,
|
||||
onCancel: OnCancel
|
||||
): Promise<Response> => {
|
||||
const controller = new AbortController();
|
||||
|
||||
const request: RequestInit = {
|
||||
headers,
|
||||
body: body ?? formData,
|
||||
method: options.method,
|
||||
signal: controller.signal,
|
||||
};
|
||||
|
||||
if (config.WITH_CREDENTIALS) {
|
||||
// :(
|
||||
// The vite-plugin is attempting to typecheck everything with worker types, which does not support request.credentials
|
||||
// Also note this is always set to "omit".
|
||||
// @ts-ignore -- request.credentials not in Workers types
|
||||
request.credentials = config.CREDENTIALS;
|
||||
}
|
||||
|
||||
onCancel(() => controller.abort());
|
||||
|
||||
return await fetch(url, request);
|
||||
};
|
||||
|
||||
const getResponseHeader = (
|
||||
response: Response,
|
||||
responseHeader?: string
|
||||
): string | undefined => {
|
||||
if (responseHeader) {
|
||||
const content = response.headers.get(responseHeader);
|
||||
if (isString(content)) {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const getResponseBody = async (response: Response): Promise<any> => {
|
||||
if (response.status !== 204) {
|
||||
try {
|
||||
const contentType = response.headers.get("Content-Type");
|
||||
if (contentType) {
|
||||
const jsonTypes = ["application/json", "application/problem+json"];
|
||||
const isJSON = jsonTypes.some((type) =>
|
||||
contentType.toLowerCase().startsWith(type)
|
||||
);
|
||||
if (isJSON) {
|
||||
return await response.json();
|
||||
} else {
|
||||
return await response.text();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const catchErrorCodes = (
|
||||
options: ApiRequestOptions,
|
||||
result: ApiResult
|
||||
): void => {
|
||||
const errors: Record<number, string> = {
|
||||
400: "Bad Request",
|
||||
401: "Unauthorized",
|
||||
403: "Forbidden",
|
||||
404: "Not Found",
|
||||
500: "Internal Server Error",
|
||||
502: "Bad Gateway",
|
||||
503: "Service Unavailable",
|
||||
...options.errors,
|
||||
};
|
||||
|
||||
const error = errors[result.status];
|
||||
if (error) {
|
||||
throw new ApiError(options, result, error);
|
||||
}
|
||||
|
||||
if (!result.ok) {
|
||||
throw new ApiError(options, result, "Generic Error");
|
||||
}
|
||||
};
|
||||
|
||||
type ExecuteRequestResult = {
|
||||
url: string;
|
||||
response: Response;
|
||||
responseBody: any;
|
||||
responseHeader: string | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Shared HTTP execution: builds URL, headers, body, sends the request,
|
||||
* and returns the raw response components for further processing.
|
||||
* Returns null if the request was cancelled before sending.
|
||||
*/
|
||||
const executeRequest = async (
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions,
|
||||
onCancel: OnCancel
|
||||
): Promise<ExecuteRequestResult | null> => {
|
||||
const url = getUrl(config, options);
|
||||
const formData = getFormData(options);
|
||||
const body = getRequestBody(options);
|
||||
const headers = await getHeaders(config, options);
|
||||
debugLogRequest(config, url, headers, formData ?? body ?? {});
|
||||
|
||||
if (onCancel.isCancelled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const response = await sendRequest(
|
||||
config,
|
||||
options,
|
||||
url,
|
||||
body,
|
||||
formData,
|
||||
headers,
|
||||
onCancel
|
||||
);
|
||||
const responseBody = await getResponseBody(response);
|
||||
const responseHeader = getResponseHeader(response, options.responseHeader);
|
||||
|
||||
return { url, response, responseBody, responseHeader };
|
||||
};
|
||||
|
||||
/**
|
||||
* Build an ApiResult from the raw response, handling V4 schema parsing.
|
||||
*/
|
||||
const buildApiResult = (
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions,
|
||||
req: ExecuteRequestResult
|
||||
): ApiResult => {
|
||||
if (isResponseSchemaV4(config, options)) {
|
||||
return parseResponseSchemaV4(
|
||||
req.url,
|
||||
req.response,
|
||||
req.responseHeader,
|
||||
req.responseBody
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
url: req.url,
|
||||
ok: req.response.ok,
|
||||
status: req.response.status,
|
||||
statusText: req.response.statusText,
|
||||
body: req.responseHeader ?? req.responseBody,
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Request method
|
||||
* @param config The OpenAPI configuration object
|
||||
* @param options The request options from the service
|
||||
* @returns CancelablePromise<T>
|
||||
* @throws ApiError
|
||||
*/
|
||||
export const request = <T>(
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions
|
||||
): CancelablePromise<T> => {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const req = await executeRequest(config, options, onCancel);
|
||||
if (!req) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = buildApiResult(config, options, req);
|
||||
debugLogResponse(config, result);
|
||||
catchErrorCodes(options, result);
|
||||
resolve(result.body);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Request method that preserves pagination info from V4 responses
|
||||
* @param config The OpenAPI configuration object
|
||||
* @param options The request options from the service
|
||||
* @returns CancelablePromise<PaginatedResult<T>>
|
||||
* @throws ApiError
|
||||
*/
|
||||
export const requestPaginated = <T>(
|
||||
config: OpenAPIConfig,
|
||||
options: ApiRequestOptions
|
||||
): CancelablePromise<PaginatedResult<T>> => {
|
||||
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
||||
try {
|
||||
const req = await executeRequest(config, options, onCancel);
|
||||
if (!req) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = buildApiResult(config, options, req);
|
||||
debugLogResponse(config, result);
|
||||
catchErrorCodes(options, result);
|
||||
|
||||
// Extract result_info from the raw V4 response body for pagination
|
||||
let resultInfo: ResultInfo | undefined;
|
||||
if (isResponseSchemaV4(config, options)) {
|
||||
const fetchResult = (
|
||||
typeof req.responseBody === "object"
|
||||
? req.responseBody
|
||||
: JSON.parse(req.responseBody)
|
||||
) as FetchResult<T>;
|
||||
resultInfo = fetchResult.result_info;
|
||||
}
|
||||
|
||||
resolve({
|
||||
data: result.body as T,
|
||||
resultInfo,
|
||||
});
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const debugLogRequest = async (
|
||||
config: OpenAPIConfig,
|
||||
url: string,
|
||||
headers: Headers,
|
||||
body: FormData | unknown
|
||||
) => {
|
||||
config.LOGGER?.debug(`-- START CF API REQUEST: ${url}`);
|
||||
const logHeaders = new Headers(headers);
|
||||
logHeaders.delete("Authorization");
|
||||
config.LOGGER?.debugWithSanitization(
|
||||
"HEADERS:",
|
||||
JSON.stringify(logHeaders, null, 2)
|
||||
);
|
||||
config.LOGGER?.debugWithSanitization(
|
||||
"BODY:",
|
||||
JSON.stringify(
|
||||
body instanceof FormData ? await new Response(body).text() : body,
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
config.LOGGER?.debug("-- END CF API REQUEST");
|
||||
};
|
||||
|
||||
const debugLogResponse = (config: OpenAPIConfig, response: ApiResult) => {
|
||||
config.LOGGER?.debug(
|
||||
"-- START CF API RESPONSE:",
|
||||
response.statusText,
|
||||
response.status
|
||||
);
|
||||
|
||||
config.LOGGER?.debugWithSanitization("RESPONSE:", response.body);
|
||||
config.LOGGER?.debug("-- END CF API RESPONSE");
|
||||
};
|
||||
@@ -0,0 +1,225 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export { ApiError } from "./core/ApiError";
|
||||
export { CancelablePromise, CancelError } from "./core/CancelablePromise";
|
||||
export { OpenAPI } from "./core/OpenAPI";
|
||||
export type { OpenAPIConfig } from "./core/OpenAPI";
|
||||
export type { PaginatedResult, ResultInfo } from "./core/PaginatedResult";
|
||||
export { requestPaginated } from "./core/request";
|
||||
|
||||
export type { AccountDefaults } from "./models/AccountDefaults";
|
||||
export type { AccountID } from "./models/AccountID";
|
||||
export type { AccountLimit } from "./models/AccountLimit";
|
||||
export type { AccountLocation } from "./models/AccountLocation";
|
||||
export type { AccountLocationLimits } from "./models/AccountLocationLimits";
|
||||
export type { AccountLocationLimitsAsProperty } from "./models/AccountLocationLimitsAsProperty";
|
||||
export type { AccountRegistryToken } from "./models/AccountRegistryToken";
|
||||
export type { AddressAssignment } from "./models/AddressAssignment";
|
||||
export type { Application } from "./models/Application";
|
||||
export type { ApplicationAffinities } from "./models/ApplicationAffinities";
|
||||
export { ApplicationAffinityColocation } from "./models/ApplicationAffinityColocation";
|
||||
export { ApplicationAffinityHardwareGeneration } from "./models/ApplicationAffinityHardwareGeneration";
|
||||
export type { ApplicationConstraintPop } from "./models/ApplicationConstraintPop";
|
||||
export type { ApplicationConstraints } from "./models/ApplicationConstraints";
|
||||
export type { ApplicationHealth } from "./models/ApplicationHealth";
|
||||
export type { ApplicationHealthInstances } from "./models/ApplicationHealthInstances";
|
||||
export type { ApplicationID } from "./models/ApplicationID";
|
||||
export type { ApplicationJob } from "./models/ApplicationJob";
|
||||
export type { ApplicationJobsConfig } from "./models/ApplicationJobsConfig";
|
||||
export { ApplicationMutationError } from "./models/ApplicationMutationError";
|
||||
export type { ApplicationName } from "./models/ApplicationName";
|
||||
export type { ApplicationNotFoundError } from "./models/ApplicationNotFoundError";
|
||||
export type { ApplicationPriorities } from "./models/ApplicationPriorities";
|
||||
export type { ApplicationPriority } from "./models/ApplicationPriority";
|
||||
export { ApplicationRollout } from "./models/ApplicationRollout";
|
||||
export type { ApplicationRolloutActiveGracePeriod } from "./models/ApplicationRolloutActiveGracePeriod";
|
||||
export type { ApplicationRolloutProgress } from "./models/ApplicationRolloutProgress";
|
||||
export type { ApplicationSchedulingHint } from "./models/ApplicationSchedulingHint";
|
||||
export type { ApplicationStatus } from "./models/ApplicationStatus";
|
||||
export { AssignIPv4 } from "./models/AssignIPv4";
|
||||
export { AssignIPv6 } from "./models/AssignIPv6";
|
||||
export type { BadRequestError } from "./models/BadRequestError";
|
||||
export { BadRequestWithCodeError } from "./models/BadRequestWithCodeError";
|
||||
export type { City } from "./models/City";
|
||||
export type { Command } from "./models/Command";
|
||||
export type { CompleteAccountCustomer } from "./models/CompleteAccountCustomer";
|
||||
export type { CompleteAccountLocationCustomer } from "./models/CompleteAccountLocationCustomer";
|
||||
export { ContainerNetworkMode } from "./models/ContainerNetworkMode";
|
||||
export type { CreateApplicationBadRequest } from "./models/CreateApplicationBadRequest";
|
||||
export type { CreateApplicationJobBadRequest } from "./models/CreateApplicationJobBadRequest";
|
||||
export type { CreateApplicationJobRequest } from "./models/CreateApplicationJobRequest";
|
||||
export type { CreateApplicationRequest } from "./models/CreateApplicationRequest";
|
||||
export { CreateApplicationRolloutRequest } from "./models/CreateApplicationRolloutRequest";
|
||||
export type { CreateDeploymentBadRequest } from "./models/CreateDeploymentBadRequest";
|
||||
export type { CreateDeploymentV2RequestBody } from "./models/CreateDeploymentV2RequestBody";
|
||||
export type { CreateImageRegistryRequestBody } from "./models/CreateImageRegistryRequestBody";
|
||||
export type { CreateSSHPublicKeyError } from "./models/CreateSSHPublicKeyError";
|
||||
export type { CreateSSHPublicKeyRequestBody } from "./models/CreateSSHPublicKeyRequestBody";
|
||||
export type { CustomerImageRegistry } from "./models/CustomerImageRegistry";
|
||||
export type { DashApplication } from "./models/DashApplication";
|
||||
export type { DashApplicationDurableObjectInstance } from "./models/DashApplicationDurableObjectInstance";
|
||||
export type { DashApplicationInstance } from "./models/DashApplicationInstance";
|
||||
export type { DashApplicationInstances } from "./models/DashApplicationInstances";
|
||||
export type { DeleteDeploymentError } from "./models/DeleteDeploymentError";
|
||||
export type { DeleteImageRegistryResponse } from "./models/DeleteImageRegistryResponse";
|
||||
export type { DeploymentAlreadyExists } from "./models/DeploymentAlreadyExists";
|
||||
export type { DeploymentCheck } from "./models/DeploymentCheck";
|
||||
export type { DeploymentCheckHTTP } from "./models/DeploymentCheckHTTP";
|
||||
export type { DeploymentCheckHTTPRequestBody } from "./models/DeploymentCheckHTTPRequestBody";
|
||||
export { DeploymentCheckKind } from "./models/DeploymentCheckKind";
|
||||
export type { DeploymentCheckRequestBody } from "./models/DeploymentCheckRequestBody";
|
||||
export { DeploymentCheckType } from "./models/DeploymentCheckType";
|
||||
export type { DeploymentCreationError } from "./models/DeploymentCreationError";
|
||||
export type { DeploymentID } from "./models/DeploymentID";
|
||||
export type { DeploymentListError } from "./models/DeploymentListError";
|
||||
export type { DeploymentLocation } from "./models/DeploymentLocation";
|
||||
export type { DeploymentModificationError } from "./models/DeploymentModificationError";
|
||||
export { DeploymentMutationError } from "./models/DeploymentMutationError";
|
||||
export { DeploymentNotFoundError } from "./models/DeploymentNotFoundError";
|
||||
export { DeploymentPlacementState } from "./models/DeploymentPlacementState";
|
||||
export type { DeploymentQueuedDetails } from "./models/DeploymentQueuedDetails";
|
||||
export { DeploymentQueuedReason } from "./models/DeploymentQueuedReason";
|
||||
export type { DeploymentReplacementError } from "./models/DeploymentReplacementError";
|
||||
export { DeploymentSchedulingState } from "./models/DeploymentSchedulingState";
|
||||
export type { DeploymentSecretMap } from "./models/DeploymentSecretMap";
|
||||
export type { DeploymentState } from "./models/DeploymentState";
|
||||
export { DeploymentType } from "./models/DeploymentType";
|
||||
export type { DeploymentV2 } from "./models/DeploymentV2";
|
||||
export type { DeploymentVersion } from "./models/DeploymentVersion";
|
||||
export type { Disk } from "./models/Disk";
|
||||
export type { DiskMB } from "./models/DiskMB";
|
||||
export type { DiskSizeWithUnit } from "./models/DiskSizeWithUnit";
|
||||
export type { DNSConfiguration } from "./models/DNSConfiguration";
|
||||
export type { Domain } from "./models/Domain";
|
||||
export type { DurableObjectsConfiguration } from "./models/DurableObjectsConfiguration";
|
||||
export { DurableObjectStatusHealth } from "./models/DurableObjectStatusHealth";
|
||||
export type { Duration } from "./models/Duration";
|
||||
export type { EmptyResponse } from "./models/EmptyResponse";
|
||||
export type { Entrypoint } from "./models/Entrypoint";
|
||||
export type { EnvironmentVariable } from "./models/EnvironmentVariable";
|
||||
export type { EnvironmentVariableName } from "./models/EnvironmentVariableName";
|
||||
export type { EnvironmentVariableValue } from "./models/EnvironmentVariableValue";
|
||||
export { EventName } from "./models/EventName";
|
||||
export { EventType } from "./models/EventType";
|
||||
export type { ExecFormParam } from "./models/ExecFormParam";
|
||||
export { ExternalRegistryKind } from "./models/ExternalRegistryKind";
|
||||
export type { GenericErrorDetails } from "./models/GenericErrorDetails";
|
||||
export type { GenericErrorResponseWithRequestID } from "./models/GenericErrorResponseWithRequestID";
|
||||
export type { GenericMessageResponse } from "./models/GenericMessageResponse";
|
||||
export type { GetDeploymentError } from "./models/GetDeploymentError";
|
||||
export type { GetPlacementError } from "./models/GetPlacementError";
|
||||
export { HTTPMethod } from "./models/HTTPMethod";
|
||||
export type { Identity } from "./models/Identity";
|
||||
export type { Image } from "./models/Image";
|
||||
export type { ImageRegistryAuth } from "./models/ImageRegistryAuth";
|
||||
export { ImageRegistryAlreadyExistsError } from "./models/ImageRegistryAlreadyExistsError";
|
||||
export type { ImageRegistryCredentialsConfiguration } from "./models/ImageRegistryCredentialsConfiguration";
|
||||
export { ImageRegistryIsPublic } from "./models/ImageRegistryIsPublic";
|
||||
export { ImageRegistryNotAllowedError } from "./models/ImageRegistryNotAllowedError";
|
||||
export { ImageRegistryNotFoundError } from "./models/ImageRegistryNotFoundError";
|
||||
export { ImageRegistryPermissions } from "./models/ImageRegistryPermissions";
|
||||
export type { ImageRegistryProtocol } from "./models/ImageRegistryProtocol";
|
||||
export { ImageRegistryProtocolAlreadyExists } from "./models/ImageRegistryProtocolAlreadyExists";
|
||||
export { ImageRegistryProtocolIsReferencedError } from "./models/ImageRegistryProtocolIsReferencedError";
|
||||
export { ImageRegistryProtocolNotFound } from "./models/ImageRegistryProtocolNotFound";
|
||||
export type { ImageRegistryProtocols } from "./models/ImageRegistryProtocols";
|
||||
export type { ImageRegistryProtoDomain } from "./models/ImageRegistryProtoDomain";
|
||||
export { InstanceType } from "./models/InstanceType";
|
||||
export type { InternalError } from "./models/InternalError";
|
||||
export type { IP } from "./models/IP";
|
||||
export type { IPAllocation } from "./models/IPAllocation";
|
||||
export type { IPAllocationConfiguration } from "./models/IPAllocationConfiguration";
|
||||
export type { IPAllocationsWithFilter } from "./models/IPAllocationsWithFilter";
|
||||
export { IPType } from "./models/IPType";
|
||||
export type { IPV4 } from "./models/IPV4";
|
||||
export type { ISO8601Timestamp } from "./models/ISO8601Timestamp";
|
||||
export type { JobEvents } from "./models/JobEvents";
|
||||
export type { JobID } from "./models/JobID";
|
||||
export type { JobNotFoundError } from "./models/JobNotFoundError";
|
||||
export type { JobSecretMap } from "./models/JobSecretMap";
|
||||
export type { JobStatus } from "./models/JobStatus";
|
||||
export { JobStatusHealth } from "./models/JobStatusHealth";
|
||||
export type { JobTimeoutSeconds } from "./models/JobTimeoutSeconds";
|
||||
export type { Label } from "./models/Label";
|
||||
export type { LabelName } from "./models/LabelName";
|
||||
export type { LabelValue } from "./models/LabelValue";
|
||||
export type { ListApplications } from "./models/ListApplications";
|
||||
export type { ListDeploymentsV2 } from "./models/ListDeploymentsV2";
|
||||
export type { ListIPsIsAllocated } from "./models/ListIPsIsAllocated";
|
||||
export type { ListPlacements } from "./models/ListPlacements";
|
||||
export type { ListPlacementsError } from "./models/ListPlacementsError";
|
||||
export type { ListSecretsMetadata } from "./models/ListSecretsMetadata";
|
||||
export type { ListSSHPublicKeys } from "./models/ListSSHPublicKeys";
|
||||
export type { ListSSHPublicKeysError } from "./models/ListSSHPublicKeysError";
|
||||
export type { Location } from "./models/Location";
|
||||
export type { LocationID } from "./models/LocationID";
|
||||
export type { MemorySizeWithUnit } from "./models/MemorySizeWithUnit";
|
||||
export type { ModifyApplicationBadRequest } from "./models/ModifyApplicationBadRequest";
|
||||
export type { ModifyApplicationJobBadRequest } from "./models/ModifyApplicationJobBadRequest";
|
||||
export type { ModifyApplicationJobRequest } from "./models/ModifyApplicationJobRequest";
|
||||
export type { ModifyApplicationRequestBody } from "./models/ModifyApplicationRequestBody";
|
||||
export type { ModifyDeploymentBadRequest } from "./models/ModifyDeploymentBadRequest";
|
||||
export type { ModifyDeploymentV2RequestBody } from "./models/ModifyDeploymentV2RequestBody";
|
||||
export type { ModifyMeRequestBody } from "./models/ModifyMeRequestBody";
|
||||
export type { ModifySecretRequestBody } from "./models/ModifySecretRequestBody";
|
||||
export type { ModifyUserDeploymentConfiguration } from "./models/ModifyUserDeploymentConfiguration";
|
||||
export type { Network } from "./models/Network";
|
||||
export { NetworkMode } from "./models/NetworkMode";
|
||||
export type { NetworkParameters } from "./models/NetworkParameters";
|
||||
export { NodeGroup } from "./models/NodeGroup";
|
||||
export type { Observability } from "./models/Observability";
|
||||
export type { ObservabilityLogs } from "./models/ObservabilityLogs";
|
||||
export type { Placement } from "./models/Placement";
|
||||
export type { PlacementEvent } from "./models/PlacementEvent";
|
||||
export type { PlacementEvents } from "./models/PlacementEvents";
|
||||
export type { PlacementID } from "./models/PlacementID";
|
||||
export type { PlacementNotFoundError } from "./models/PlacementNotFoundError";
|
||||
export type { PlacementStatus } from "./models/PlacementStatus";
|
||||
export { PlacementStatusHealth } from "./models/PlacementStatusHealth";
|
||||
export type { PlacementWithEvents } from "./models/PlacementWithEvents";
|
||||
export type { PlainTextSecretValue } from "./models/PlainTextSecretValue";
|
||||
export type { Port } from "./models/Port";
|
||||
export type { PortRange } from "./models/PortRange";
|
||||
export type { PortRangeAllocation } from "./models/PortRangeAllocation";
|
||||
export { ProvisionerConfiguration } from "./models/ProvisionerConfiguration";
|
||||
export type { Ref } from "./models/Ref";
|
||||
export type { Region } from "./models/Region";
|
||||
export type { ReplaceDeploymentRequestBody } from "./models/ReplaceDeploymentRequestBody";
|
||||
export type { RolloutID } from "./models/RolloutID";
|
||||
export { RolloutStep } from "./models/RolloutStep";
|
||||
export type { RolloutStepRequest } from "./models/RolloutStepRequest";
|
||||
export type { SchedulerDeploymentConfiguration } from "./models/SchedulerDeploymentConfiguration";
|
||||
export { SchedulingPolicy } from "./models/SchedulingPolicy";
|
||||
export type { Secret } from "./models/Secret";
|
||||
export { SecretAccessType } from "./models/SecretAccessType";
|
||||
export type { SecretMap } from "./models/SecretMap";
|
||||
export type { SecretMetadata } from "./models/SecretMetadata";
|
||||
export type { SecretName } from "./models/SecretName";
|
||||
export { SecretNameAlreadyExists } from "./models/SecretNameAlreadyExists";
|
||||
export { SecretNotFound } from "./models/SecretNotFound";
|
||||
export type { SecretsStoreRef } from "./models/SecretsStoreRef";
|
||||
export type { SSHPublicKey } from "./models/SSHPublicKey";
|
||||
export type { SSHPublicKeyID } from "./models/SSHPublicKeyID";
|
||||
export type { SSHPublicKeyItem } from "./models/SSHPublicKeyItem";
|
||||
export type { UserSSHPublicKey } from "./models/UserSSHPublicKey";
|
||||
export { SSHPublicKeyNotFoundError } from "./models/SSHPublicKeyNotFoundError";
|
||||
export type { UnAuthorizedError } from "./models/UnAuthorizedError";
|
||||
export type { UnixTimestamp } from "./models/UnixTimestamp";
|
||||
export type { UnknownAccount } from "./models/UnknownAccount";
|
||||
export { UpdateApplicationRolloutRequest } from "./models/UpdateApplicationRolloutRequest";
|
||||
export type { UpdateRolloutResponse } from "./models/UpdateRolloutResponse";
|
||||
export type { UserDeploymentConfiguration } from "./models/UserDeploymentConfiguration";
|
||||
export type { WranglerSSHConfig } from "./models/WranglerSSHConfig";
|
||||
export type { WranglerSSHResponse } from "./models/WranglerSSHResponse";
|
||||
|
||||
export { AccountService } from "./services/AccountService";
|
||||
export { ApplicationsService } from "./services/ApplicationsService";
|
||||
export { DeploymentsService } from "./services/DeploymentsService";
|
||||
export { ImageRegistriesService } from "./services/ImageRegistriesService";
|
||||
export { IPsService } from "./services/IPsService";
|
||||
export { JobsService } from "./services/JobsService";
|
||||
export { PlacementsService } from "./services/PlacementsService";
|
||||
export { RolloutsService } from "./services/RolloutsService";
|
||||
export { SecretsService } from "./services/SecretsService";
|
||||
export { SshPublicKeysService } from "./services/SshPublicKeysService";
|
||||
@@ -0,0 +1,22 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { MemorySizeWithUnit } from "./MemorySizeWithUnit";
|
||||
|
||||
/**
|
||||
* Represents the default configuration for an account
|
||||
*/
|
||||
export type AccountDefaults = {
|
||||
vcpus: number;
|
||||
memory_mib: number;
|
||||
/**
|
||||
* Default disk size in MB
|
||||
*/
|
||||
disk_mb?: number;
|
||||
/**
|
||||
* Deprecated in favor of memory_mib
|
||||
* @deprecated
|
||||
*/
|
||||
memory?: MemorySizeWithUnit;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* A unique identifier for the account
|
||||
*/
|
||||
export type AccountID = string;
|
||||
@@ -0,0 +1,49 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { AccountID } from "./AccountID";
|
||||
import type { DiskSizeWithUnit } from "./DiskSizeWithUnit";
|
||||
import type { MemorySizeWithUnit } from "./MemorySizeWithUnit";
|
||||
import type { NetworkMode } from "./NetworkMode";
|
||||
import type { NodeGroup } from "./NodeGroup";
|
||||
|
||||
/**
|
||||
* Represents a Cloudchamber account limit
|
||||
*/
|
||||
export type AccountLimit = {
|
||||
account_id: AccountID;
|
||||
vcpu_per_deployment: number;
|
||||
/**
|
||||
* Deprecated in favor of memory_mib_per_deployment
|
||||
* @deprecated
|
||||
*/
|
||||
memory_per_deployment: MemorySizeWithUnit;
|
||||
memory_mib_per_deployment: number;
|
||||
/**
|
||||
* Deprecated in favor of disk_mb_per_deployment
|
||||
* @deprecated
|
||||
*/
|
||||
disk_per_deployment: DiskSizeWithUnit;
|
||||
disk_mb_per_deployment: number;
|
||||
total_vcpu: number;
|
||||
/**
|
||||
* Deprecated in favor of total_memory_mib
|
||||
* @deprecated
|
||||
*/
|
||||
total_memory: MemorySizeWithUnit;
|
||||
total_memory_mib: number;
|
||||
/**
|
||||
* Total amount of disk usage allowed for the account
|
||||
*/
|
||||
total_disk_mb: number;
|
||||
node_group: NodeGroup;
|
||||
/**
|
||||
* Network modes that will be included in this customer's vm
|
||||
*/
|
||||
network_modes: Array<NetworkMode>;
|
||||
/**
|
||||
* Number of ipv4s available to the account
|
||||
*/
|
||||
ipv4s: number;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { LocationID } from "./LocationID";
|
||||
|
||||
/**
|
||||
* Represents a location where an account can create/modify deployments.
|
||||
*/
|
||||
export type AccountLocation = {
|
||||
location: LocationID;
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { MemorySizeWithUnit } from "./MemorySizeWithUnit";
|
||||
|
||||
/**
|
||||
* Represents the limits related to a location
|
||||
*/
|
||||
export type AccountLocationLimits = {
|
||||
vcpu_per_deployment: number;
|
||||
/**
|
||||
* Deprecated in favor of memory_mib_per_deployment
|
||||
* @deprecated
|
||||
*/
|
||||
memory_per_deployment: MemorySizeWithUnit;
|
||||
memory_mib_per_deployment?: number;
|
||||
total_vcpu: number;
|
||||
/**
|
||||
* Deprecated in favor of total_memory_mib
|
||||
* @deprecated
|
||||
*/
|
||||
total_memory: MemorySizeWithUnit;
|
||||
total_memory_mib?: number;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { AccountLocationLimits } from "./AccountLocationLimits";
|
||||
|
||||
/**
|
||||
* Represents an account location limits property
|
||||
*/
|
||||
export type AccountLocationLimitsAsProperty = {
|
||||
limits: AccountLocationLimits;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { AccountID } from "./AccountID";
|
||||
|
||||
/**
|
||||
* An account registry token object that can be used to push and pull images to the registry's current account namespace
|
||||
*/
|
||||
export type AccountRegistryToken = {
|
||||
account_id: AccountID;
|
||||
registry_host: string;
|
||||
username: string;
|
||||
/**
|
||||
* If password is unset, this registry is a public one that doesn't need credentials
|
||||
*/
|
||||
password?: string;
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DeploymentID } from "./DeploymentID";
|
||||
import type { PlacementID } from "./PlacementID";
|
||||
import type { UnixTimestamp } from "./UnixTimestamp";
|
||||
|
||||
/**
|
||||
* The allocation that exists when an IP or a port range has been assigned to a metal
|
||||
*/
|
||||
export type AddressAssignment = {
|
||||
placementID?: PlacementID;
|
||||
expiration?: UnixTimestamp;
|
||||
deploymentID?: DeploymentID;
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { AccountID } from "./AccountID";
|
||||
import type { ApplicationAffinities } from "./ApplicationAffinities";
|
||||
import type { ApplicationConstraints } from "./ApplicationConstraints";
|
||||
import type { ApplicationHealth } from "./ApplicationHealth";
|
||||
import type { ApplicationID } from "./ApplicationID";
|
||||
import type { ApplicationJobsConfig } from "./ApplicationJobsConfig";
|
||||
import type { ApplicationName } from "./ApplicationName";
|
||||
import type { ApplicationPriorities } from "./ApplicationPriorities";
|
||||
import type { ApplicationRolloutActiveGracePeriod } from "./ApplicationRolloutActiveGracePeriod";
|
||||
import type { ApplicationSchedulingHint } from "./ApplicationSchedulingHint";
|
||||
import type { DurableObjectsConfiguration } from "./DurableObjectsConfiguration";
|
||||
import type { ISO8601Timestamp } from "./ISO8601Timestamp";
|
||||
import type { RolloutID } from "./RolloutID";
|
||||
import type { SchedulingPolicy } from "./SchedulingPolicy";
|
||||
import type { UserDeploymentConfiguration } from "./UserDeploymentConfiguration";
|
||||
|
||||
/**
|
||||
* Describes multiple deployments with parameters that describe how they should be placed
|
||||
*/
|
||||
export type Application = {
|
||||
id: ApplicationID;
|
||||
created_at: ISO8601Timestamp;
|
||||
account_id: AccountID;
|
||||
name: ApplicationName;
|
||||
version: number;
|
||||
scheduling_policy: SchedulingPolicy;
|
||||
/**
|
||||
* Number of deployments to create
|
||||
*/
|
||||
instances: number;
|
||||
/**
|
||||
* Maximum number of instances that the application will allow. This is relevant for applications that auto-scale.
|
||||
*/
|
||||
max_instances?: number;
|
||||
configuration: UserDeploymentConfiguration;
|
||||
constraints?: ApplicationConstraints;
|
||||
jobs?: ApplicationJobsConfig;
|
||||
affinities?: ApplicationAffinities;
|
||||
priorities?: ApplicationPriorities;
|
||||
durable_objects?: DurableObjectsConfiguration;
|
||||
scheduling_hint?: ApplicationSchedulingHint;
|
||||
active_rollout_id?: RolloutID;
|
||||
rollout_active_grace_period?: ApplicationRolloutActiveGracePeriod;
|
||||
health?: ApplicationHealth;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationAffinityColocation } from "./ApplicationAffinityColocation";
|
||||
import type { ApplicationAffinityHardwareGeneration } from "./ApplicationAffinityHardwareGeneration";
|
||||
|
||||
/**
|
||||
* Defines affinity in application scheduling. (This still an experimental feature, some schedulers might not work with these affinities).
|
||||
*
|
||||
*/
|
||||
export type ApplicationAffinities = {
|
||||
colocation?: ApplicationAffinityColocation;
|
||||
hardware_generation?: ApplicationAffinityHardwareGeneration;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Colocation affinity is designed so schedulers try to place application instances all in the same way. Colocation is best-effort depending on available resources. If there is some leftover set of instances
|
||||
* that can't be placed together, the scheduler will try to place them somewhere else.
|
||||
*
|
||||
*/
|
||||
export enum ApplicationAffinityColocation {
|
||||
DATACENTER = "datacenter",
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* To the extend possible, prefer nodes with specified characteristics when placing application instances.
|
||||
*
|
||||
*/
|
||||
export enum ApplicationAffinityHardwareGeneration {
|
||||
HIGHEST_OVERALL_PERFORMANCE = "highest-overall-performance",
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* The name of a pop to be specified in an application pop. Requires specific entitlements to use this.
|
||||
*/
|
||||
export type ApplicationConstraintPop = string;
|
||||
@@ -0,0 +1,16 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationConstraintPop } from "./ApplicationConstraintPop";
|
||||
import type { City } from "./City";
|
||||
import type { Region } from "./Region";
|
||||
|
||||
export type ApplicationConstraints = {
|
||||
region?: Region;
|
||||
tier?: number;
|
||||
tiers?: Array<number>;
|
||||
regions?: Array<Region>;
|
||||
cities?: Array<City>;
|
||||
pops?: Array<ApplicationConstraintPop>;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationHealthInstances } from "./ApplicationHealthInstances";
|
||||
|
||||
export type ApplicationHealth = {
|
||||
instances: ApplicationHealthInstances;
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type ApplicationHealthInstances = {
|
||||
/**
|
||||
* Number of active containers in this application.
|
||||
*
|
||||
*/
|
||||
active: number;
|
||||
/**
|
||||
* Number of healthy instances. If the application is attached to a DO namespace,
|
||||
* this represents the number of prepared container instances.
|
||||
*
|
||||
*/
|
||||
healthy: number;
|
||||
/**
|
||||
* Number of failing container instances.
|
||||
*
|
||||
*/
|
||||
failed: number;
|
||||
/**
|
||||
* Number of container instances that are being prepared.
|
||||
*
|
||||
*/
|
||||
starting: number;
|
||||
/**
|
||||
* Number of container instances pending to be scheduled.
|
||||
*
|
||||
*/
|
||||
scheduling: number;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* An Application ID represents an identifier of an application
|
||||
*/
|
||||
export type ApplicationID = string;
|
||||
@@ -0,0 +1,76 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationID } from "./ApplicationID";
|
||||
import type { Command } from "./Command";
|
||||
import type { Disk } from "./Disk";
|
||||
import type { DiskMB } from "./DiskMB";
|
||||
import type { Entrypoint } from "./Entrypoint";
|
||||
import type { EnvironmentVariable } from "./EnvironmentVariable";
|
||||
import type { Image } from "./Image";
|
||||
import type { InstanceType } from "./InstanceType";
|
||||
import type { ISO8601Timestamp } from "./ISO8601Timestamp";
|
||||
import type { JobEvents } from "./JobEvents";
|
||||
import type { JobID } from "./JobID";
|
||||
import type { JobStatus } from "./JobStatus";
|
||||
import type { JobTimeoutSeconds } from "./JobTimeoutSeconds";
|
||||
import type { MemorySizeWithUnit } from "./MemorySizeWithUnit";
|
||||
import type { SecretMap } from "./SecretMap";
|
||||
|
||||
/**
|
||||
* An application job is a short-lived instance of an application
|
||||
*/
|
||||
export type ApplicationJob = {
|
||||
id: JobID;
|
||||
app_id: ApplicationID;
|
||||
created_at: ISO8601Timestamp;
|
||||
entrypoint: Entrypoint;
|
||||
command: Command;
|
||||
status: JobStatus;
|
||||
events: JobEvents;
|
||||
image: Image;
|
||||
instance_type?: InstanceType;
|
||||
/**
|
||||
* Allocated vCPUs for this job
|
||||
*/
|
||||
vcpu: number;
|
||||
/**
|
||||
* Allocated vCPUs for this job
|
||||
*/
|
||||
vcpus: number;
|
||||
/**
|
||||
* Allocated memory for this job
|
||||
*/
|
||||
memory_mb: number;
|
||||
/**
|
||||
* Deprecated in favor of memory_mib
|
||||
* @deprecated
|
||||
*/
|
||||
memory: MemorySizeWithUnit;
|
||||
/**
|
||||
* Specify the memory to be used for the deployment, in MiB. The default will be the one configured for the account.
|
||||
*/
|
||||
memory_mib?: number;
|
||||
/**
|
||||
* The disk configuration for this job expressed in string
|
||||
*/
|
||||
disk?: Disk;
|
||||
/**
|
||||
* The disk configuration for this job, expressed as a number (in MB)
|
||||
*/
|
||||
disk_mb?: DiskMB;
|
||||
/**
|
||||
* Job specific environment variables
|
||||
*/
|
||||
environment_variables: Array<EnvironmentVariable>;
|
||||
/**
|
||||
* Job specific secrets mapping
|
||||
*/
|
||||
secrets: Array<SecretMap>;
|
||||
timeout: JobTimeoutSeconds;
|
||||
/**
|
||||
* The job's termination request status. This will be "false" by default. If the user requests a job termination, this will be set to true.
|
||||
*/
|
||||
terminate: boolean;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Application config denoting deployments with Jobs type
|
||||
*/
|
||||
export type ApplicationJobsConfig = boolean;
|
||||
@@ -0,0 +1,21 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Error enums that can be returned when there has been an error with mutating the applications resource
|
||||
*/
|
||||
export enum ApplicationMutationError {
|
||||
IMAGE_REGISTRY_RETURNED_ERROR = "IMAGE_REGISTRY_RETURNED_ERROR",
|
||||
IMAGE_REGISTRY_DOESNT_CONTAIN_IMAGE = "IMAGE_REGISTRY_DOESNT_CONTAIN_IMAGE",
|
||||
VALIDATE_INPUT = "VALIDATE_INPUT",
|
||||
SURPASSED_BASE_LIMITS = "SURPASSED_BASE_LIMITS",
|
||||
SURPASSED_TOTAL_LIMITS = "SURPASSED_TOTAL_LIMITS",
|
||||
LOCATION_NOT_ALLOWED = "LOCATION_NOT_ALLOWED",
|
||||
LOCATION_SURPASSED_BASE_LIMITS = "LOCATION_SURPASSED_BASE_LIMITS",
|
||||
IMAGE_REGISTRY_NOT_CONFIGURED = "IMAGE_REGISTRY_NOT_CONFIGURED",
|
||||
JOB_CREATE_NOT_ALLOWED = "JOB_CREATE_NOT_ALLOWED",
|
||||
DURABLE_OBJECT_NOT_FOUND = "DURABLE_OBJECT_NOT_FOUND",
|
||||
DURABLE_OBJECT_NOT_CONTAINER_ENABLED = "DURABLE_OBJECT_NOT_CONTAINER_ENABLED",
|
||||
DURABLE_OBJECT_ALREADY_HAS_APPLICATION = "DURABLE_OBJECT_ALREADY_HAS_APPLICATION",
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* The application name
|
||||
*/
|
||||
export type ApplicationName = string;
|
||||
@@ -0,0 +1,7 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type ApplicationNotFoundError = {
|
||||
error: string;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationPriority } from "./ApplicationPriority";
|
||||
|
||||
/**
|
||||
* Defines priorities of application instances that are taken into account in scheduling decisions
|
||||
* and used to determine what instances should be evicted in the face of resource scarcity.
|
||||
* The feature is experimental and only supported with the "gpu" scheduling policy.
|
||||
*
|
||||
*/
|
||||
export type ApplicationPriorities = {
|
||||
default: ApplicationPriority;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Application instance priority.
|
||||
*/
|
||||
export type ApplicationPriority = number;
|
||||
@@ -0,0 +1,89 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationHealth } from "./ApplicationHealth";
|
||||
import type { ApplicationRolloutProgress } from "./ApplicationRolloutProgress";
|
||||
import type { ISO8601Timestamp } from "./ISO8601Timestamp";
|
||||
import type { ModifyUserDeploymentConfiguration } from "./ModifyUserDeploymentConfiguration";
|
||||
import type { RolloutID } from "./RolloutID";
|
||||
import type { RolloutStep } from "./RolloutStep";
|
||||
|
||||
/**
|
||||
* Represents the status and metadata of a rollout process for an application.
|
||||
*/
|
||||
export type ApplicationRollout = {
|
||||
description: string;
|
||||
id: RolloutID;
|
||||
created_at: ISO8601Timestamp;
|
||||
/**
|
||||
* Timestamp of the most recent update to status, health, or progress
|
||||
*/
|
||||
last_updated_at: ISO8601Timestamp;
|
||||
/**
|
||||
* Kind of the rollout process.
|
||||
* - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
|
||||
* - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
|
||||
* - "durable_objects_auto": Default when the application is a DO application.
|
||||
*
|
||||
*/
|
||||
kind: ApplicationRollout.kind;
|
||||
/**
|
||||
* The rollout strategy
|
||||
*/
|
||||
strategy: ApplicationRollout.strategy;
|
||||
/**
|
||||
* Current application version before the rollout.
|
||||
*/
|
||||
current_version: number;
|
||||
/**
|
||||
* Target application version after the rollout is complete and applied to all current instances.
|
||||
*/
|
||||
target_version: number;
|
||||
current_configuration: ModifyUserDeploymentConfiguration;
|
||||
target_configuration: ModifyUserDeploymentConfiguration;
|
||||
/**
|
||||
* Current status of the rollout.
|
||||
*/
|
||||
status: ApplicationRollout.status;
|
||||
health: ApplicationHealth;
|
||||
steps: Array<RolloutStep>;
|
||||
progress: ApplicationRolloutProgress;
|
||||
/**
|
||||
* Timestamp when the rollout started.
|
||||
*/
|
||||
started_at?: string;
|
||||
};
|
||||
|
||||
export namespace ApplicationRollout {
|
||||
/**
|
||||
* Kind of the rollout process.
|
||||
* - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
|
||||
* - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
|
||||
* - "durable_objects_auto": Default when the application is a DO application.
|
||||
*
|
||||
*/
|
||||
export enum kind {
|
||||
FULL_AUTO = "full_auto",
|
||||
FULL_MANUAL = "full_manual",
|
||||
DURABLE_OBJECTS_AUTO = "durable_objects_auto",
|
||||
}
|
||||
|
||||
/**
|
||||
* The rollout strategy
|
||||
*/
|
||||
export enum strategy {
|
||||
ROLLING = "rolling",
|
||||
}
|
||||
|
||||
/**
|
||||
* Current status of the rollout.
|
||||
*/
|
||||
export enum status {
|
||||
PENDING = "pending",
|
||||
PROGRESSING = "progressing",
|
||||
COMPLETED = "completed",
|
||||
REVERTED = "reverted",
|
||||
REPLACED = "replaced",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Grace period for active instances to stay alive before becoming elibile for shutdown signal due to a rollout, in seconds.
|
||||
* Defaults to 0.
|
||||
*
|
||||
*/
|
||||
export type ApplicationRolloutActiveGracePeriod = number;
|
||||
@@ -0,0 +1,25 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Progress details of an application rollout.
|
||||
*/
|
||||
export type ApplicationRolloutProgress = {
|
||||
/**
|
||||
* Total number of steps in the rollout.
|
||||
*/
|
||||
total_steps: number;
|
||||
/**
|
||||
* Current step being executed in the rollout process. Initialized to 0.
|
||||
*/
|
||||
current_step: number;
|
||||
/**
|
||||
* Number of instances updated in the rollout process.
|
||||
*/
|
||||
updated_instances: number;
|
||||
/**
|
||||
* Total number of instances affected by the rollout.
|
||||
*/
|
||||
total_instances: number;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ModifyUserDeploymentConfiguration } from "./ModifyUserDeploymentConfiguration";
|
||||
|
||||
export type ApplicationSchedulingHint = {
|
||||
current: {
|
||||
instances: number;
|
||||
configuration: ModifyUserDeploymentConfiguration;
|
||||
version: number;
|
||||
};
|
||||
target: {
|
||||
instances: number;
|
||||
configuration: ModifyUserDeploymentConfiguration;
|
||||
version: number;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* An application status shows information about the application's scheduling status, job queue and other metadata.
|
||||
*/
|
||||
export type ApplicationStatus = {
|
||||
scheduler: Record<string, any>;
|
||||
/**
|
||||
* Job queue status
|
||||
*/
|
||||
jobs: Record<string, any>;
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export enum AssignIPv4 {
|
||||
NONE = "none",
|
||||
PREDEFINED = "predefined",
|
||||
ACCOUNT = "account",
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export enum AssignIPv6 {
|
||||
NONE = "none",
|
||||
PREDEFINED = "predefined",
|
||||
ACCOUNT = "account",
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type BadRequestError = {
|
||||
error: string;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type BadRequestWithCodeError = {
|
||||
/**
|
||||
* If VALIDATE_INPUT, you should see the inputs that were wrong in the details object.
|
||||
*/
|
||||
error: BadRequestWithCodeError.error;
|
||||
/**
|
||||
* Details that might be filled depending on the error code.
|
||||
*/
|
||||
details?: Record<string, any>;
|
||||
};
|
||||
|
||||
export namespace BadRequestWithCodeError {
|
||||
/**
|
||||
* If VALIDATE_INPUT, you should see the inputs that were wrong in the details object.
|
||||
*/
|
||||
export enum error {
|
||||
VALIDATE_INPUT = "VALIDATE_INPUT",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* A city is represented as an airport code like MAD or SFO.
|
||||
*/
|
||||
export type City = string;
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ExecFormParam } from "./ExecFormParam";
|
||||
|
||||
/**
|
||||
* The command to be executed when the container starts, passed to the entrypoint.
|
||||
* This can be overridden at run-time. If only the command is overridden at run-time,
|
||||
* it gets passed to the default entrypoint specified in the image.
|
||||
*
|
||||
*/
|
||||
export type Command = Array<ExecFormParam>;
|
||||
@@ -0,0 +1,20 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { AccountDefaults } from "./AccountDefaults";
|
||||
import type { AccountID } from "./AccountID";
|
||||
import type { AccountLimit } from "./AccountLimit";
|
||||
import type { CompleteAccountLocationCustomer } from "./CompleteAccountLocationCustomer";
|
||||
import type { Identity } from "./Identity";
|
||||
|
||||
/**
|
||||
* Represents a Cloudchamber account object with limits, locations and its defaults. It's the view for the customer.
|
||||
*/
|
||||
export type CompleteAccountCustomer = {
|
||||
external_account_id: AccountID;
|
||||
legacy_identity: Identity;
|
||||
limits: AccountLimit;
|
||||
locations: Array<CompleteAccountLocationCustomer>;
|
||||
defaults: AccountDefaults;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { AccountLocation } from "./AccountLocation";
|
||||
import type { AccountLocationLimitsAsProperty } from "./AccountLocationLimitsAsProperty";
|
||||
import type { Location } from "./Location";
|
||||
|
||||
/**
|
||||
* Represents an account location with a limit property for customers.
|
||||
*/
|
||||
export type CompleteAccountLocationCustomer = AccountLocationLimitsAsProperty &
|
||||
AccountLocation &
|
||||
Location;
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Defines the kind of networking the container will have. If "public", the container will be assigned at least an IPv6, and an IPv4 if "assign_ipv4": true. If "public-by-port" is specified, the IP address assignment logic is the same as with "public". However, at least one port must be specified. Only packets sent to specified ports will be routed to the container. If "private", the container won't have any accessible public IPs, however it will be able to access the internet.
|
||||
*
|
||||
*/
|
||||
export enum ContainerNetworkMode {
|
||||
PUBLIC = "public",
|
||||
PUBLIC_BY_PORT = "public-by-port",
|
||||
PRIVATE = "private",
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationMutationError } from "./ApplicationMutationError";
|
||||
|
||||
export type CreateApplicationBadRequest = {
|
||||
error: ApplicationMutationError;
|
||||
/**
|
||||
* Details that might be filled depending on the error code.
|
||||
*/
|
||||
details?: Record<string, any>;
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationMutationError } from "./ApplicationMutationError";
|
||||
|
||||
export type CreateApplicationJobBadRequest = {
|
||||
error: ApplicationMutationError;
|
||||
/**
|
||||
* Details that might be filled depending on the error code.
|
||||
*/
|
||||
details?: Record<string, any>;
|
||||
};
|
||||
@@ -0,0 +1,54 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Command } from "./Command";
|
||||
import type { Entrypoint } from "./Entrypoint";
|
||||
import type { EnvironmentVariable } from "./EnvironmentVariable";
|
||||
import type { Image } from "./Image";
|
||||
import type { InstanceType } from "./InstanceType";
|
||||
import type { JobSecretMap } from "./JobSecretMap";
|
||||
import type { JobTimeoutSeconds } from "./JobTimeoutSeconds";
|
||||
import type { MemorySizeWithUnit } from "./MemorySizeWithUnit";
|
||||
|
||||
/**
|
||||
* Create a new application Job request body
|
||||
*/
|
||||
export type CreateApplicationJobRequest = {
|
||||
entrypoint: Entrypoint;
|
||||
command: Command;
|
||||
image?: Image;
|
||||
timeout?: JobTimeoutSeconds;
|
||||
instance_type?: InstanceType;
|
||||
/**
|
||||
* Allocate vCPUs for this job. Vcpu must be at least 0.0625. The input value will be rounded to the nearest 0.0001. It
|
||||
* defaults to the application configuration's vCPUs setting, and if that is not specified, it uses the account defaults.
|
||||
*
|
||||
*/
|
||||
vcpus?: number;
|
||||
/**
|
||||
* Allocate vCPUs for this job. Vcpu must be at least 0.0625. The input value will be rounded to the nearest 0.0001. It
|
||||
* defaults to the application configuration's "vCPU" setting, and if that is not specified, it uses the account defaults.
|
||||
*
|
||||
*/
|
||||
vcpu?: number;
|
||||
/**
|
||||
* Deprecated in favor of memory_mib
|
||||
* @deprecated
|
||||
*/
|
||||
memory?: MemorySizeWithUnit;
|
||||
/**
|
||||
* Amount of memory to allocate for this job, in MiB. It defaults to the application configuration's memory setting,
|
||||
* and if that is not specified, it uses the account defaults.
|
||||
*
|
||||
*/
|
||||
memory_mib?: number;
|
||||
/**
|
||||
* Set job specific environment vars. If an env var already exists in the application configuration it would be overriden.
|
||||
*/
|
||||
environment_variables?: Array<EnvironmentVariable>;
|
||||
/**
|
||||
* Set job specific secrets.
|
||||
*/
|
||||
secrets?: Array<JobSecretMap>;
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationAffinities } from "./ApplicationAffinities";
|
||||
import type { ApplicationConstraints } from "./ApplicationConstraints";
|
||||
import type { ApplicationJobsConfig } from "./ApplicationJobsConfig";
|
||||
import type { ApplicationPriorities } from "./ApplicationPriorities";
|
||||
import type { ApplicationRolloutActiveGracePeriod } from "./ApplicationRolloutActiveGracePeriod";
|
||||
import type { DurableObjectsConfiguration } from "./DurableObjectsConfiguration";
|
||||
import type { SchedulingPolicy } from "./SchedulingPolicy";
|
||||
import type { UserDeploymentConfiguration } from "./UserDeploymentConfiguration";
|
||||
|
||||
/**
|
||||
* Create a new application object for dynamic scheduling
|
||||
*/
|
||||
export type CreateApplicationRequest = {
|
||||
/**
|
||||
* The name for this application
|
||||
*/
|
||||
name: string;
|
||||
scheduling_policy: SchedulingPolicy;
|
||||
/**
|
||||
* Number of deployments to create
|
||||
*/
|
||||
instances: number;
|
||||
/**
|
||||
* Maximum number of instances that the application will allow. This is relevant for applications that auto-scale.
|
||||
*/
|
||||
max_instances?: number;
|
||||
constraints?: ApplicationConstraints;
|
||||
/**
|
||||
* The deployment configuration of all deployments created by this application.
|
||||
*
|
||||
*/
|
||||
configuration: UserDeploymentConfiguration;
|
||||
jobs?: ApplicationJobsConfig;
|
||||
/**
|
||||
* If set, it will make the container application back a durable object namespace.
|
||||
*/
|
||||
durable_objects?: DurableObjectsConfiguration;
|
||||
affinities?: ApplicationAffinities;
|
||||
priorities?: ApplicationPriorities;
|
||||
rollout_active_grace_period?: ApplicationRolloutActiveGracePeriod;
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ModifyUserDeploymentConfiguration } from "./ModifyUserDeploymentConfiguration";
|
||||
import type { RolloutStepRequest } from "./RolloutStepRequest";
|
||||
|
||||
/**
|
||||
* Request body to create a new rollout for an application.
|
||||
*/
|
||||
export type CreateApplicationRolloutRequest = {
|
||||
target_configuration: ModifyUserDeploymentConfiguration;
|
||||
/**
|
||||
* Strategy used for the rollout. Currently supports only "rolling".
|
||||
*/
|
||||
strategy: CreateApplicationRolloutRequest.strategy;
|
||||
/**
|
||||
* Percentage of rollout to increase in each step when "steps" is not specificed. Applicable values are 5, 10, 20, 25, 50, 100.
|
||||
* These create rollouts with 20, 10, 5, 4, 2, 1 steps respectively.
|
||||
*
|
||||
*/
|
||||
step_percentage?: CreateApplicationRolloutRequest.step_percentage;
|
||||
/**
|
||||
* Steps defining the rollout process, when "step_percentage" is not defined.
|
||||
* Only one of "step_percentage" or "steps" can be defined when creating a rollout.
|
||||
* "steps" allow granular control over each step.
|
||||
*
|
||||
*/
|
||||
steps?: Array<RolloutStepRequest>;
|
||||
/**
|
||||
* Description of the rollout process.
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Kind of the rollout process.
|
||||
* - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
|
||||
* - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
|
||||
*
|
||||
*/
|
||||
kind?: CreateApplicationRolloutRequest.kind;
|
||||
};
|
||||
|
||||
export namespace CreateApplicationRolloutRequest {
|
||||
/**
|
||||
* Strategy used for the rollout. Currently supports only "rolling".
|
||||
*/
|
||||
export enum strategy {
|
||||
ROLLING = "rolling",
|
||||
}
|
||||
|
||||
/**
|
||||
* Percentage of rollout to increase in each step when "steps" is not specificed. Applicable values are 5, 10, 20, 25, 50, 100.
|
||||
* These create rollouts with 20, 10, 5, 4, 2, 1 steps respectively.
|
||||
*
|
||||
*/
|
||||
export enum step_percentage {
|
||||
"_5" = 5,
|
||||
"_10" = 10,
|
||||
"_20" = 20,
|
||||
"_25" = 25,
|
||||
"_50" = 50,
|
||||
"_100" = 100,
|
||||
}
|
||||
|
||||
/**
|
||||
* Kind of the rollout process.
|
||||
* - "full_auto": The default rollout mode, which starts progressing the steps upon rollout creation.
|
||||
* - "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action paramater.
|
||||
*
|
||||
*/
|
||||
export enum kind {
|
||||
FULL_AUTO = "full_auto",
|
||||
FULL_MANUAL = "full_manual",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DeploymentMutationError } from "./DeploymentMutationError";
|
||||
|
||||
export type CreateDeploymentBadRequest = {
|
||||
error: DeploymentMutationError;
|
||||
/**
|
||||
* Details that might be filled depending on the error code.
|
||||
*/
|
||||
details?: Record<string, any>;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { SchedulerDeploymentConfiguration } from "./SchedulerDeploymentConfiguration";
|
||||
import type { UserDeploymentConfiguration } from "./UserDeploymentConfiguration";
|
||||
|
||||
/**
|
||||
* Request body for creating a new deployment
|
||||
*/
|
||||
export type CreateDeploymentV2RequestBody = UserDeploymentConfiguration &
|
||||
SchedulerDeploymentConfiguration;
|
||||
@@ -0,0 +1,20 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Domain } from "./Domain";
|
||||
import type { ExternalRegistryKind } from "./ExternalRegistryKind";
|
||||
import type { ImageRegistryAuth } from "./ImageRegistryAuth";
|
||||
|
||||
/**
|
||||
* Request body for creating a new image registry configuration
|
||||
*/
|
||||
export type CreateImageRegistryRequestBody = {
|
||||
domain: Domain;
|
||||
/**
|
||||
* If you own the registry and is private, this should be false or not defined. If it's a public registry like docker.io, you should set this to true
|
||||
*/
|
||||
is_public?: boolean;
|
||||
auth?: ImageRegistryAuth;
|
||||
kind?: ExternalRegistryKind;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type CreateSSHPublicKeyError = {
|
||||
error: string;
|
||||
request_id: string;
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { SSHPublicKey } from "./SSHPublicKey";
|
||||
|
||||
/**
|
||||
* Request body for adding a new SSH public key
|
||||
*/
|
||||
export type CreateSSHPublicKeyRequestBody = {
|
||||
name: string;
|
||||
public_key: SSHPublicKey;
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DefaultImageRegistryKind } from "./DefaultImageRegistryKind";
|
||||
import type { Domain } from "./Domain";
|
||||
import type { ExternalRegistryKind } from "./ExternalRegistryKind";
|
||||
import type { ISO8601Timestamp } from "./ISO8601Timestamp";
|
||||
import type { SecretsStoreRef } from "./SecretsStoreRef";
|
||||
|
||||
/**
|
||||
* An image registry added in a customer account
|
||||
*/
|
||||
export type CustomerImageRegistry = {
|
||||
/**
|
||||
* A base64 representation of the public key that you can set to configure the registry. If null, the registry is public and doesn't have authentication setup with Cloudchamber
|
||||
*/
|
||||
public_key?: string;
|
||||
private_credential?: SecretsStoreRef;
|
||||
domain: Domain;
|
||||
/**
|
||||
* The type of registry that is being configured.
|
||||
*/
|
||||
kind?: ExternalRegistryKind | DefaultImageRegistryKind;
|
||||
created_at: ISO8601Timestamp;
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Domain } from "./Domain";
|
||||
import type { IP } from "./IP";
|
||||
|
||||
/**
|
||||
* Represents the /etc/resolv.conf that will appear in the deployment.
|
||||
* If the 'dns' property is specified, even if empty object, will override the default resolv.conf of the container.
|
||||
* The default resolv.conf of a container is 'servers = ["1.1.1.1", "9.9.9.9", "2606:4700:4700::1111"]', only if an IPv4 is assigned.
|
||||
* The default for a non IPv4 deployment is 'servers = ["2606:4700:4700::1111", "2620:fe::fe"]'.
|
||||
*
|
||||
*/
|
||||
export type DNSConfiguration = {
|
||||
/**
|
||||
* List of DNS servers that the deployment will use to resolve domain names. You can only specify a maximum of 3.
|
||||
*/
|
||||
servers?: Array<IP>;
|
||||
/**
|
||||
* The container resolver will append these domains to every resolve query. For example, if you have 'google.com',
|
||||
* and your deployment queries 'web', it will append 'google.com' to 'web' in the search query before trying 'web'.
|
||||
* Limited to 6 domains.
|
||||
*
|
||||
*/
|
||||
searches?: Array<Domain>;
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApplicationHealth } from "./ApplicationHealth";
|
||||
import type { ApplicationID } from "./ApplicationID";
|
||||
import type { ApplicationName } from "./ApplicationName";
|
||||
import type { Image } from "./Image";
|
||||
import type { ISO8601Timestamp } from "./ISO8601Timestamp";
|
||||
|
||||
/**
|
||||
* Summary representation of a container application, returned by the Dash endpoint.
|
||||
* Contains only the fields needed for list display, not the full configuration.
|
||||
*/
|
||||
export type DashApplication = {
|
||||
id: ApplicationID;
|
||||
created_at: ISO8601Timestamp;
|
||||
updated_at: ISO8601Timestamp;
|
||||
name: ApplicationName;
|
||||
version: number;
|
||||
instances: number;
|
||||
image: Image;
|
||||
health: ApplicationHealth;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DashApplicationDurableObjectInstance = {
|
||||
id: string;
|
||||
deployment_id?: string;
|
||||
placement_id?: string;
|
||||
assigned_at: string;
|
||||
name?: string;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DeploymentType } from "./DeploymentType";
|
||||
import type { Placement } from "./Placement";
|
||||
|
||||
export type DashApplicationInstance = {
|
||||
id: string;
|
||||
created_at: string;
|
||||
current_placement?: Placement;
|
||||
type?: DeploymentType;
|
||||
location: string;
|
||||
region?: string;
|
||||
app_version: number;
|
||||
name?: string;
|
||||
image?: string;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DashApplicationDurableObjectInstance } from "./DashApplicationDurableObjectInstance";
|
||||
import type { DashApplicationInstance } from "./DashApplicationInstance";
|
||||
|
||||
export type DashApplicationInstances = {
|
||||
instances: DashApplicationInstance[];
|
||||
durable_objects?: DashApplicationDurableObjectInstance[];
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export enum DefaultImageRegistryKind {
|
||||
DEFAULT = "default",
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DeleteDeploymentError = {
|
||||
error: string;
|
||||
request_id: string;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Response body after deleting an image registry.
|
||||
*/
|
||||
export type DeleteImageRegistryResponse = {
|
||||
domain: string;
|
||||
secrets_store_ref?: string;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DeploymentAlreadyExists = {
|
||||
error: string;
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DeploymentCheckHTTP } from "./DeploymentCheckHTTP";
|
||||
import type { DeploymentCheckRequestBody } from "./DeploymentCheckRequestBody";
|
||||
|
||||
export type DeploymentCheck = DeploymentCheckRequestBody & {
|
||||
/**
|
||||
* Name of the check
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Options for HTTP checks. Only valid when "type" is "http"
|
||||
*/
|
||||
http?: DeploymentCheckHTTP;
|
||||
/**
|
||||
* Connect to the port using TLS
|
||||
*/
|
||||
tls: boolean;
|
||||
/**
|
||||
* Number of times to attempt the check before considering it to have failed
|
||||
*/
|
||||
attempts_before_failure: number;
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { HTTPMethod } from "./HTTPMethod";
|
||||
|
||||
/**
|
||||
* Options for HTTP checks.
|
||||
*/
|
||||
export type DeploymentCheckHTTP = {
|
||||
method: HTTPMethod;
|
||||
/**
|
||||
* If the method is one of POST, PATCH or PUT, this is required. It's the body that will be passed to the HTTP healthcheck request.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* Path that will be used to perform the healthcheck.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* HTTP headers to include in the request.
|
||||
*/
|
||||
headers: Record<string, any>;
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { HTTPMethod } from "./HTTPMethod";
|
||||
|
||||
/**
|
||||
* Configuration for HTTP checks.
|
||||
*/
|
||||
export type DeploymentCheckHTTPRequestBody = {
|
||||
method?: HTTPMethod;
|
||||
/**
|
||||
* If the method is one of POST, PATCH or PUT, this is required. It's the body that will be passed to the HTTP healthcheck request.
|
||||
*/
|
||||
body?: string;
|
||||
/**
|
||||
* Path that will be used to perform the healthcheck.
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* HTTP headers to include in the request.
|
||||
*/
|
||||
headers?: Record<string, any>;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export enum DeploymentCheckKind {
|
||||
HEALTH = "health",
|
||||
READY = "ready",
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DeploymentCheckHTTPRequestBody } from "./DeploymentCheckHTTPRequestBody";
|
||||
import type { DeploymentCheckKind } from "./DeploymentCheckKind";
|
||||
import type { DeploymentCheckType } from "./DeploymentCheckType";
|
||||
import type { Duration } from "./Duration";
|
||||
|
||||
/**
|
||||
* Health and readiness checks for a deployment
|
||||
*/
|
||||
export type DeploymentCheckRequestBody = {
|
||||
/**
|
||||
* Optional name for the check. If omitted, a name will be generated automatically.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The type of check to perform. A TCP check succeeds if it can connect to the provided port. An HTTP check succeeds if it receives a successful HTTP response (2XX)
|
||||
*/
|
||||
type: DeploymentCheckType;
|
||||
/**
|
||||
* Connect to the port using TLS
|
||||
*/
|
||||
tls?: boolean;
|
||||
/**
|
||||
* The name of the port defined in the "ports" property of the deployment
|
||||
*/
|
||||
port: string;
|
||||
/**
|
||||
* Configuration for HTTP checks. Only valid when "type" is "http"
|
||||
*/
|
||||
http?: DeploymentCheckHTTPRequestBody;
|
||||
/**
|
||||
* How often the check should be performed
|
||||
*/
|
||||
interval: Duration;
|
||||
/**
|
||||
* The amount of time to wait for the check to complete before considering the check to have failed
|
||||
*/
|
||||
timeout: Duration;
|
||||
/**
|
||||
* Number of times to attempt the check before considering it to have failed
|
||||
*/
|
||||
attempts_before_failure?: number;
|
||||
/**
|
||||
* The kind of check. A failed "healthy" check affects a deployment's "healthy" status, while a failed "ready" check affects a deployment's "ready" status
|
||||
*/
|
||||
kind: DeploymentCheckKind;
|
||||
/**
|
||||
* Initial time period after container start during which failed checks will be ignored
|
||||
*/
|
||||
grace_period?: Duration;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export enum DeploymentCheckType {
|
||||
HTTP = "http",
|
||||
TCP = "tcp",
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DeploymentCreationError = {
|
||||
error: string;
|
||||
request_id: string;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* A deployment ID represents an identifier of a deployment configuration that maintains a healthy placement
|
||||
*/
|
||||
export type DeploymentID = string;
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DeploymentListError = {
|
||||
error: string;
|
||||
request_id: string;
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { LocationID } from "./LocationID";
|
||||
import type { Region } from "./Region";
|
||||
|
||||
/**
|
||||
* Represents some rich information about a location including it's enabled status
|
||||
*/
|
||||
export type DeploymentLocation = {
|
||||
name: LocationID;
|
||||
/**
|
||||
* Shows if the location is enabled to run deployments
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Shows the region of the location
|
||||
*/
|
||||
region?: Region;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DeploymentModificationError = {
|
||||
error: string;
|
||||
request_id: string;
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Error enums that can be returned when there has been an error with mutating the deployments resource
|
||||
*/
|
||||
export enum DeploymentMutationError {
|
||||
VALIDATE_INPUT = "VALIDATE_INPUT",
|
||||
SURPASSED_BASE_LIMITS = "SURPASSED_BASE_LIMITS",
|
||||
SURPASSED_TOTAL_LIMITS = "SURPASSED_TOTAL_LIMITS",
|
||||
LOCATION_NOT_ALLOWED = "LOCATION_NOT_ALLOWED",
|
||||
LOCATION_SURPASSED_BASE_LIMITS = "LOCATION_SURPASSED_BASE_LIMITS",
|
||||
IMAGE_REGISTRY_NOT_CONFIGURED = "IMAGE_REGISTRY_NOT_CONFIGURED",
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Response when the deployment that is backing the resource is not found.
|
||||
*
|
||||
*/
|
||||
export type DeploymentNotFoundError = {
|
||||
error: DeploymentNotFoundError.error;
|
||||
};
|
||||
|
||||
export namespace DeploymentNotFoundError {
|
||||
export enum error {
|
||||
DEPLOYMENT_NOT_FOUND = "DEPLOYMENT_NOT_FOUND",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* State of the deployment's current placement
|
||||
*/
|
||||
export enum DeploymentPlacementState {
|
||||
RUNNING = "running",
|
||||
STOPPED = "stopped",
|
||||
STARTING = "starting",
|
||||
STOPPING = "stopping",
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DeploymentQueuedReason } from "./DeploymentQueuedReason";
|
||||
|
||||
/**
|
||||
* Details on each property that might make the deployment stuck in the queue
|
||||
*/
|
||||
export type DeploymentQueuedDetails = {
|
||||
gpu?: DeploymentQueuedReason;
|
||||
cpu?: DeploymentQueuedReason;
|
||||
memory?: DeploymentQueuedReason;
|
||||
disk?: DeploymentQueuedReason;
|
||||
unknown?: DeploymentQueuedReason;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* A reason on why the deployment cannot be placed
|
||||
*/
|
||||
export enum DeploymentQueuedReason {
|
||||
UNKNOWN = "unknown",
|
||||
LOCATION_OVERPROVISIONED = "location_overprovisioned",
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DeploymentReplacementError = {
|
||||
error: string;
|
||||
request_id: string;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Current scheduling state of the deployment
|
||||
*/
|
||||
export enum DeploymentSchedulingState {
|
||||
SCHEDULED = "scheduled",
|
||||
PLACED = "placed",
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { SecretAccessType } from "./SecretAccessType";
|
||||
|
||||
/**
|
||||
* Specifies how secrets are accessed in containers, defining the name of the secret within the container and the corresponding account secret name.
|
||||
*/
|
||||
export type DeploymentSecretMap = {
|
||||
/**
|
||||
* The name of the secret within the container
|
||||
*/
|
||||
name: string;
|
||||
type: SecretAccessType;
|
||||
/**
|
||||
* Corresponding secret name from the account
|
||||
*/
|
||||
secret: string;
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DeploymentQueuedDetails } from "./DeploymentQueuedDetails";
|
||||
import type { DeploymentSchedulingState } from "./DeploymentSchedulingState";
|
||||
import type { ISO8601Timestamp } from "./ISO8601Timestamp";
|
||||
|
||||
export type DeploymentState = {
|
||||
current: DeploymentSchedulingState;
|
||||
last_updated: ISO8601Timestamp;
|
||||
queued_details?: DeploymentQueuedDetails;
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* The type of deployment that determines how the deployment executes.
|
||||
*
|
||||
* - "default": Means that the deployment is long-running and will always maintain
|
||||
* a single placement (aka container) running at the same time.
|
||||
* It's the classic and default definition of a deployment in Cloudchamber.
|
||||
* - "jobs": Means that the deployment will subscribe itself to a durable object control plane
|
||||
* that receives jobs to run. It will prewarm a deployment in a metal to receive jobs
|
||||
* and run them immediately.
|
||||
* - "durable_object": Means that the deployment will back a single durable object instance.
|
||||
* It's similar to jobs in the sense that the user decides when the container starts and ends.
|
||||
*
|
||||
* The default is long-running deployments with "default".
|
||||
*
|
||||
*/
|
||||
export enum DeploymentType {
|
||||
DEFAULT = "default",
|
||||
JOBS = "jobs",
|
||||
DURABLE_OBJECT = "durable_object",
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { AccountID } from "./AccountID";
|
||||
import type { ApplicationID } from "./ApplicationID";
|
||||
import type { Command } from "./Command";
|
||||
import type { DeploymentCheck } from "./DeploymentCheck";
|
||||
import type { DeploymentID } from "./DeploymentID";
|
||||
import type { DeploymentLocation } from "./DeploymentLocation";
|
||||
import type { DeploymentSecretMap } from "./DeploymentSecretMap";
|
||||
import type { DeploymentState } from "./DeploymentState";
|
||||
import type { DeploymentType } from "./DeploymentType";
|
||||
import type { DeploymentVersion } from "./DeploymentVersion";
|
||||
import type { Disk } from "./Disk";
|
||||
import type { DNSConfiguration } from "./DNSConfiguration";
|
||||
import type { Entrypoint } from "./Entrypoint";
|
||||
import type { EnvironmentVariable } from "./EnvironmentVariable";
|
||||
import type { Image } from "./Image";
|
||||
import type { InstanceType } from "./InstanceType";
|
||||
import type { ISO8601Timestamp } from "./ISO8601Timestamp";
|
||||
import type { Label } from "./Label";
|
||||
import type { MemorySizeWithUnit } from "./MemorySizeWithUnit";
|
||||
import type { Network } from "./Network";
|
||||
import type { NodeGroup } from "./NodeGroup";
|
||||
import type { Observability } from "./Observability";
|
||||
import type { Placement } from "./Placement";
|
||||
import type { Ref } from "./Ref";
|
||||
import type { SSHPublicKeyID } from "./SSHPublicKeyID";
|
||||
import type { UserSSHPublicKey } from "./UserSSHPublicKey";
|
||||
import type { WranglerSSHConfig } from "./WranglerSSHConfig";
|
||||
|
||||
/**
|
||||
* A Deployment represents an intent to run one or many containers, with the same image, in a particular location or region.
|
||||
*/
|
||||
export type DeploymentV2 = {
|
||||
id: DeploymentID;
|
||||
app_id?: ApplicationID;
|
||||
app_version?: number;
|
||||
created_at: ISO8601Timestamp;
|
||||
account_id: AccountID;
|
||||
version: DeploymentVersion;
|
||||
type: DeploymentType;
|
||||
image: Image;
|
||||
location: DeploymentLocation;
|
||||
wrangler_ssh?: WranglerSSHConfig;
|
||||
authorized_keys?: Array<UserSSHPublicKey>;
|
||||
/**
|
||||
* A list of SSH public key IDs from the account
|
||||
*/
|
||||
ssh_public_key_ids?: Array<SSHPublicKeyID>;
|
||||
/**
|
||||
* A list of objects with secret names and the their access types from the account
|
||||
*/
|
||||
secrets?: Array<DeploymentSecretMap>;
|
||||
/**
|
||||
* Container environment variables
|
||||
*/
|
||||
environment_variables?: Array<EnvironmentVariable>;
|
||||
/**
|
||||
* Deployment labels
|
||||
*/
|
||||
labels?: Array<Label>;
|
||||
current_placement?: Placement;
|
||||
placements_ref: Ref;
|
||||
instance_type?: InstanceType;
|
||||
/**
|
||||
* The vcpu of this deployment
|
||||
*/
|
||||
vcpu: number;
|
||||
/**
|
||||
* Deprecated in favor of memory_mib
|
||||
* @deprecated
|
||||
*/
|
||||
memory: MemorySizeWithUnit;
|
||||
/**
|
||||
* The memory of this deployment, in MiB
|
||||
*/
|
||||
memory_mib: number;
|
||||
/**
|
||||
* The node group of this deployment
|
||||
*/
|
||||
node_group: NodeGroup;
|
||||
/**
|
||||
* The disk configuration for this deployment
|
||||
*/
|
||||
disk?: Disk;
|
||||
network: Network;
|
||||
/**
|
||||
* Deprecated in favor of gpu_memory_mib
|
||||
* @deprecated
|
||||
*/
|
||||
gpu_memory?: MemorySizeWithUnit;
|
||||
/**
|
||||
* The GPU memory of this deployment, in MiB. If deployment is not node_group 'gpu', this will be null
|
||||
*/
|
||||
gpu_memory_mib?: number;
|
||||
command?: Command;
|
||||
entrypoint?: Entrypoint;
|
||||
dns?: DNSConfiguration;
|
||||
/**
|
||||
* Health and readiness checks for this deployment.
|
||||
*/
|
||||
checks?: Array<DeploymentCheck>;
|
||||
state?: DeploymentState;
|
||||
observability?: Observability;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* A monotonic version associated with a specific deployment. The version starts at 0 and increase by 1 every time a change is made.
|
||||
*/
|
||||
export type DeploymentVersion = number;
|
||||
@@ -0,0 +1,20 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { DiskSizeWithUnit } from "./DiskSizeWithUnit";
|
||||
|
||||
/**
|
||||
* The disk configuration for this deployment. By default, all containers have a disk size of 2GB.
|
||||
*/
|
||||
export type Disk = {
|
||||
/**
|
||||
* Deprecated in favor of size_mb.
|
||||
* @deprecated
|
||||
*/
|
||||
size?: DiskSizeWithUnit;
|
||||
/**
|
||||
* Size of the disk, in MB.
|
||||
*/
|
||||
size_mb?: number;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* The disk configuration for this deployment (in MB).
|
||||
*/
|
||||
export type DiskMB = {
|
||||
size_mb: number;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* A disk size that specifies its unit at the end.
|
||||
*/
|
||||
export type DiskSizeWithUnit = string;
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* A string representation of a domain name. See RFC-1034 (https://www.ietf.org/rfc/rfc1034.txt). Consider that the limit of a domain name is min 3 and max 253 ASCII characters.
|
||||
*/
|
||||
export type Domain = string;
|
||||
@@ -0,0 +1,14 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Represents the durable object status of a Placement. If empty, should be assumed that it's disconnected.
|
||||
* - connected: The Placement is connected to a durable object.
|
||||
* - disconnected: The Placement got disconnected from a durable object.
|
||||
*
|
||||
*/
|
||||
export enum DurableObjectStatusHealth {
|
||||
CONNECTED = "connected",
|
||||
DISCONNECTED = "disconnected",
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Set of properties to configure a durable object application in Cloudchamber
|
||||
*/
|
||||
export type DurableObjectsConfiguration = {
|
||||
/**
|
||||
* The namespace ID of a durable object namespace. It's assigned when the user deploys for the first time
|
||||
* a durable object namespace.
|
||||
*
|
||||
*/
|
||||
namespace_id: string;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* Duration string. From Go documentation:
|
||||
* A string representing the duration in the form "3d1h3m". Leading zero units are omitted.
|
||||
* As a special case, durations less than one second format use a smaller unit (milli-, micro-, or nanoseconds)
|
||||
* to ensure that the leading digit is non-zero.
|
||||
*
|
||||
*/
|
||||
export type Duration = string;
|
||||
@@ -0,0 +1,8 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
/**
|
||||
* An empty response body
|
||||
*/
|
||||
export type EmptyResponse = Record<string, any>;
|
||||
@@ -0,0 +1,13 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ExecFormParam } from "./ExecFormParam";
|
||||
|
||||
/**
|
||||
* The entry point for the container, specifying the executable to run when the container starts.
|
||||
* This can be overridden at run-time. If overridden, the default command from the image is ignored.
|
||||
* Both entrypoint and command can be specified at run-time to completely replace the image defaults.
|
||||
*
|
||||
*/
|
||||
export type Entrypoint = Array<ExecFormParam>;
|
||||
@@ -0,0 +1,14 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
import type { EnvironmentVariableName } from "./EnvironmentVariableName";
|
||||
import type { EnvironmentVariableValue } from "./EnvironmentVariableValue";
|
||||
|
||||
/**
|
||||
* An environment variable with a value set
|
||||
*/
|
||||
export type EnvironmentVariable = {
|
||||
name: EnvironmentVariableName;
|
||||
value: EnvironmentVariableValue;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user