mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 04:40:05 +01:00
172 lines
6.0 KiB
Markdown
172 lines
6.0 KiB
Markdown
# 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 `include=node_pools` 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<DtoAnnotationResponse> listAnnotations(xOrgID, name, value, q)
|
|
|
|
List annotations (org scoped)
|
|
|
|
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.
|
|
|
|
### 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<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 | - |
|
|
| **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)
|