feat: mostly terraform shenanigans, but TF can now create ssh keys and servers

This commit is contained in:
allanice001
2025-11-02 17:18:28 +00:00
parent 0d10d42442
commit 43f8549320
59 changed files with 6353 additions and 28 deletions

View File

@@ -4,11 +4,13 @@
README.md
docs/AuthApi.md
docs/DtoAuthStartResponse.md
docs/DtoCreateLabelRequest.md
docs/DtoCreateSSHRequest.md
docs/DtoCreateServerRequest.md
docs/DtoCreateTaintRequest.md
docs/DtoJWK.md
docs/DtoJWKS.md
docs/DtoLabelResponse.md
docs/DtoLogoutRequest.md
docs/DtoRefreshRequest.md
docs/DtoServerResponse.md
@@ -16,6 +18,7 @@ docs/DtoSshResponse.md
docs/DtoSshRevealResponse.md
docs/DtoTaintResponse.md
docs/DtoTokenPair.md
docs/DtoUpdateLabelRequest.md
docs/DtoUpdateServerRequest.md
docs/DtoUpdateTaintRequest.md
docs/HandlersCreateUserKeyRequest.md
@@ -28,6 +31,7 @@ docs/HandlersOrgKeyCreateResp.md
docs/HandlersOrgUpdateReq.md
docs/HandlersUpdateMeRequest.md
docs/HandlersUserAPIKeyOut.md
docs/LabelsApi.md
docs/MeAPIKeysApi.md
docs/MeApi.md
docs/ModelsAPIKey.md
@@ -41,6 +45,7 @@ docs/TaintsApi.md
docs/UtilsErrorResponse.md
package.json
src/apis/AuthApi.ts
src/apis/LabelsApi.ts
src/apis/MeAPIKeysApi.ts
src/apis/MeApi.ts
src/apis/OrgsApi.ts
@@ -50,11 +55,13 @@ src/apis/TaintsApi.ts
src/apis/index.ts
src/index.ts
src/models/DtoAuthStartResponse.ts
src/models/DtoCreateLabelRequest.ts
src/models/DtoCreateSSHRequest.ts
src/models/DtoCreateServerRequest.ts
src/models/DtoCreateTaintRequest.ts
src/models/DtoJWK.ts
src/models/DtoJWKS.ts
src/models/DtoLabelResponse.ts
src/models/DtoLogoutRequest.ts
src/models/DtoRefreshRequest.ts
src/models/DtoServerResponse.ts
@@ -62,6 +69,7 @@ src/models/DtoSshResponse.ts
src/models/DtoSshRevealResponse.ts
src/models/DtoTaintResponse.ts
src/models/DtoTokenPair.ts
src/models/DtoUpdateLabelRequest.ts
src/models/DtoUpdateServerRequest.ts
src/models/DtoUpdateTaintRequest.ts
src/models/HandlersCreateUserKeyRequest.ts

View File

@@ -0,0 +1,359 @@
/* 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 {
DtoCreateLabelRequest,
DtoLabelResponse,
DtoUpdateLabelRequest,
} from '../models/index';
import {
DtoCreateLabelRequestFromJSON,
DtoCreateLabelRequestToJSON,
DtoLabelResponseFromJSON,
DtoLabelResponseToJSON,
DtoUpdateLabelRequestFromJSON,
DtoUpdateLabelRequestToJSON,
} from '../models/index';
export interface CreateLabelRequest {
body: 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;
body: 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['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" 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['body']),
}, 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<string>> {
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);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Permanently deletes the label.
* Delete label (org scoped)
*/
async deleteLabel(requestParameters: DeleteLabelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.deleteLabelRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* 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['body'] == null) {
throw new runtime.RequiredError(
'body',
'Required parameter "body" 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['body']),
}, 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

@@ -1,6 +1,7 @@
/* tslint:disable */
/* eslint-disable */
export * from './AuthApi';
export * from './LabelsApi';
export * from './MeApi';
export * from './MeAPIKeysApi';
export * from './OrgsApi';

View File

@@ -0,0 +1,36 @@
# DtoCreateLabelRequest
## Properties
Name | Type
------------ | -------------
`key` | string
`value` | string
## Example
```typescript
import type { DtoCreateLabelRequest } from '@glueops/autoglue-sdk'
// TODO: Update the object below with actual values
const example = {
"key": null,
"value": null,
} satisfies DtoCreateLabelRequest
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 DtoCreateLabelRequest
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,38 @@
# DtoLabelResponse
## Properties
Name | Type
------------ | -------------
`id` | string
`key` | string
`value` | string
## Example
```typescript
import type { DtoLabelResponse } from '@glueops/autoglue-sdk'
// TODO: Update the object below with actual values
const example = {
"id": null,
"key": null,
"value": null,
} satisfies DtoLabelResponse
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 DtoLabelResponse
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,36 @@
# DtoUpdateLabelRequest
## Properties
Name | Type
------------ | -------------
`key` | string
`value` | string
## Example
```typescript
import type { DtoUpdateLabelRequest } from '@glueops/autoglue-sdk'
// TODO: Update the object below with actual values
const example = {
"key": null,
"value": null,
} satisfies DtoUpdateLabelRequest
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 DtoUpdateLabelRequest
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,433 @@
# LabelsApi
All URIs are relative to *http://localhost:8080/api/v1*
| Method | HTTP request | Description |
|------------- | ------------- | -------------|
| [**createLabel**](LabelsApi.md#createlabel) | **POST** /labels | Create label (org scoped) |
| [**deleteLabel**](LabelsApi.md#deletelabel) | **DELETE** /labels/{id} | Delete label (org scoped) |
| [**getLabel**](LabelsApi.md#getlabel) | **GET** /labels/{id} | Get label by ID (org scoped) |
| [**listLabels**](LabelsApi.md#listlabels) | **GET** /labels | List node labels (org scoped) |
| [**updateLabel**](LabelsApi.md#updatelabel) | **PATCH** /labels/{id} | Update label (org scoped) |
## createLabel
> DtoLabelResponse createLabel(body, xOrgID)
Create label (org scoped)
Creates a label.
### Example
```ts
import {
Configuration,
LabelsApi,
} from '@glueops/autoglue-sdk';
import type { CreateLabelRequest } from '@glueops/autoglue-sdk';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk 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 LabelsApi(config);
const body = {
// DtoCreateLabelRequest | Label payload
body: ...,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies CreateLabelRequest;
try {
const data = await api.createLabel(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [DtoCreateLabelRequest](DtoCreateLabelRequest.md) | Label payload | |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoLabelResponse**](DtoLabelResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **201** | Created | - |
| **400** | invalid json / missing fields / invalid node_pool_ids | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | create failed | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## deleteLabel
> string deleteLabel(id, xOrgID)
Delete label (org scoped)
Permanently deletes the label.
### Example
```ts
import {
Configuration,
LabelsApi,
} from '@glueops/autoglue-sdk';
import type { DeleteLabelRequest } from '@glueops/autoglue-sdk';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk 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 LabelsApi(config);
const body = {
// string | Label ID (UUID)
id: id_example,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies DeleteLabelRequest;
try {
const data = await api.deleteLabel(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Label ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
**string**
### 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 |
|-------------|-------------|------------------|
| **204** | No Content | - |
| **400** | invalid id | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **500** | delete failed | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## getLabel
> DtoLabelResponse getLabel(id, xOrgID)
Get label by ID (org scoped)
Returns one label.
### Example
```ts
import {
Configuration,
LabelsApi,
} from '@glueops/autoglue-sdk';
import type { GetLabelRequest } from '@glueops/autoglue-sdk';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk 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 LabelsApi(config);
const body = {
// string | Label ID (UUID)
id: id_example,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies GetLabelRequest;
try {
const data = await api.getLabel(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Label ID (UUID) | [Defaults to `undefined`] |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoLabelResponse**](DtoLabelResponse.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)
## listLabels
> Array&lt;DtoLabelResponse&gt; listLabels(xOrgID, key, value, q)
List node labels (org scoped)
Returns node labels for the organization in X-Org-ID. Filters: &#x60;key&#x60;, &#x60;value&#x60;, and &#x60;q&#x60; (key contains). Add &#x60;include&#x3D;node_pools&#x60; to include linked node groups.
### Example
```ts
import {
Configuration,
LabelsApi,
} from '@glueops/autoglue-sdk';
import type { ListLabelsRequest } from '@glueops/autoglue-sdk';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk 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 LabelsApi(config);
const body = {
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
// string | Exact key (optional)
key: key_example,
// string | Exact value (optional)
value: value_example,
// string | Key contains (case-insensitive) (optional)
q: q_example,
} satisfies ListLabelsRequest;
try {
const data = await api.listLabels(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`] |
| **key** | `string` | Exact key | [Optional] [Defaults to `undefined`] |
| **value** | `string` | Exact value | [Optional] [Defaults to `undefined`] |
| **q** | `string` | Key contains (case-insensitive) | [Optional] [Defaults to `undefined`] |
### Return type
[**Array&lt;DtoLabelResponse&gt;**](DtoLabelResponse.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 node taints | - |
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
## updateLabel
> DtoLabelResponse updateLabel(id, body, xOrgID)
Update label (org scoped)
Partially update label fields.
### Example
```ts
import {
Configuration,
LabelsApi,
} from '@glueops/autoglue-sdk';
import type { UpdateLabelRequest } from '@glueops/autoglue-sdk';
async function example() {
console.log("🚀 Testing @glueops/autoglue-sdk 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 LabelsApi(config);
const body = {
// string | Label ID (UUID)
id: id_example,
// DtoUpdateLabelRequest | Fields to update
body: ...,
// string | Organization UUID (optional)
xOrgID: xOrgID_example,
} satisfies UpdateLabelRequest;
try {
const data = await api.updateLabel(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **id** | `string` | Label ID (UUID) | [Defaults to `undefined`] |
| **body** | [DtoUpdateLabelRequest](DtoUpdateLabelRequest.md) | Fields to update | |
| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] |
### Return type
[**DtoLabelResponse**](DtoLabelResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: `application/json`
- **Accept**: `application/json`
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
| **400** | invalid id / invalid json | - |
| **401** | Unauthorized | - |
| **403** | organization required | - |
| **404** | not found | - |
| **500** | update failed | - |
[[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,73 @@
/* 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 DtoCreateLabelRequest
*/
export interface DtoCreateLabelRequest {
/**
*
* @type {string}
* @memberof DtoCreateLabelRequest
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoCreateLabelRequest
*/
value?: string;
}
/**
* Check if a given object implements the DtoCreateLabelRequest interface.
*/
export function instanceOfDtoCreateLabelRequest(value: object): value is DtoCreateLabelRequest {
return true;
}
export function DtoCreateLabelRequestFromJSON(json: any): DtoCreateLabelRequest {
return DtoCreateLabelRequestFromJSONTyped(json, false);
}
export function DtoCreateLabelRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoCreateLabelRequest {
if (json == null) {
return json;
}
return {
'key': json['key'] == null ? undefined : json['key'],
'value': json['value'] == null ? undefined : json['value'],
};
}
export function DtoCreateLabelRequestToJSON(json: any): DtoCreateLabelRequest {
return DtoCreateLabelRequestToJSONTyped(json, false);
}
export function DtoCreateLabelRequestToJSONTyped(value?: DtoCreateLabelRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'key': value['key'],
'value': value['value'],
};
}

View File

@@ -0,0 +1,81 @@
/* 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 DtoLabelResponse
*/
export interface DtoLabelResponse {
/**
*
* @type {string}
* @memberof DtoLabelResponse
*/
id?: string;
/**
*
* @type {string}
* @memberof DtoLabelResponse
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoLabelResponse
*/
value?: string;
}
/**
* Check if a given object implements the DtoLabelResponse interface.
*/
export function instanceOfDtoLabelResponse(value: object): value is DtoLabelResponse {
return true;
}
export function DtoLabelResponseFromJSON(json: any): DtoLabelResponse {
return DtoLabelResponseFromJSONTyped(json, false);
}
export function DtoLabelResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoLabelResponse {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'key': json['key'] == null ? undefined : json['key'],
'value': json['value'] == null ? undefined : json['value'],
};
}
export function DtoLabelResponseToJSON(json: any): DtoLabelResponse {
return DtoLabelResponseToJSONTyped(json, false);
}
export function DtoLabelResponseToJSONTyped(value?: DtoLabelResponse | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'key': value['key'],
'value': value['value'],
};
}

View File

@@ -0,0 +1,73 @@
/* 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 DtoUpdateLabelRequest
*/
export interface DtoUpdateLabelRequest {
/**
*
* @type {string}
* @memberof DtoUpdateLabelRequest
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoUpdateLabelRequest
*/
value?: string;
}
/**
* Check if a given object implements the DtoUpdateLabelRequest interface.
*/
export function instanceOfDtoUpdateLabelRequest(value: object): value is DtoUpdateLabelRequest {
return true;
}
export function DtoUpdateLabelRequestFromJSON(json: any): DtoUpdateLabelRequest {
return DtoUpdateLabelRequestFromJSONTyped(json, false);
}
export function DtoUpdateLabelRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoUpdateLabelRequest {
if (json == null) {
return json;
}
return {
'key': json['key'] == null ? undefined : json['key'],
'value': json['value'] == null ? undefined : json['value'],
};
}
export function DtoUpdateLabelRequestToJSON(json: any): DtoUpdateLabelRequest {
return DtoUpdateLabelRequestToJSONTyped(json, false);
}
export function DtoUpdateLabelRequestToJSONTyped(value?: DtoUpdateLabelRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'key': value['key'],
'value': value['value'],
};
}

View File

@@ -1,11 +1,13 @@
/* tslint:disable */
/* eslint-disable */
export * from './DtoAuthStartResponse';
export * from './DtoCreateLabelRequest';
export * from './DtoCreateSSHRequest';
export * from './DtoCreateServerRequest';
export * from './DtoCreateTaintRequest';
export * from './DtoJWK';
export * from './DtoJWKS';
export * from './DtoLabelResponse';
export * from './DtoLogoutRequest';
export * from './DtoRefreshRequest';
export * from './DtoServerResponse';
@@ -13,6 +15,7 @@ export * from './DtoSshResponse';
export * from './DtoSshRevealResponse';
export * from './DtoTaintResponse';
export * from './DtoTokenPair';
export * from './DtoUpdateLabelRequest';
export * from './DtoUpdateServerRequest';
export * from './DtoUpdateTaintRequest';
export * from './HandlersCreateUserKeyRequest';