fis: updates to remove Terraform Provider reserved word collisions

Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
allanice001
2025-12-05 12:17:36 +00:00
parent efac33fba6
commit 0b342f2c65
206 changed files with 29051 additions and 1896 deletions

View File

@@ -0,0 +1,432 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoAnnotationResponse, DtoCreateAnnotationRequest, DtoUpdateAnnotationRequest,} from "../models/index";
import {
DtoAnnotationResponseFromJSON,
DtoCreateAnnotationRequestToJSON,
DtoUpdateAnnotationRequestToJSON,
} from "../models/index";
export interface CreateAnnotationRequest {
dtoCreateAnnotationRequest: DtoCreateAnnotationRequest;
xOrgID?: string;
}
export interface DeleteAnnotationRequest {
id: string;
xOrgID?: string;
}
export interface GetAnnotationRequest {
id: string;
xOrgID?: string;
}
export interface ListAnnotationsRequest {
xOrgID?: string;
key?: string;
value?: string;
q?: string;
}
export interface UpdateAnnotationRequest {
id: string;
dtoUpdateAnnotationRequest: DtoUpdateAnnotationRequest;
xOrgID?: string;
}
/**
*
*/
export class AnnotationsApi extends runtime.BaseAPI {
/**
* Creates an annotation.
* Create annotation (org scoped)
*/
async createAnnotationRaw(
requestParameters: CreateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoAnnotationResponse>> {
if (requestParameters["dtoCreateAnnotationRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateAnnotationRequest",
'Required parameter "dtoCreateAnnotationRequest" was null or undefined when calling createAnnotation().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateAnnotationRequestToJSON(
requestParameters["dtoCreateAnnotationRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoAnnotationResponseFromJSON(jsonValue),
);
}
/**
* Creates an annotation.
* Create annotation (org scoped)
*/
async createAnnotation(
requestParameters: CreateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoAnnotationResponse> {
const response = await this.createAnnotationRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Permanently deletes the annotation.
* Delete annotation (org scoped)
*/
async deleteAnnotationRaw(
requestParameters: DeleteAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteAnnotation().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Permanently deletes the annotation.
* Delete annotation (org scoped)
*/
async deleteAnnotation(
requestParameters: DeleteAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteAnnotationRaw(requestParameters, initOverrides);
}
/**
* Returns one annotation. Add `include=node_pools` to include node pools.
* Get annotation by ID (org scoped)
*/
async getAnnotationRaw(
requestParameters: GetAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoAnnotationResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getAnnotation().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoAnnotationResponseFromJSON(jsonValue),
);
}
/**
* Returns one annotation. Add `include=node_pools` to include node pools.
* Get annotation by ID (org scoped)
*/
async getAnnotation(
requestParameters: GetAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoAnnotationResponse> {
const response = await this.getAnnotationRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Returns annotations for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.
* List annotations (org scoped)
*/
async listAnnotationsRaw(
requestParameters: ListAnnotationsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoAnnotationResponse>>> {
const queryParameters: any = {};
if (requestParameters["key"] != null) {
queryParameters["key"] = requestParameters["key"];
}
if (requestParameters["value"] != null) {
queryParameters["value"] = requestParameters["value"];
}
if (requestParameters["q"] != null) {
queryParameters["q"] = requestParameters["q"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoAnnotationResponseFromJSON),
);
}
/**
* Returns annotations for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.
* List annotations (org scoped)
*/
async listAnnotations(
requestParameters: ListAnnotationsRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoAnnotationResponse>> {
const response = await this.listAnnotationsRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Partially update annotation fields.
* Update annotation (org scoped)
*/
async updateAnnotationRaw(
requestParameters: UpdateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoAnnotationResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateAnnotation().',
);
}
if (requestParameters["dtoUpdateAnnotationRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateAnnotationRequest",
'Required parameter "dtoUpdateAnnotationRequest" was null or undefined when calling updateAnnotation().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateAnnotationRequestToJSON(
requestParameters["dtoUpdateAnnotationRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoAnnotationResponseFromJSON(jsonValue),
);
}
/**
* Partially update annotation fields.
* Update annotation (org scoped)
*/
async updateAnnotation(
requestParameters: UpdateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoAnnotationResponse> {
const response = await this.updateAnnotationRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View File

@@ -0,0 +1,357 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoEnqueueRequest, DtoJob, DtoPageJob, DtoQueueInfo,} from "../models/index";
import {DtoEnqueueRequestToJSON, DtoJobFromJSON, DtoPageJobFromJSON, DtoQueueInfoFromJSON,} from "../models/index";
export interface AdminCancelArcherJobRequest {
id: string;
body?: object;
}
export interface AdminEnqueueArcherJobRequest {
dtoEnqueueRequest: DtoEnqueueRequest;
}
export interface AdminListArcherJobsRequest {
status?: AdminListArcherJobsStatusEnum;
queue?: string;
q?: string;
page?: number;
pageSize?: number;
}
export interface AdminRetryArcherJobRequest {
id: string;
body?: object;
}
/**
*
*/
export class ArcherAdminApi extends runtime.BaseAPI {
/**
* Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
* Cancel an Archer job (admin)
*/
async adminCancelArcherJobRaw(
requestParameters: AdminCancelArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling adminCancelArcherJob().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs/{id}/cancel`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoJobFromJSON(jsonValue),
);
}
/**
* Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
* Cancel an Archer job (admin)
*/
async adminCancelArcherJob(
requestParameters: AdminCancelArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoJob> {
const response = await this.adminCancelArcherJobRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Create a job immediately or schedule it for the future via `run_at`.
* Enqueue a new Archer job (admin)
*/
async adminEnqueueArcherJobRaw(
requestParameters: AdminEnqueueArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters["dtoEnqueueRequest"] == null) {
throw new runtime.RequiredError(
"dtoEnqueueRequest",
'Required parameter "dtoEnqueueRequest" was null or undefined when calling adminEnqueueArcherJob().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoEnqueueRequestToJSON(requestParameters["dtoEnqueueRequest"]),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoJobFromJSON(jsonValue),
);
}
/**
* Create a job immediately or schedule it for the future via `run_at`.
* Enqueue a new Archer job (admin)
*/
async adminEnqueueArcherJob(
requestParameters: AdminEnqueueArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoJob> {
const response = await this.adminEnqueueArcherJobRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
* List Archer jobs (admin)
*/
async adminListArcherJobsRaw(
requestParameters: AdminListArcherJobsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoPageJob>> {
const queryParameters: any = {};
if (requestParameters["status"] != null) {
queryParameters["status"] = requestParameters["status"];
}
if (requestParameters["queue"] != null) {
queryParameters["queue"] = requestParameters["queue"];
}
if (requestParameters["q"] != null) {
queryParameters["q"] = requestParameters["q"];
}
if (requestParameters["page"] != null) {
queryParameters["page"] = requestParameters["page"];
}
if (requestParameters["pageSize"] != null) {
queryParameters["page_size"] = requestParameters["pageSize"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoPageJobFromJSON(jsonValue),
);
}
/**
* Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
* List Archer jobs (admin)
*/
async adminListArcherJobs(
requestParameters: AdminListArcherJobsRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoPageJob> {
const response = await this.adminListArcherJobsRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Summary metrics per queue (pending, running, failed, scheduled).
* List Archer queues (admin)
*/
async adminListArcherQueuesRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoQueueInfo>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/queues`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoQueueInfoFromJSON),
);
}
/**
* Summary metrics per queue (pending, running, failed, scheduled).
* List Archer queues (admin)
*/
async adminListArcherQueues(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoQueueInfo>> {
const response = await this.adminListArcherQueuesRaw(initOverrides);
return await response.value();
}
/**
* Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
* Retry a failed/canceled Archer job (admin)
*/
async adminRetryArcherJobRaw(
requestParameters: AdminRetryArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling adminRetryArcherJob().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs/{id}/retry`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoJobFromJSON(jsonValue),
);
}
/**
* Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
* Retry a failed/canceled Archer job (admin)
*/
async adminRetryArcherJob(
requestParameters: AdminRetryArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoJob> {
const response = await this.adminRetryArcherJobRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}
/**
* @export
*/
export const AdminListArcherJobsStatusEnum = {
queued: "queued",
running: "running",
succeeded: "succeeded",
failed: "failed",
canceled: "canceled",
retrying: "retrying",
scheduled: "scheduled",
} as const;
export type AdminListArcherJobsStatusEnum =
(typeof AdminListArcherJobsStatusEnum)[keyof typeof AdminListArcherJobsStatusEnum];

283
sdk/ts/src/apis/AuthApi.ts Normal file
View File

@@ -0,0 +1,283 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoAuthStartResponse, DtoJWKS, DtoLogoutRequest, DtoRefreshRequest, DtoTokenPair,} from "../models/index";
import {
DtoAuthStartResponseFromJSON,
DtoJWKSFromJSON,
DtoLogoutRequestToJSON,
DtoRefreshRequestToJSON,
DtoTokenPairFromJSON,
} from "../models/index";
export interface AuthCallbackRequest {
provider: string;
}
export interface AuthStartRequest {
provider: string;
}
export interface LogoutRequest {
dtoLogoutRequest: DtoLogoutRequest;
}
export interface RefreshRequest {
dtoRefreshRequest: DtoRefreshRequest;
}
/**
*
*/
export class AuthApi extends runtime.BaseAPI {
/**
* Handle social login callback
*/
async authCallbackRaw(
requestParameters: AuthCallbackRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoTokenPair>> {
if (requestParameters["provider"] == null) {
throw new runtime.RequiredError(
"provider",
'Required parameter "provider" was null or undefined when calling authCallback().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/auth/{provider}/callback`;
urlPath = urlPath.replace(
`{${"provider"}}`,
encodeURIComponent(String(requestParameters["provider"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoTokenPairFromJSON(jsonValue),
);
}
/**
* Handle social login callback
*/
async authCallback(
requestParameters: AuthCallbackRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoTokenPair> {
const response = await this.authCallbackRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Returns provider authorization URL for the frontend to redirect
* Begin social login
*/
async authStartRaw(
requestParameters: AuthStartRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoAuthStartResponse>> {
if (requestParameters["provider"] == null) {
throw new runtime.RequiredError(
"provider",
'Required parameter "provider" was null or undefined when calling authStart().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/auth/{provider}/start`;
urlPath = urlPath.replace(
`{${"provider"}}`,
encodeURIComponent(String(requestParameters["provider"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoAuthStartResponseFromJSON(jsonValue),
);
}
/**
* Returns provider authorization URL for the frontend to redirect
* Begin social login
*/
async authStart(
requestParameters: AuthStartRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoAuthStartResponse> {
const response = await this.authStartRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns the JSON Web Key Set for token verification
* Get JWKS
*/
async getJWKSRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoJWKS>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/.well-known/jwks.json`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoJWKSFromJSON(jsonValue),
);
}
/**
* Returns the JSON Web Key Set for token verification
* Get JWKS
*/
async getJWKS(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoJWKS> {
const response = await this.getJWKSRaw(initOverrides);
return await response.value();
}
/**
* Revoke refresh token family (logout everywhere)
*/
async logoutRaw(
requestParameters: LogoutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["dtoLogoutRequest"] == null) {
throw new runtime.RequiredError(
"dtoLogoutRequest",
'Required parameter "dtoLogoutRequest" was null or undefined when calling logout().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
let urlPath = `/auth/logout`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoLogoutRequestToJSON(requestParameters["dtoLogoutRequest"]),
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Revoke refresh token family (logout everywhere)
*/
async logout(
requestParameters: LogoutRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.logoutRaw(requestParameters, initOverrides);
}
/**
* Rotate refresh token
*/
async refreshRaw(
requestParameters: RefreshRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoTokenPair>> {
if (requestParameters["dtoRefreshRequest"] == null) {
throw new runtime.RequiredError(
"dtoRefreshRequest",
'Required parameter "dtoRefreshRequest" was null or undefined when calling refresh().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
let urlPath = `/auth/refresh`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoRefreshRequestToJSON(requestParameters["dtoRefreshRequest"]),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoTokenPairFromJSON(jsonValue),
);
}
/**
* Rotate refresh token
*/
async refresh(
requestParameters: RefreshRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoTokenPair> {
const response = await this.refreshRaw(requestParameters, initOverrides);
return await response.value();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,504 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoCreateCredentialRequest, DtoCredentialOut, DtoUpdateCredentialRequest,} from "../models/index";
import {
DtoCreateCredentialRequestToJSON,
DtoCredentialOutFromJSON,
DtoUpdateCredentialRequestToJSON,
} from "../models/index";
export interface CreateCredentialRequest {
dtoCreateCredentialRequest: DtoCreateCredentialRequest;
xOrgID?: string;
}
export interface DeleteCredentialRequest {
id: string;
xOrgID?: string;
}
export interface GetCredentialRequest {
id: string;
xOrgID?: string;
}
export interface ListCredentialsRequest {
xOrgID?: string;
credentialProvider?: string;
kind?: string;
scopeKind?: string;
}
export interface RevealCredentialRequest {
id: string;
xOrgID?: string;
body?: object;
}
export interface UpdateCredentialRequest {
id: string;
dtoUpdateCredentialRequest: DtoUpdateCredentialRequest;
xOrgID?: string;
}
/**
*
*/
export class CredentialsApi extends runtime.BaseAPI {
/**
* Create a credential (encrypts secret)
*/
async createCredentialRaw(
requestParameters: CreateCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoCredentialOut>> {
if (requestParameters["dtoCreateCredentialRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateCredentialRequest",
'Required parameter "dtoCreateCredentialRequest" was null or undefined when calling createCredential().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/credentials`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateCredentialRequestToJSON(
requestParameters["dtoCreateCredentialRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoCredentialOutFromJSON(jsonValue),
);
}
/**
* Create a credential (encrypts secret)
*/
async createCredential(
requestParameters: CreateCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoCredentialOut> {
const response = await this.createCredentialRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Delete credential
*/
async deleteCredentialRaw(
requestParameters: DeleteCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteCredential().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/credentials/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete credential
*/
async deleteCredential(
requestParameters: DeleteCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteCredentialRaw(requestParameters, initOverrides);
}
/**
* Get credential by ID (metadata only)
*/
async getCredentialRaw(
requestParameters: GetCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoCredentialOut>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getCredential().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/credentials/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoCredentialOutFromJSON(jsonValue),
);
}
/**
* Get credential by ID (metadata only)
*/
async getCredential(
requestParameters: GetCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoCredentialOut> {
const response = await this.getCredentialRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Returns credential metadata for the current org. Secrets are never returned.
* List credentials (metadata only)
*/
async listCredentialsRaw(
requestParameters: ListCredentialsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoCredentialOut>>> {
const queryParameters: any = {};
if (requestParameters["credentialProvider"] != null) {
queryParameters["credential_provider"] =
requestParameters["credentialProvider"];
}
if (requestParameters["kind"] != null) {
queryParameters["kind"] = requestParameters["kind"];
}
if (requestParameters["scopeKind"] != null) {
queryParameters["scope_kind"] = requestParameters["scopeKind"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/credentials`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoCredentialOutFromJSON),
);
}
/**
* Returns credential metadata for the current org. Secrets are never returned.
* List credentials (metadata only)
*/
async listCredentials(
requestParameters: ListCredentialsRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoCredentialOut>> {
const response = await this.listCredentialsRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Reveal decrypted secret (one-time read)
*/
async revealCredentialRaw(
requestParameters: RevealCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<{ [key: string]: any }>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling revealCredential().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/credentials/{id}/reveal`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse<any>(response);
}
/**
* Reveal decrypted secret (one-time read)
*/
async revealCredential(
requestParameters: RevealCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<{ [key: string]: any }> {
const response = await this.revealCredentialRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Update credential metadata and/or rotate secret
*/
async updateCredentialRaw(
requestParameters: UpdateCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoCredentialOut>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateCredential().',
);
}
if (requestParameters["dtoUpdateCredentialRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateCredentialRequest",
'Required parameter "dtoUpdateCredentialRequest" was null or undefined when calling updateCredential().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/credentials/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateCredentialRequestToJSON(
requestParameters["dtoUpdateCredentialRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoCredentialOutFromJSON(jsonValue),
);
}
/**
* Update credential metadata and/or rotate secret
*/
async updateCredential(
requestParameters: UpdateCredentialRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoCredentialOut> {
const response = await this.updateCredentialRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

778
sdk/ts/src/apis/DNSApi.ts Normal file
View File

@@ -0,0 +1,778 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {
DtoCreateDomainRequest,
DtoCreateRecordSetRequest,
DtoDomainResponse,
DtoRecordSetResponse,
DtoUpdateDomainRequest,
DtoUpdateRecordSetRequest,
} from "../models/index";
import {
DtoCreateDomainRequestToJSON,
DtoCreateRecordSetRequestToJSON,
DtoDomainResponseFromJSON,
DtoRecordSetResponseFromJSON,
DtoUpdateDomainRequestToJSON,
DtoUpdateRecordSetRequestToJSON,
} from "../models/index";
export interface CreateDomainRequest {
dtoCreateDomainRequest: DtoCreateDomainRequest;
xOrgID?: string;
}
export interface CreateRecordSetRequest {
domainId: string;
dtoCreateRecordSetRequest: DtoCreateRecordSetRequest;
xOrgID?: string;
}
export interface DeleteDomainRequest {
id: string;
xOrgID?: string;
}
export interface DeleteRecordSetRequest {
id: string;
xOrgID?: string;
}
export interface GetDomainRequest {
id: string;
xOrgID?: string;
}
export interface ListDomainsRequest {
xOrgID?: string;
domainName?: string;
status?: string;
q?: string;
}
export interface ListRecordSetsRequest {
domainId: string;
xOrgID?: string;
name?: string;
type?: string;
status?: string;
}
export interface UpdateDomainRequest {
id: string;
dtoUpdateDomainRequest: DtoUpdateDomainRequest;
xOrgID?: string;
}
export interface UpdateRecordSetRequest {
id: string;
dtoUpdateRecordSetRequest: DtoUpdateRecordSetRequest;
xOrgID?: string;
}
/**
*
*/
export class DNSApi extends runtime.BaseAPI {
/**
* Creates a domain bound to a Route 53 scoped credential. Archer will backfill ZoneID if omitted.
* Create a domain (org scoped)
*/
async createDomainRaw(
requestParameters: CreateDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoDomainResponse>> {
if (requestParameters["dtoCreateDomainRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateDomainRequest",
'Required parameter "dtoCreateDomainRequest" was null or undefined when calling createDomain().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/domains`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateDomainRequestToJSON(
requestParameters["dtoCreateDomainRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoDomainResponseFromJSON(jsonValue),
);
}
/**
* Creates a domain bound to a Route 53 scoped credential. Archer will backfill ZoneID if omitted.
* Create a domain (org scoped)
*/
async createDomain(
requestParameters: CreateDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoDomainResponse> {
const response = await this.createDomainRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Create a record set (pending; Archer will UPSERT to Route 53)
*/
async createRecordSetRaw(
requestParameters: CreateRecordSetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoRecordSetResponse>> {
if (requestParameters["domainId"] == null) {
throw new runtime.RequiredError(
"domainId",
'Required parameter "domainId" was null or undefined when calling createRecordSet().',
);
}
if (requestParameters["dtoCreateRecordSetRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateRecordSetRequest",
'Required parameter "dtoCreateRecordSetRequest" was null or undefined when calling createRecordSet().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/domains/{domain_id}/records`;
urlPath = urlPath.replace(
`{${"domain_id"}}`,
encodeURIComponent(String(requestParameters["domainId"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateRecordSetRequestToJSON(
requestParameters["dtoCreateRecordSetRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoRecordSetResponseFromJSON(jsonValue),
);
}
/**
* Create a record set (pending; Archer will UPSERT to Route 53)
*/
async createRecordSet(
requestParameters: CreateRecordSetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoRecordSetResponse> {
const response = await this.createRecordSetRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Delete a domain
*/
async deleteDomainRaw(
requestParameters: DeleteDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteDomain().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/domains/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete a domain
*/
async deleteDomain(
requestParameters: DeleteDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteDomainRaw(requestParameters, initOverrides);
}
/**
* Delete a record set (API removes row; worker can optionally handle external deletion policy)
*/
async deleteRecordSetRaw(
requestParameters: DeleteRecordSetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteRecordSet().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/records/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete a record set (API removes row; worker can optionally handle external deletion policy)
*/
async deleteRecordSet(
requestParameters: DeleteRecordSetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteRecordSetRaw(requestParameters, initOverrides);
}
/**
* Get a domain (org scoped)
*/
async getDomainRaw(
requestParameters: GetDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoDomainResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getDomain().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/domains/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoDomainResponseFromJSON(jsonValue),
);
}
/**
* Get a domain (org scoped)
*/
async getDomain(
requestParameters: GetDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoDomainResponse> {
const response = await this.getDomainRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns domains for X-Org-ID. Filters: `domain_name`, `status`, `q` (contains).
* List domains (org scoped)
*/
async listDomainsRaw(
requestParameters: ListDomainsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoDomainResponse>>> {
const queryParameters: any = {};
if (requestParameters["domainName"] != null) {
queryParameters["domain_name"] = requestParameters["domainName"];
}
if (requestParameters["status"] != null) {
queryParameters["status"] = requestParameters["status"];
}
if (requestParameters["q"] != null) {
queryParameters["q"] = requestParameters["q"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/domains`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoDomainResponseFromJSON),
);
}
/**
* Returns domains for X-Org-ID. Filters: `domain_name`, `status`, `q` (contains).
* List domains (org scoped)
*/
async listDomains(
requestParameters: ListDomainsRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoDomainResponse>> {
const response = await this.listDomainsRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Filters: `name`, `type`, `status`.
* List record sets for a domain
*/
async listRecordSetsRaw(
requestParameters: ListRecordSetsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoRecordSetResponse>>> {
if (requestParameters["domainId"] == null) {
throw new runtime.RequiredError(
"domainId",
'Required parameter "domainId" was null or undefined when calling listRecordSets().',
);
}
const queryParameters: any = {};
if (requestParameters["name"] != null) {
queryParameters["name"] = requestParameters["name"];
}
if (requestParameters["type"] != null) {
queryParameters["type"] = requestParameters["type"];
}
if (requestParameters["status"] != null) {
queryParameters["status"] = requestParameters["status"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/domains/{domain_id}/records`;
urlPath = urlPath.replace(
`{${"domain_id"}}`,
encodeURIComponent(String(requestParameters["domainId"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoRecordSetResponseFromJSON),
);
}
/**
* Filters: `name`, `type`, `status`.
* List record sets for a domain
*/
async listRecordSets(
requestParameters: ListRecordSetsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoRecordSetResponse>> {
const response = await this.listRecordSetsRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Update a domain (org scoped)
*/
async updateDomainRaw(
requestParameters: UpdateDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoDomainResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateDomain().',
);
}
if (requestParameters["dtoUpdateDomainRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateDomainRequest",
'Required parameter "dtoUpdateDomainRequest" was null or undefined when calling updateDomain().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/domains/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateDomainRequestToJSON(
requestParameters["dtoUpdateDomainRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoDomainResponseFromJSON(jsonValue),
);
}
/**
* Update a domain (org scoped)
*/
async updateDomain(
requestParameters: UpdateDomainRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoDomainResponse> {
const response = await this.updateDomainRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Update a record set (flips to pending for reconciliation)
*/
async updateRecordSetRaw(
requestParameters: UpdateRecordSetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoRecordSetResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateRecordSet().',
);
}
if (requestParameters["dtoUpdateRecordSetRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateRecordSetRequest",
'Required parameter "dtoUpdateRecordSetRequest" was null or undefined when calling updateRecordSet().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/dns/records/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateRecordSetRequestToJSON(
requestParameters["dtoUpdateRecordSetRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoRecordSetResponseFromJSON(jsonValue),
);
}
/**
* Update a record set (flips to pending for reconciliation)
*/
async updateRecordSet(
requestParameters: UpdateRecordSetRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoRecordSetResponse> {
const response = await this.updateRecordSetRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View File

@@ -0,0 +1,61 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {HandlersHealthStatus} from "../models/index";
import {HandlersHealthStatusFromJSON,} from "../models/index";
/**
*
*/
export class HealthApi extends runtime.BaseAPI {
/**
* Returns 200 OK when the service is up
* Basic health check
*/
async healthCheckOperationIdRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<HandlersHealthStatus>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/healthz`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
HandlersHealthStatusFromJSON(jsonValue),
);
}
/**
* Returns 200 OK when the service is up
* Basic health check
*/
async healthCheckOperationId(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<HandlersHealthStatus> {
const response = await this.healthCheckOperationIdRaw(initOverrides);
return await response.value();
}
}

View File

@@ -0,0 +1,422 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoCreateLabelRequest, DtoLabelResponse, DtoUpdateLabelRequest,} from "../models/index";
import {DtoCreateLabelRequestToJSON, DtoLabelResponseFromJSON, DtoUpdateLabelRequestToJSON,} from "../models/index";
export interface CreateLabelRequest {
dtoCreateLabelRequest: DtoCreateLabelRequest;
xOrgID?: string;
}
export interface DeleteLabelRequest {
id: string;
xOrgID?: string;
}
export interface GetLabelRequest {
id: string;
xOrgID?: string;
}
export interface ListLabelsRequest {
xOrgID?: string;
key?: string;
value?: string;
q?: string;
}
export interface UpdateLabelRequest {
id: string;
dtoUpdateLabelRequest: DtoUpdateLabelRequest;
xOrgID?: string;
}
/**
*
*/
export class LabelsApi extends runtime.BaseAPI {
/**
* Creates a label.
* Create label (org scoped)
*/
async createLabelRaw(
requestParameters: CreateLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoLabelResponse>> {
if (requestParameters["dtoCreateLabelRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateLabelRequest",
'Required parameter "dtoCreateLabelRequest" was null or undefined when calling createLabel().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/labels`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateLabelRequestToJSON(
requestParameters["dtoCreateLabelRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoLabelResponseFromJSON(jsonValue),
);
}
/**
* Creates a label.
* Create label (org scoped)
*/
async createLabel(
requestParameters: CreateLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoLabelResponse> {
const response = await this.createLabelRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Permanently deletes the label.
* Delete label (org scoped)
*/
async deleteLabelRaw(
requestParameters: DeleteLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteLabel().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/labels/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Permanently deletes the label.
* Delete label (org scoped)
*/
async deleteLabel(
requestParameters: DeleteLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteLabelRaw(requestParameters, initOverrides);
}
/**
* Returns one label.
* Get label by ID (org scoped)
*/
async getLabelRaw(
requestParameters: GetLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoLabelResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getLabel().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/labels/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoLabelResponseFromJSON(jsonValue),
);
}
/**
* Returns one label.
* Get label by ID (org scoped)
*/
async getLabel(
requestParameters: GetLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoLabelResponse> {
const response = await this.getLabelRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns node labels for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node groups.
* List node labels (org scoped)
*/
async listLabelsRaw(
requestParameters: ListLabelsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoLabelResponse>>> {
const queryParameters: any = {};
if (requestParameters["key"] != null) {
queryParameters["key"] = requestParameters["key"];
}
if (requestParameters["value"] != null) {
queryParameters["value"] = requestParameters["value"];
}
if (requestParameters["q"] != null) {
queryParameters["q"] = requestParameters["q"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/labels`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoLabelResponseFromJSON),
);
}
/**
* Returns node labels for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node groups.
* List node labels (org scoped)
*/
async listLabels(
requestParameters: ListLabelsRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoLabelResponse>> {
const response = await this.listLabelsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Partially update label fields.
* Update label (org scoped)
*/
async updateLabelRaw(
requestParameters: UpdateLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoLabelResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateLabel().',
);
}
if (requestParameters["dtoUpdateLabelRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateLabelRequest",
'Required parameter "dtoUpdateLabelRequest" was null or undefined when calling updateLabel().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/labels/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateLabelRequestToJSON(
requestParameters["dtoUpdateLabelRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoLabelResponseFromJSON(jsonValue),
);
}
/**
* Partially update label fields.
* Update label (org scoped)
*/
async updateLabel(
requestParameters: UpdateLabelRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoLabelResponse> {
const response = await this.updateLabelRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View File

@@ -0,0 +1,415 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {
DtoCreateLoadBalancerRequest,
DtoLoadBalancerResponse,
DtoUpdateLoadBalancerRequest,
} from "../models/index";
import {
DtoCreateLoadBalancerRequestToJSON,
DtoLoadBalancerResponseFromJSON,
DtoUpdateLoadBalancerRequestToJSON,
} from "../models/index";
export interface CreateLoadBalancerRequest {
dtoCreateLoadBalancerRequest: DtoCreateLoadBalancerRequest;
xOrgID?: string;
}
export interface DeleteLoadBalancerRequest {
id: string;
xOrgID?: string;
}
export interface GetLoadBalancersRequest {
id: string;
xOrgID?: string;
}
export interface ListLoadBalancersRequest {
xOrgID?: string;
}
export interface UpdateLoadBalancerRequest {
id: string;
dtoUpdateLoadBalancerRequest: DtoUpdateLoadBalancerRequest;
xOrgID?: string;
}
/**
*
*/
export class LoadBalancersApi extends runtime.BaseAPI {
/**
* Create a load balancer
*/
async createLoadBalancerRaw(
requestParameters: CreateLoadBalancerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoLoadBalancerResponse>> {
if (requestParameters["dtoCreateLoadBalancerRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateLoadBalancerRequest",
'Required parameter "dtoCreateLoadBalancerRequest" was null or undefined when calling createLoadBalancer().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/load-balancers`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateLoadBalancerRequestToJSON(
requestParameters["dtoCreateLoadBalancerRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoLoadBalancerResponseFromJSON(jsonValue),
);
}
/**
* Create a load balancer
*/
async createLoadBalancer(
requestParameters: CreateLoadBalancerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoLoadBalancerResponse> {
const response = await this.createLoadBalancerRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Delete a load balancer
*/
async deleteLoadBalancerRaw(
requestParameters: DeleteLoadBalancerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteLoadBalancer().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/load-balancers/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete a load balancer
*/
async deleteLoadBalancer(
requestParameters: DeleteLoadBalancerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteLoadBalancerRaw(requestParameters, initOverrides);
}
/**
* Returns load balancer for the organization in X-Org-ID.
* Get a load balancer (org scoped)
*/
async getLoadBalancersRaw(
requestParameters: GetLoadBalancersRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoLoadBalancerResponse>>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getLoadBalancers().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/load-balancers/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoLoadBalancerResponseFromJSON),
);
}
/**
* Returns load balancer for the organization in X-Org-ID.
* Get a load balancer (org scoped)
*/
async getLoadBalancers(
requestParameters: GetLoadBalancersRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoLoadBalancerResponse>> {
const response = await this.getLoadBalancersRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Returns load balancers for the organization in X-Org-ID.
* List load balancers (org scoped)
*/
async listLoadBalancersRaw(
requestParameters: ListLoadBalancersRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoLoadBalancerResponse>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/load-balancers`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoLoadBalancerResponseFromJSON),
);
}
/**
* Returns load balancers for the organization in X-Org-ID.
* List load balancers (org scoped)
*/
async listLoadBalancers(
requestParameters: ListLoadBalancersRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoLoadBalancerResponse>> {
const response = await this.listLoadBalancersRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Update a load balancer (org scoped)
*/
async updateLoadBalancerRaw(
requestParameters: UpdateLoadBalancerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoLoadBalancerResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateLoadBalancer().',
);
}
if (requestParameters["dtoUpdateLoadBalancerRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateLoadBalancerRequest",
'Required parameter "dtoUpdateLoadBalancerRequest" was null or undefined when calling updateLoadBalancer().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/load-balancers/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateLoadBalancerRequestToJSON(
requestParameters["dtoUpdateLoadBalancerRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoLoadBalancerResponseFromJSON(jsonValue),
);
}
/**
* Update a load balancer (org scoped)
*/
async updateLoadBalancer(
requestParameters: UpdateLoadBalancerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoLoadBalancerResponse> {
const response = await this.updateLoadBalancerRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View File

@@ -0,0 +1,195 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {HandlersCreateUserKeyRequest, HandlersUserAPIKeyOut,} from "../models/index";
import {HandlersCreateUserKeyRequestToJSON, HandlersUserAPIKeyOutFromJSON,} from "../models/index";
export interface CreateUserAPIKeyRequest {
handlersCreateUserKeyRequest: HandlersCreateUserKeyRequest;
}
export interface DeleteUserAPIKeyRequest {
id: string;
}
/**
*
*/
export class MeAPIKeysApi extends runtime.BaseAPI {
/**
* Returns the plaintext key once. Store it securely on the client side.
* Create a new user API key
*/
async createUserAPIKeyRaw(
requestParameters: CreateUserAPIKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<HandlersUserAPIKeyOut>> {
if (requestParameters["handlersCreateUserKeyRequest"] == null) {
throw new runtime.RequiredError(
"handlersCreateUserKeyRequest",
'Required parameter "handlersCreateUserKeyRequest" was null or undefined when calling createUserAPIKey().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-API-KEY"] =
await this.configuration.apiKey("X-API-KEY"); // ApiKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/me/api-keys`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: HandlersCreateUserKeyRequestToJSON(
requestParameters["handlersCreateUserKeyRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
HandlersUserAPIKeyOutFromJSON(jsonValue),
);
}
/**
* Returns the plaintext key once. Store it securely on the client side.
* Create a new user API key
*/
async createUserAPIKey(
requestParameters: CreateUserAPIKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<HandlersUserAPIKeyOut> {
const response = await this.createUserAPIKeyRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Delete a user API key
*/
async deleteUserAPIKeyRaw(
requestParameters: DeleteUserAPIKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteUserAPIKey().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/me/api-keys/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete a user API key
*/
async deleteUserAPIKey(
requestParameters: DeleteUserAPIKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteUserAPIKeyRaw(requestParameters, initOverrides);
}
/**
* List my API keys
*/
async listUserAPIKeysRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<HandlersUserAPIKeyOut>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-API-KEY"] =
await this.configuration.apiKey("X-API-KEY"); // ApiKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/me/api-keys`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(HandlersUserAPIKeyOutFromJSON),
);
}
/**
* List my API keys
*/
async listUserAPIKeys(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<HandlersUserAPIKeyOut>> {
const response = await this.listUserAPIKeysRaw(initOverrides);
return await response.value();
}
}

134
sdk/ts/src/apis/MeApi.ts Normal file
View File

@@ -0,0 +1,134 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {HandlersMeResponse, HandlersUpdateMeRequest, ModelsUser,} from "../models/index";
import {HandlersMeResponseFromJSON, HandlersUpdateMeRequestToJSON, ModelsUserFromJSON,} from "../models/index";
export interface UpdateMeRequest {
handlersUpdateMeRequest: HandlersUpdateMeRequest;
}
/**
*
*/
export class MeApi extends runtime.BaseAPI {
/**
* Get current user profile
*/
async getMeRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<HandlersMeResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-API-KEY"] =
await this.configuration.apiKey("X-API-KEY"); // ApiKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/me`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
HandlersMeResponseFromJSON(jsonValue),
);
}
/**
* Get current user profile
*/
async getMe(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<HandlersMeResponse> {
const response = await this.getMeRaw(initOverrides);
return await response.value();
}
/**
* Update current user profile
*/
async updateMeRaw(
requestParameters: UpdateMeRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ModelsUser>> {
if (requestParameters["handlersUpdateMeRequest"] == null) {
throw new runtime.RequiredError(
"handlersUpdateMeRequest",
'Required parameter "handlersUpdateMeRequest" was null or undefined when calling updateMe().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-API-KEY"] =
await this.configuration.apiKey("X-API-KEY"); // ApiKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/me`;
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: HandlersUpdateMeRequestToJSON(
requestParameters["handlersUpdateMeRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ModelsUserFromJSON(jsonValue),
);
}
/**
* Update current user profile
*/
async updateMe(
requestParameters: UpdateMeRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ModelsUser> {
const response = await this.updateMeRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@@ -0,0 +1,61 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {HandlersVersionResponse} from "../models/index";
import {HandlersVersionResponseFromJSON,} from "../models/index";
/**
*
*/
export class MetaApi extends runtime.BaseAPI {
/**
* Returns build/runtime metadata for the running service.
* Service version information
*/
async versionOperationIdRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<HandlersVersionResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/version`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
HandlersVersionResponseFromJSON(jsonValue),
);
}
/**
* Returns build/runtime metadata for the running service.
* Service version information
*/
async versionOperationId(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<HandlersVersionResponse> {
const response = await this.versionOperationIdRaw(initOverrides);
return await response.value();
}
}

File diff suppressed because it is too large Load Diff

739
sdk/ts/src/apis/OrgsApi.ts Normal file
View File

@@ -0,0 +1,739 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {
HandlersMemberOut,
HandlersMemberUpsertReq,
HandlersOrgCreateReq,
HandlersOrgKeyCreateReq,
HandlersOrgKeyCreateResp,
HandlersOrgUpdateReq,
ModelsAPIKey,
ModelsOrganization,
} from "../models/index";
import {
HandlersMemberOutFromJSON,
HandlersMemberUpsertReqToJSON,
HandlersOrgCreateReqToJSON,
HandlersOrgKeyCreateReqToJSON,
HandlersOrgKeyCreateRespFromJSON,
HandlersOrgUpdateReqToJSON,
ModelsAPIKeyFromJSON,
ModelsOrganizationFromJSON,
} from "../models/index";
export interface AddOrUpdateMemberRequest {
id: string;
handlersMemberUpsertReq: HandlersMemberUpsertReq;
}
export interface CreateOrgRequest {
handlersOrgCreateReq: HandlersOrgCreateReq;
}
export interface CreateOrgKeyRequest {
id: string;
handlersOrgKeyCreateReq: HandlersOrgKeyCreateReq;
}
export interface DeleteOrgRequest {
id: string;
}
export interface DeleteOrgKeyRequest {
id: string;
keyId: string;
}
export interface GetOrgRequest {
id: string;
}
export interface ListMembersRequest {
id: string;
}
export interface ListOrgKeysRequest {
id: string;
}
export interface RemoveMemberRequest {
id: string;
userId: string;
}
export interface UpdateOrgRequest {
id: string;
handlersOrgUpdateReq: HandlersOrgUpdateReq;
}
/**
*
*/
export class OrgsApi extends runtime.BaseAPI {
/**
* Add or update a member (owner/admin)
*/
async addOrUpdateMemberRaw(
requestParameters: AddOrUpdateMemberRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<HandlersMemberOut>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling addOrUpdateMember().',
);
}
if (requestParameters["handlersMemberUpsertReq"] == null) {
throw new runtime.RequiredError(
"handlersMemberUpsertReq",
'Required parameter "handlersMemberUpsertReq" was null or undefined when calling addOrUpdateMember().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}/members`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: HandlersMemberUpsertReqToJSON(
requestParameters["handlersMemberUpsertReq"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
HandlersMemberOutFromJSON(jsonValue),
);
}
/**
* Add or update a member (owner/admin)
*/
async addOrUpdateMember(
requestParameters: AddOrUpdateMemberRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<HandlersMemberOut> {
const response = await this.addOrUpdateMemberRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Create organization
*/
async createOrgRaw(
requestParameters: CreateOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ModelsOrganization>> {
if (requestParameters["handlersOrgCreateReq"] == null) {
throw new runtime.RequiredError(
"handlersOrgCreateReq",
'Required parameter "handlersOrgCreateReq" was null or undefined when calling createOrg().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: HandlersOrgCreateReqToJSON(
requestParameters["handlersOrgCreateReq"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ModelsOrganizationFromJSON(jsonValue),
);
}
/**
* Create organization
*/
async createOrg(
requestParameters: CreateOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ModelsOrganization> {
const response = await this.createOrgRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Create org key/secret pair (owner/admin)
*/
async createOrgKeyRaw(
requestParameters: CreateOrgKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<HandlersOrgKeyCreateResp>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling createOrgKey().',
);
}
if (requestParameters["handlersOrgKeyCreateReq"] == null) {
throw new runtime.RequiredError(
"handlersOrgKeyCreateReq",
'Required parameter "handlersOrgKeyCreateReq" was null or undefined when calling createOrgKey().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}/api-keys`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: HandlersOrgKeyCreateReqToJSON(
requestParameters["handlersOrgKeyCreateReq"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
HandlersOrgKeyCreateRespFromJSON(jsonValue),
);
}
/**
* Create org key/secret pair (owner/admin)
*/
async createOrgKey(
requestParameters: CreateOrgKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<HandlersOrgKeyCreateResp> {
const response = await this.createOrgKeyRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Delete organization (owner)
*/
async deleteOrgRaw(
requestParameters: DeleteOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteOrg().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete organization (owner)
*/
async deleteOrg(
requestParameters: DeleteOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteOrgRaw(requestParameters, initOverrides);
}
/**
* Delete org key (owner/admin)
*/
async deleteOrgKeyRaw(
requestParameters: DeleteOrgKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteOrgKey().',
);
}
if (requestParameters["keyId"] == null) {
throw new runtime.RequiredError(
"keyId",
'Required parameter "keyId" was null or undefined when calling deleteOrgKey().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}/api-keys/{key_id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
urlPath = urlPath.replace(
`{${"key_id"}}`,
encodeURIComponent(String(requestParameters["keyId"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Delete org key (owner/admin)
*/
async deleteOrgKey(
requestParameters: DeleteOrgKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteOrgKeyRaw(requestParameters, initOverrides);
}
/**
* Get organization
*/
async getOrgRaw(
requestParameters: GetOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ModelsOrganization>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getOrg().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ModelsOrganizationFromJSON(jsonValue),
);
}
/**
* Get organization
*/
async getOrg(
requestParameters: GetOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ModelsOrganization> {
const response = await this.getOrgRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* List members in org
*/
async listMembersRaw(
requestParameters: ListMembersRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<HandlersMemberOut>>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling listMembers().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}/members`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(HandlersMemberOutFromJSON),
);
}
/**
* List members in org
*/
async listMembers(
requestParameters: ListMembersRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<HandlersMemberOut>> {
const response = await this.listMembersRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* List organizations I belong to
*/
async listMyOrgsRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<ModelsOrganization>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(ModelsOrganizationFromJSON),
);
}
/**
* List organizations I belong to
*/
async listMyOrgs(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<ModelsOrganization>> {
const response = await this.listMyOrgsRaw(initOverrides);
return await response.value();
}
/**
* List org-scoped API keys (no secrets)
*/
async listOrgKeysRaw(
requestParameters: ListOrgKeysRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<ModelsAPIKey>>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling listOrgKeys().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}/api-keys`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(ModelsAPIKeyFromJSON),
);
}
/**
* List org-scoped API keys (no secrets)
*/
async listOrgKeys(
requestParameters: ListOrgKeysRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<ModelsAPIKey>> {
const response = await this.listOrgKeysRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Remove a member (owner/admin)
*/
async removeMemberRaw(
requestParameters: RemoveMemberRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling removeMember().',
);
}
if (requestParameters["userId"] == null) {
throw new runtime.RequiredError(
"userId",
'Required parameter "userId" was null or undefined when calling removeMember().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}/members/{user_id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
urlPath = urlPath.replace(
`{${"user_id"}}`,
encodeURIComponent(String(requestParameters["userId"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Remove a member (owner/admin)
*/
async removeMember(
requestParameters: RemoveMemberRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.removeMemberRaw(requestParameters, initOverrides);
}
/**
* Update organization (owner/admin)
*/
async updateOrgRaw(
requestParameters: UpdateOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<ModelsOrganization>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateOrg().',
);
}
if (requestParameters["handlersOrgUpdateReq"] == null) {
throw new runtime.RequiredError(
"handlersOrgUpdateReq",
'Required parameter "handlersOrgUpdateReq" was null or undefined when calling updateOrg().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/orgs/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: HandlersOrgUpdateReqToJSON(
requestParameters["handlersOrgUpdateReq"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
ModelsOrganizationFromJSON(jsonValue),
);
}
/**
* Update organization (owner/admin)
*/
async updateOrg(
requestParameters: UpdateOrgRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<ModelsOrganization> {
const response = await this.updateOrgRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@@ -0,0 +1,503 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoCreateServerRequest, DtoServerResponse, DtoUpdateServerRequest,} from "../models/index";
import {DtoCreateServerRequestToJSON, DtoServerResponseFromJSON, DtoUpdateServerRequestToJSON,} from "../models/index";
export interface CreateServerRequest {
dtoCreateServerRequest: DtoCreateServerRequest;
xOrgID?: string;
}
export interface DeleteServerRequest {
id: string;
xOrgID?: string;
}
export interface GetServerRequest {
id: string;
xOrgID?: string;
}
export interface ListServersRequest {
xOrgID?: string;
status?: string;
role?: string;
}
export interface ResetServerHostKeyRequest {
id: string;
xOrgID?: string;
body?: object;
}
export interface UpdateServerRequest {
id: string;
dtoUpdateServerRequest: DtoUpdateServerRequest;
xOrgID?: string;
}
/**
*
*/
export class ServersApi extends runtime.BaseAPI {
/**
* Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.
* Create server (org scoped)
*/
async createServerRaw(
requestParameters: CreateServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoServerResponse>> {
if (requestParameters["dtoCreateServerRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateServerRequest",
'Required parameter "dtoCreateServerRequest" was null or undefined when calling createServer().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/servers`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateServerRequestToJSON(
requestParameters["dtoCreateServerRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoServerResponseFromJSON(jsonValue),
);
}
/**
* Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.
* Create server (org scoped)
*/
async createServer(
requestParameters: CreateServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoServerResponse> {
const response = await this.createServerRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Permanently deletes the server.
* Delete server (org scoped)
*/
async deleteServerRaw(
requestParameters: DeleteServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteServer().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/servers/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Permanently deletes the server.
* Delete server (org scoped)
*/
async deleteServer(
requestParameters: DeleteServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteServerRaw(requestParameters, initOverrides);
}
/**
* Returns one server in the given organization.
* Get server by ID (org scoped)
*/
async getServerRaw(
requestParameters: GetServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoServerResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getServer().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/servers/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoServerResponseFromJSON(jsonValue),
);
}
/**
* Returns one server in the given organization.
* Get server by ID (org scoped)
*/
async getServer(
requestParameters: GetServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoServerResponse> {
const response = await this.getServerRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns servers for the organization in X-Org-ID. Optional filters: status, role.
* List servers (org scoped)
*/
async listServersRaw(
requestParameters: ListServersRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoServerResponse>>> {
const queryParameters: any = {};
if (requestParameters["status"] != null) {
queryParameters["status"] = requestParameters["status"];
}
if (requestParameters["role"] != null) {
queryParameters["role"] = requestParameters["role"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/servers`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoServerResponseFromJSON),
);
}
/**
* Returns servers for the organization in X-Org-ID. Optional filters: status, role.
* List servers (org scoped)
*/
async listServers(
requestParameters: ListServersRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoServerResponse>> {
const response = await this.listServersRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Clears the stored SSH host key for this server. The next SSH connection will re-learn the host key (trust-on-first-use).
* Reset SSH host key (org scoped)
*/
async resetServerHostKeyRaw(
requestParameters: ResetServerHostKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoServerResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling resetServerHostKey().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/servers/{id}/reset-hostkey`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoServerResponseFromJSON(jsonValue),
);
}
/**
* Clears the stored SSH host key for this server. The next SSH connection will re-learn the host key (trust-on-first-use).
* Reset SSH host key (org scoped)
*/
async resetServerHostKey(
requestParameters: ResetServerHostKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoServerResponse> {
const response = await this.resetServerHostKeyRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Partially update fields; changing ssh_key_id validates ownership.
* Update server (org scoped)
*/
async updateServerRaw(
requestParameters: UpdateServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoServerResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateServer().',
);
}
if (requestParameters["dtoUpdateServerRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateServerRequest",
'Required parameter "dtoUpdateServerRequest" was null or undefined when calling updateServer().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/servers/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateServerRequestToJSON(
requestParameters["dtoUpdateServerRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoServerResponseFromJSON(jsonValue),
);
}
/**
* Partially update fields; changing ssh_key_id validates ownership.
* Update server (org scoped)
*/
async updateServer(
requestParameters: UpdateServerRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoServerResponse> {
const response = await this.updateServerRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

434
sdk/ts/src/apis/SshApi.ts Normal file
View File

@@ -0,0 +1,434 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoCreateSSHRequest, DtoSshResponse, GetSSHKey200Response,} from "../models/index";
import {DtoCreateSSHRequestToJSON, DtoSshResponseFromJSON, GetSSHKey200ResponseFromJSON,} from "../models/index";
export interface CreateSSHKeyRequest {
dtoCreateSSHRequest: DtoCreateSSHRequest;
xOrgID?: string;
}
export interface DeleteSSHKeyRequest {
id: string;
xOrgID?: string;
}
export interface DownloadSSHKeyRequest {
xOrgID: string;
id: string;
part: DownloadSSHKeyPartEnum;
}
export interface GetSSHKeyRequest {
id: string;
xOrgID?: string;
reveal?: boolean;
}
export interface ListPublicSshKeysRequest {
xOrgID?: string;
}
/**
*
*/
export class SshApi extends runtime.BaseAPI {
/**
* Generates an RSA or ED25519 keypair, saves it, and returns metadata. For RSA you may set bits (2048/3072/4096). Default is 4096. ED25519 ignores bits.
* Create ssh keypair (org scoped)
*/
async createSSHKeyRaw(
requestParameters: CreateSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoSshResponse>> {
if (requestParameters["dtoCreateSSHRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateSSHRequest",
'Required parameter "dtoCreateSSHRequest" was null or undefined when calling createSSHKey().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/ssh`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateSSHRequestToJSON(
requestParameters["dtoCreateSSHRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoSshResponseFromJSON(jsonValue),
);
}
/**
* Generates an RSA or ED25519 keypair, saves it, and returns metadata. For RSA you may set bits (2048/3072/4096). Default is 4096. ED25519 ignores bits.
* Create ssh keypair (org scoped)
*/
async createSSHKey(
requestParameters: CreateSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoSshResponse> {
const response = await this.createSSHKeyRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Permanently deletes a keypair.
* Delete ssh keypair (org scoped)
*/
async deleteSSHKeyRaw(
requestParameters: DeleteSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteSSHKey().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/ssh/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Permanently deletes a keypair.
* Delete ssh keypair (org scoped)
*/
async deleteSSHKey(
requestParameters: DeleteSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteSSHKeyRaw(requestParameters, initOverrides);
}
/**
* Download `part=public|private|both` of the keypair. `both` returns a zip file.
* Download ssh key files by ID (org scoped)
*/
async downloadSSHKeyRaw(
requestParameters: DownloadSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["xOrgID"] == null) {
throw new runtime.RequiredError(
"xOrgID",
'Required parameter "xOrgID" was null or undefined when calling downloadSSHKey().',
);
}
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling downloadSSHKey().',
);
}
if (requestParameters["part"] == null) {
throw new runtime.RequiredError(
"part",
'Required parameter "part" was null or undefined when calling downloadSSHKey().',
);
}
const queryParameters: any = {};
if (requestParameters["part"] != null) {
queryParameters["part"] = requestParameters["part"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/ssh/{id}/download`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Download `part=public|private|both` of the keypair. `both` returns a zip file.
* Download ssh key files by ID (org scoped)
*/
async downloadSSHKey(
requestParameters: DownloadSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.downloadSSHKeyRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Returns public key fields. Append `?reveal=true` to include the private key PEM.
* Get ssh key by ID (org scoped)
*/
async getSSHKeyRaw(
requestParameters: GetSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<GetSSHKey200Response>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getSSHKey().',
);
}
const queryParameters: any = {};
if (requestParameters["reveal"] != null) {
queryParameters["reveal"] = requestParameters["reveal"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/ssh/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
GetSSHKey200ResponseFromJSON(jsonValue),
);
}
/**
* Returns public key fields. Append `?reveal=true` to include the private key PEM.
* Get ssh key by ID (org scoped)
*/
async getSSHKey(
requestParameters: GetSSHKeyRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<GetSSHKey200Response> {
const response = await this.getSSHKeyRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns ssh keys for the organization in X-Org-ID.
* List ssh keys (org scoped)
*/
async listPublicSshKeysRaw(
requestParameters: ListPublicSshKeysRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoSshResponse>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/ssh`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoSshResponseFromJSON),
);
}
/**
* Returns ssh keys for the organization in X-Org-ID.
* List ssh keys (org scoped)
*/
async listPublicSshKeys(
requestParameters: ListPublicSshKeysRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoSshResponse>> {
const response = await this.listPublicSshKeysRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}
/**
* @export
*/
export const DownloadSSHKeyPartEnum = {
public: "public",
private: "private",
both: "both",
} as const;
export type DownloadSSHKeyPartEnum =
(typeof DownloadSSHKeyPartEnum)[keyof typeof DownloadSSHKeyPartEnum];

View File

@@ -0,0 +1,420 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: dev
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type {DtoCreateTaintRequest, DtoTaintResponse, DtoUpdateTaintRequest,} from "../models/index";
import {DtoCreateTaintRequestToJSON, DtoTaintResponseFromJSON, DtoUpdateTaintRequestToJSON,} from "../models/index";
export interface CreateTaintRequest {
dtoCreateTaintRequest: DtoCreateTaintRequest;
xOrgID?: string;
}
export interface DeleteTaintRequest {
id: string;
xOrgID?: string;
}
export interface GetTaintRequest {
id: string;
xOrgID?: string;
}
export interface ListTaintsRequest {
xOrgID?: string;
key?: string;
value?: string;
q?: string;
}
export interface UpdateTaintRequest {
id: string;
dtoUpdateTaintRequest: DtoUpdateTaintRequest;
xOrgID?: string;
}
/**
*
*/
export class TaintsApi extends runtime.BaseAPI {
/**
* Creates a taint.
* Create node taint (org scoped)
*/
async createTaintRaw(
requestParameters: CreateTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoTaintResponse>> {
if (requestParameters["dtoCreateTaintRequest"] == null) {
throw new runtime.RequiredError(
"dtoCreateTaintRequest",
'Required parameter "dtoCreateTaintRequest" was null or undefined when calling createTaint().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/taints`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateTaintRequestToJSON(
requestParameters["dtoCreateTaintRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoTaintResponseFromJSON(jsonValue),
);
}
/**
* Creates a taint.
* Create node taint (org scoped)
*/
async createTaint(
requestParameters: CreateTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoTaintResponse> {
const response = await this.createTaintRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Permanently deletes the taint.
* Delete taint (org scoped)
*/
async deleteTaintRaw(
requestParameters: DeleteTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<void>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteTaint().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/taints/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.VoidApiResponse(response);
}
/**
* Permanently deletes the taint.
* Delete taint (org scoped)
*/
async deleteTaint(
requestParameters: DeleteTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<void> {
await this.deleteTaintRaw(requestParameters, initOverrides);
}
/**
* Get node taint by ID (org scoped)
*/
async getTaintRaw(
requestParameters: GetTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoTaintResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling getTaint().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/taints/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoTaintResponseFromJSON(jsonValue),
);
}
/**
* Get node taint by ID (org scoped)
*/
async getTaint(
requestParameters: GetTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoTaintResponse> {
const response = await this.getTaintRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Returns node taints for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.
* List node pool taints (org scoped)
*/
async listTaintsRaw(
requestParameters: ListTaintsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoTaintResponse>>> {
const queryParameters: any = {};
if (requestParameters["key"] != null) {
queryParameters["key"] = requestParameters["key"];
}
if (requestParameters["value"] != null) {
queryParameters["value"] = requestParameters["value"];
}
if (requestParameters["q"] != null) {
queryParameters["q"] = requestParameters["q"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/taints`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoTaintResponseFromJSON),
);
}
/**
* Returns node taints for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.
* List node pool taints (org scoped)
*/
async listTaints(
requestParameters: ListTaintsRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoTaintResponse>> {
const response = await this.listTaintsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Partially update taint fields.
* Update node taint (org scoped)
*/
async updateTaintRaw(
requestParameters: UpdateTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoTaintResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateTaint().',
);
}
if (requestParameters["dtoUpdateTaintRequest"] == null) {
throw new runtime.RequiredError(
"dtoUpdateTaintRequest",
'Required parameter "dtoUpdateTaintRequest" was null or undefined when calling updateTaint().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/taints/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateTaintRequestToJSON(
requestParameters["dtoUpdateTaintRequest"],
),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoTaintResponseFromJSON(jsonValue),
);
}
/**
* Partially update taint fields.
* Update node taint (org scoped)
*/
async updateTaint(
requestParameters: UpdateTaintRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoTaintResponse> {
const response = await this.updateTaintRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

19
sdk/ts/src/apis/index.ts Normal file
View File

@@ -0,0 +1,19 @@
/* tslint:disable */
/* eslint-disable */
export * from "./AnnotationsApi";
export * from "./ArcherAdminApi";
export * from "./AuthApi";
export * from "./ClustersApi";
export * from "./CredentialsApi";
export * from "./DNSApi";
export * from "./HealthApi";
export * from "./LabelsApi";
export * from "./LoadBalancersApi";
export * from "./MeApi";
export * from "./MeAPIKeysApi";
export * from "./MetaApi";
export * from "./NodePoolsApi";
export * from "./OrgsApi";
export * from "./ServersApi";
export * from "./SshApi";
export * from "./TaintsApi";