feat: adding background jobs, Dockerfile

This commit is contained in:
allanice001
2025-11-04 18:16:45 +00:00
parent 19d5cf7aab
commit 91686c1ea4
26 changed files with 3025 additions and 0 deletions

View File

@@ -0,0 +1,161 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* 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,
} from '../models/index';
import {
DtoAnnotationResponseFromJSON,
DtoAnnotationResponseToJSON,
} from '../models/index';
export interface GetAnnotationRequest {
id: string;
xOrgID?: string;
include?: string;
}
export interface ListAnnotationsRequest {
xOrgID?: string;
name?: string;
value?: string;
q?: string;
}
/**
*
*/
export class AnnotationsApi extends runtime.BaseAPI {
/**
* 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 = {};
if (requestParameters['include'] != null) {
queryParameters['include'] = requestParameters['include'];
}
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: `name`, `value`, and `q` (name 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['name'] != null) {
queryParameters['name'] = requestParameters['name'];
}
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: `name`, `value`, and `q` (name 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();
}
}

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: 1.0
*
*
* 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,
HandlersHealthStatusToJSON,
} 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,183 @@
# AnnotationsApi
All URIs are relative to *http://localhost:8080/api/v1*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**getAnnotation**](AnnotationsApi.md#getannotation) | **GET** /annotations/{id} | Get annotation by ID (org scoped) |
| [**listAnnotations**](AnnotationsApi.md#listannotations) | **GET** /annotations | List annotations (org scoped) |
## getAnnotation
> DtoAnnotationResponse getAnnotation(id, xOrgID, include)
Get annotation by ID (org scoped)
Returns one annotation. Add &#x60;include&#x3D;node_pools&#x60; to include node pools.
### Example
```ts
import {
Configuration,
AnnotationsApi,
} from '@glueops/autoglue-sdk-go';
import type { GetAnnotationRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: OrgKeyAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: OrgSecretAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new AnnotationsApi(config);
const body = {
// string | Annotation ID (UUID)
id: id_example,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
// string | Optional: node_pools (optional)
include: include_example,
} satisfies GetAnnotationRequest;
try {
const data = await api.getAnnotation(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Annotation ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
| **include** | `string` | Optional: node_pools | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | invalid id | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **404** | not found | - |
| **500** | fetch failed | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## listAnnotations
> Array&lt;DtoAnnotationResponse&gt; listAnnotations(xOrgID, name, value, q)
List annotations (org scoped)
Returns annotations for the organization in X-Org-ID. Filters: &#x60;name&#x60;, &#x60;value&#x60;, and &#x60;q&#x60; (name contains). Add &#x60;include&#x3D;node_pools&#x60; to include linked node pools.
### Example
```ts
import {
Configuration,
AnnotationsApi,
} from '@glueops/autoglue-sdk-go';
import type { ListAnnotationsRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const config = new Configuration({
// To configure API key authorization: OrgKeyAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: OrgSecretAuth
apiKey: "YOUR API KEY",
// To configure API key authorization: BearerAuth
apiKey: "YOUR API KEY",
});
const api = new AnnotationsApi(config);
const body = {
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
// string | Exact name (optional)
name: name_example,
// string | Exact value (optional)
value: value_example,
// string | name contains (case-insensitive) (optional)
q: q_example,
} satisfies ListAnnotationsRequest;
try {
const data = await api.listAnnotations(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
| **name** | `string` | Exact name | [Optional] [Defaults to `undefined`] |
| **value** | `string` | Exact value | [Optional] [Defaults to `undefined`] |
| **q** | `string` | name contains (case-insensitive) | [Optional] [Defaults to `undefined`] |
### Return type
[**Array&lt;DtoAnnotationResponse&gt;**](DtoAnnotationResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | failed to list annotations | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,44 @@
# DtoAnnotationResponse
## Properties
Name | Type
------------ | -------------
`created_at` | string
`id` | string
`key` | string
`organization_id` | string
`updated_at` | string
`value` | string
## Example
```typescript
import type { DtoAnnotationResponse } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"created_at": null,
"id": null,
"key": null,
"organization_id": null,
"updated_at": null,
"value": null,
} satisfies DtoAnnotationResponse
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as DtoAnnotationResponse
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,34 @@
# HandlersHealthStatus
## Properties
Name | Type
------------ | -------------
`status` | string
## Example
```typescript
import type { HandlersHealthStatus } from '@glueops/autoglue-sdk-go'
// TODO: Update the object below with actual values
const example = {
"status": ok,
} satisfies HandlersHealthStatus
console.log(example)
// Convert the instance to a JSON string
const exampleJSON: string = JSON.stringify(example)
console.log(exampleJSON)
// Parse the JSON string back to an object
const exampleParsed = JSON.parse(exampleJSON) as HandlersHealthStatus
console.log(exampleParsed)
```
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,68 @@
# HealthApi
All URIs are relative to *http://localhost:8080/api/v1*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**healthCheckOperationId**](HealthApi.md#healthcheckoperationid) | **GET** /healthz | Basic health check |
## healthCheckOperationId
> HandlersHealthStatus healthCheckOperationId()
Basic health check
Returns 200 OK when the service is up
### Example
```ts
import {
Configuration,
HealthApi,
} from '@glueops/autoglue-sdk-go';
import type { HealthCheckOperationIdRequest } from '@glueops/autoglue-sdk-go';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk-go SDK...");
const api = new HealthApi();
try {
const data = await api.healthCheckOperationId();
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**HandlersHealthStatus**](HandlersHealthStatus.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,105 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface DtoAnnotationResponse
*/
export interface DtoAnnotationResponse {
/**
*
* @type {string}
* @memberof DtoAnnotationResponse
*/
created_at?: string;
/**
*
* @type {string}
* @memberof DtoAnnotationResponse
*/
id?: string;
/**
*
* @type {string}
* @memberof DtoAnnotationResponse
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoAnnotationResponse
*/
organization_id?: string;
/**
*
* @type {string}
* @memberof DtoAnnotationResponse
*/
updated_at?: string;
/**
*
* @type {string}
* @memberof DtoAnnotationResponse
*/
value?: string;
}
/**
* Check if a given object implements the DtoAnnotationResponse interface.
*/
export function instanceOfDtoAnnotationResponse(value: object): value is DtoAnnotationResponse {
return true;
}
export function DtoAnnotationResponseFromJSON(json: any): DtoAnnotationResponse {
return DtoAnnotationResponseFromJSONTyped(json, false);
}
export function DtoAnnotationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoAnnotationResponse {
if (json == null) {
return json;
}
return {
'created_at': json['created_at'] == null ? undefined : json['created_at'],
'id': json['id'] == null ? undefined : json['id'],
'key': json['key'] == null ? undefined : json['key'],
'organization_id': json['organization_id'] == null ? undefined : json['organization_id'],
'updated_at': json['updated_at'] == null ? undefined : json['updated_at'],
'value': json['value'] == null ? undefined : json['value'],
};
}
export function DtoAnnotationResponseToJSON(json: any): DtoAnnotationResponse {
return DtoAnnotationResponseToJSONTyped(json, false);
}
export function DtoAnnotationResponseToJSONTyped(value?: DtoAnnotationResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'created_at': value['created_at'],
'id': value['id'],
'key': value['key'],
'organization_id': value['organization_id'],
'updated_at': value['updated_at'],
'value': value['value'],
};
}

View File

@@ -0,0 +1,65 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface HandlersHealthStatus
*/
export interface HandlersHealthStatus {
/**
*
* @type {string}
* @memberof HandlersHealthStatus
*/
status?: string;
}
/**
* Check if a given object implements the HandlersHealthStatus interface.
*/
export function instanceOfHandlersHealthStatus(value: object): value is HandlersHealthStatus {
return true;
}
export function HandlersHealthStatusFromJSON(json: any): HandlersHealthStatus {
return HandlersHealthStatusFromJSONTyped(json, false);
}
export function HandlersHealthStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): HandlersHealthStatus {
if (json == null) {
return json;
}
return {
'status': json['status'] == null ? undefined : json['status'],
};
}
export function HandlersHealthStatusToJSON(json: any): HandlersHealthStatus {
return HandlersHealthStatusToJSONTyped(json, false);
}
export function HandlersHealthStatusToJSONTyped(value?: HandlersHealthStatus | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'status': value['status'],
};
}