diff --git a/sdk/go/api_annotations.go b/sdk/go/api_annotations.go new file mode 100644 index 0000000..68d4c65 --- /dev/null +++ b/sdk/go/api_annotations.go @@ -0,0 +1,457 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// AnnotationsAPIService AnnotationsAPI service +type AnnotationsAPIService service + +type ApiGetAnnotationRequest struct { + ctx context.Context + ApiService *AnnotationsAPIService + id string + xOrgID *string + include *string +} + +// Organization UUID +func (r ApiGetAnnotationRequest) XOrgID(xOrgID string) ApiGetAnnotationRequest { + r.xOrgID = &xOrgID + return r +} + +// Optional: node_pools +func (r ApiGetAnnotationRequest) Include(include string) ApiGetAnnotationRequest { + r.include = &include + return r +} + +func (r ApiGetAnnotationRequest) Execute() (*DtoAnnotationResponse, *http.Response, error) { + return r.ApiService.GetAnnotationExecute(r) +} + +/* +GetAnnotation Get annotation by ID (org scoped) + +Returns one annotation. Add `include=node_pools` to include node pools. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Annotation ID (UUID) + @return ApiGetAnnotationRequest +*/ +func (a *AnnotationsAPIService) GetAnnotation(ctx context.Context, id string) ApiGetAnnotationRequest { + return ApiGetAnnotationRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DtoAnnotationResponse +func (a *AnnotationsAPIService) GetAnnotationExecute(r ApiGetAnnotationRequest) (*DtoAnnotationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DtoAnnotationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnnotationsAPIService.GetAnnotation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/annotations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.include != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListAnnotationsRequest struct { + ctx context.Context + ApiService *AnnotationsAPIService + xOrgID *string + name *string + value *string + q *string +} + +// Organization UUID +func (r ApiListAnnotationsRequest) XOrgID(xOrgID string) ApiListAnnotationsRequest { + r.xOrgID = &xOrgID + return r +} + +// Exact name +func (r ApiListAnnotationsRequest) Name(name string) ApiListAnnotationsRequest { + r.name = &name + return r +} + +// Exact value +func (r ApiListAnnotationsRequest) Value(value string) ApiListAnnotationsRequest { + r.value = &value + return r +} + +// name contains (case-insensitive) +func (r ApiListAnnotationsRequest) Q(q string) ApiListAnnotationsRequest { + r.q = &q + return r +} + +func (r ApiListAnnotationsRequest) Execute() ([]DtoAnnotationResponse, *http.Response, error) { + return r.ApiService.ListAnnotationsExecute(r) +} + +/* +ListAnnotations 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. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListAnnotationsRequest +*/ +func (a *AnnotationsAPIService) ListAnnotations(ctx context.Context) ApiListAnnotationsRequest { + return ApiListAnnotationsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DtoAnnotationResponse +func (a *AnnotationsAPIService) ListAnnotationsExecute(r ApiListAnnotationsRequest) ([]DtoAnnotationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DtoAnnotationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnnotationsAPIService.ListAnnotations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/annotations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "", "") + } + if r.value != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "value", r.value, "", "") + } + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/sdk/go/api_health.go b/sdk/go/api_health.go new file mode 100644 index 0000000..39f9d39 --- /dev/null +++ b/sdk/go/api_health.go @@ -0,0 +1,122 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// HealthAPIService HealthAPI service +type HealthAPIService service + +type ApiHealthCheckOperationIdRequest struct { + ctx context.Context + ApiService *HealthAPIService +} + +func (r ApiHealthCheckOperationIdRequest) Execute() (*HandlersHealthStatus, *http.Response, error) { + return r.ApiService.HealthCheckOperationIdExecute(r) +} + +/* +HealthCheckOperationId Basic health check + +Returns 200 OK when the service is up + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiHealthCheckOperationIdRequest +*/ +func (a *HealthAPIService) HealthCheckOperationId(ctx context.Context) ApiHealthCheckOperationIdRequest { + return ApiHealthCheckOperationIdRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return HandlersHealthStatus +func (a *HealthAPIService) HealthCheckOperationIdExecute(r ApiHealthCheckOperationIdRequest) (*HandlersHealthStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *HandlersHealthStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HealthAPIService.HealthCheckOperationId") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/healthz" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/sdk/go/docs/AnnotationsAPI.md b/sdk/go/docs/AnnotationsAPI.md new file mode 100644 index 0000000..1a7735e --- /dev/null +++ b/sdk/go/docs/AnnotationsAPI.md @@ -0,0 +1,156 @@ +# \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(ctx, id).XOrgID(xOrgID).Include(include).Execute() + +Get annotation by ID (org scoped) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Annotation ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + include := "include_example" // string | Optional: node_pools (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AnnotationsAPI.GetAnnotation(context.Background(), id).XOrgID(xOrgID).Include(include).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.GetAnnotation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAnnotation`: DtoAnnotationResponse + fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.GetAnnotation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Annotation ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAnnotationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgID** | **string** | Organization UUID | + **include** | **string** | Optional: node_pools | + +### 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 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListAnnotations + +> []DtoAnnotationResponse ListAnnotations(ctx).XOrgID(xOrgID).Name(name).Value(value).Q(q).Execute() + +List annotations (org scoped) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + name := "name_example" // string | Exact name (optional) + value := "value_example" // string | Exact value (optional) + q := "q_example" // string | name contains (case-insensitive) (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AnnotationsAPI.ListAnnotations(context.Background()).XOrgID(xOrgID).Name(name).Value(value).Q(q).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.ListAnnotations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListAnnotations`: []DtoAnnotationResponse + fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.ListAnnotations`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiListAnnotationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgID** | **string** | Organization UUID | + **name** | **string** | Exact name | + **value** | **string** | Exact value | + **q** | **string** | name contains (case-insensitive) | + +### 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 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/sdk/go/docs/DtoAnnotationResponse.md b/sdk/go/docs/DtoAnnotationResponse.md new file mode 100644 index 0000000..b9564f6 --- /dev/null +++ b/sdk/go/docs/DtoAnnotationResponse.md @@ -0,0 +1,186 @@ +# DtoAnnotationResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Key** | Pointer to **string** | | [optional] +**OrganizationId** | Pointer to **string** | | [optional] +**UpdatedAt** | Pointer to **string** | | [optional] +**Value** | Pointer to **string** | | [optional] + +## Methods + +### NewDtoAnnotationResponse + +`func NewDtoAnnotationResponse() *DtoAnnotationResponse` + +NewDtoAnnotationResponse instantiates a new DtoAnnotationResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoAnnotationResponseWithDefaults + +`func NewDtoAnnotationResponseWithDefaults() *DtoAnnotationResponse` + +NewDtoAnnotationResponseWithDefaults instantiates a new DtoAnnotationResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *DtoAnnotationResponse) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *DtoAnnotationResponse) GetCreatedAtOk() (*string, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *DtoAnnotationResponse) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *DtoAnnotationResponse) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetId + +`func (o *DtoAnnotationResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DtoAnnotationResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DtoAnnotationResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *DtoAnnotationResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetKey + +`func (o *DtoAnnotationResponse) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *DtoAnnotationResponse) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *DtoAnnotationResponse) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *DtoAnnotationResponse) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetOrganizationId + +`func (o *DtoAnnotationResponse) GetOrganizationId() string` + +GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise. + +### GetOrganizationIdOk + +`func (o *DtoAnnotationResponse) GetOrganizationIdOk() (*string, bool)` + +GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganizationId + +`func (o *DtoAnnotationResponse) SetOrganizationId(v string)` + +SetOrganizationId sets OrganizationId field to given value. + +### HasOrganizationId + +`func (o *DtoAnnotationResponse) HasOrganizationId() bool` + +HasOrganizationId returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *DtoAnnotationResponse) GetUpdatedAt() string` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *DtoAnnotationResponse) GetUpdatedAtOk() (*string, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *DtoAnnotationResponse) SetUpdatedAt(v string)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *DtoAnnotationResponse) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetValue + +`func (o *DtoAnnotationResponse) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *DtoAnnotationResponse) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *DtoAnnotationResponse) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *DtoAnnotationResponse) HasValue() bool` + +HasValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/HandlersHealthStatus.md b/sdk/go/docs/HandlersHealthStatus.md new file mode 100644 index 0000000..2b5d1a2 --- /dev/null +++ b/sdk/go/docs/HandlersHealthStatus.md @@ -0,0 +1,56 @@ +# HandlersHealthStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewHandlersHealthStatus + +`func NewHandlersHealthStatus() *HandlersHealthStatus` + +NewHandlersHealthStatus instantiates a new HandlersHealthStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHandlersHealthStatusWithDefaults + +`func NewHandlersHealthStatusWithDefaults() *HandlersHealthStatus` + +NewHandlersHealthStatusWithDefaults instantiates a new HandlersHealthStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *HandlersHealthStatus) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *HandlersHealthStatus) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *HandlersHealthStatus) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *HandlersHealthStatus) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/HealthAPI.md b/sdk/go/docs/HealthAPI.md new file mode 100644 index 0000000..35d525c --- /dev/null +++ b/sdk/go/docs/HealthAPI.md @@ -0,0 +1,70 @@ +# \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(ctx).Execute() + +Basic health check + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.HealthAPI.HealthCheckOperationId(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `HealthAPI.HealthCheckOperationId``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `HealthCheckOperationId`: HandlersHealthStatus + fmt.Fprintf(os.Stdout, "Response from `HealthAPI.HealthCheckOperationId`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiHealthCheckOperationIdRequest struct via the builder pattern + + +### Return type + +[**HandlersHealthStatus**](HandlersHealthStatus.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/sdk/go/model_dto_annotation_response.go b/sdk/go/model_dto_annotation_response.go new file mode 100644 index 0000000..cf809f2 --- /dev/null +++ b/sdk/go/model_dto_annotation_response.go @@ -0,0 +1,304 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoAnnotationResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoAnnotationResponse{} + +// DtoAnnotationResponse struct for DtoAnnotationResponse +type DtoAnnotationResponse struct { + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + OrganizationId *string `json:"organization_id,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + Value *string `json:"value,omitempty"` +} + +// NewDtoAnnotationResponse instantiates a new DtoAnnotationResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoAnnotationResponse() *DtoAnnotationResponse { + this := DtoAnnotationResponse{} + return &this +} + +// NewDtoAnnotationResponseWithDefaults instantiates a new DtoAnnotationResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoAnnotationResponseWithDefaults() *DtoAnnotationResponse { + this := DtoAnnotationResponse{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *DtoAnnotationResponse) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAnnotationResponse) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DtoAnnotationResponse) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *DtoAnnotationResponse) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DtoAnnotationResponse) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAnnotationResponse) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DtoAnnotationResponse) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DtoAnnotationResponse) SetId(v string) { + o.Id = &v +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *DtoAnnotationResponse) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAnnotationResponse) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *DtoAnnotationResponse) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *DtoAnnotationResponse) SetKey(v string) { + o.Key = &v +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *DtoAnnotationResponse) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAnnotationResponse) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *DtoAnnotationResponse) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *DtoAnnotationResponse) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *DtoAnnotationResponse) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAnnotationResponse) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *DtoAnnotationResponse) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *DtoAnnotationResponse) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DtoAnnotationResponse) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAnnotationResponse) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DtoAnnotationResponse) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *DtoAnnotationResponse) SetValue(v string) { + o.Value = &v +} + +func (o DtoAnnotationResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoAnnotationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.OrganizationId) { + toSerialize["organization_id"] = o.OrganizationId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableDtoAnnotationResponse struct { + value *DtoAnnotationResponse + isSet bool +} + +func (v NullableDtoAnnotationResponse) Get() *DtoAnnotationResponse { + return v.value +} + +func (v *NullableDtoAnnotationResponse) Set(val *DtoAnnotationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDtoAnnotationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoAnnotationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoAnnotationResponse(val *DtoAnnotationResponse) *NullableDtoAnnotationResponse { + return &NullableDtoAnnotationResponse{value: val, isSet: true} +} + +func (v NullableDtoAnnotationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoAnnotationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_handlers_health_status.go b/sdk/go/model_handlers_health_status.go new file mode 100644 index 0000000..088acb4 --- /dev/null +++ b/sdk/go/model_handlers_health_status.go @@ -0,0 +1,124 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the HandlersHealthStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HandlersHealthStatus{} + +// HandlersHealthStatus struct for HandlersHealthStatus +type HandlersHealthStatus struct { + Status *string `json:"status,omitempty"` +} + +// NewHandlersHealthStatus instantiates a new HandlersHealthStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHandlersHealthStatus() *HandlersHealthStatus { + this := HandlersHealthStatus{} + return &this +} + +// NewHandlersHealthStatusWithDefaults instantiates a new HandlersHealthStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHandlersHealthStatusWithDefaults() *HandlersHealthStatus { + this := HandlersHealthStatus{} + return &this +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *HandlersHealthStatus) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HandlersHealthStatus) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *HandlersHealthStatus) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *HandlersHealthStatus) SetStatus(v string) { + o.Status = &v +} + +func (o HandlersHealthStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HandlersHealthStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableHandlersHealthStatus struct { + value *HandlersHealthStatus + isSet bool +} + +func (v NullableHandlersHealthStatus) Get() *HandlersHealthStatus { + return v.value +} + +func (v *NullableHandlersHealthStatus) Set(val *HandlersHealthStatus) { + v.value = val + v.isSet = true +} + +func (v NullableHandlersHealthStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableHandlersHealthStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHandlersHealthStatus(val *HandlersHealthStatus) *NullableHandlersHealthStatus { + return &NullableHandlersHealthStatus{value: val, isSet: true} +} + +func (v NullableHandlersHealthStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHandlersHealthStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/test/api_annotations_test.go b/sdk/go/test/api_annotations_test.go new file mode 100644 index 0000000..2e42a73 --- /dev/null +++ b/sdk/go/test/api_annotations_test.go @@ -0,0 +1,51 @@ +/* +AutoGlue API + +Testing AnnotationsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package autoglue + +import ( + "context" + openapiclient "github.com/glueops/autoglue-sdk-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_autoglue_AnnotationsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test AnnotationsAPIService GetAnnotation", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.AnnotationsAPI.GetAnnotation(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test AnnotationsAPIService ListAnnotations", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.AnnotationsAPI.ListAnnotations(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/sdk/go/test/api_health_test.go b/sdk/go/test/api_health_test.go new file mode 100644 index 0000000..972e6dd --- /dev/null +++ b/sdk/go/test/api_health_test.go @@ -0,0 +1,37 @@ +/* +AutoGlue API + +Testing HealthAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package autoglue + +import ( + "context" + openapiclient "github.com/glueops/autoglue-sdk-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_autoglue_HealthAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test HealthAPIService HealthCheckOperationId", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.HealthAPI.HealthCheckOperationId(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/sdk/ts/docs/AnnotationsApi.md b/sdk/ts/docs/AnnotationsApi.md new file mode 100644 index 0000000..2cce411 --- /dev/null +++ b/sdk/ts/docs/AnnotationsApi.md @@ -0,0 +1,171 @@ +# 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) diff --git a/sdk/ts/docs/DtoAnnotationResponse.md b/sdk/ts/docs/DtoAnnotationResponse.md new file mode 100644 index 0000000..ab5a4db --- /dev/null +++ b/sdk/ts/docs/DtoAnnotationResponse.md @@ -0,0 +1,40 @@ +# 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) diff --git a/sdk/ts/docs/HandlersHealthStatus.md b/sdk/ts/docs/HandlersHealthStatus.md new file mode 100644 index 0000000..6ff1b8f --- /dev/null +++ b/sdk/ts/docs/HandlersHealthStatus.md @@ -0,0 +1,30 @@ +# 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) diff --git a/sdk/ts/docs/HealthApi.md b/sdk/ts/docs/HealthApi.md new file mode 100644 index 0000000..abe6e9f --- /dev/null +++ b/sdk/ts/docs/HealthApi.md @@ -0,0 +1,62 @@ +# 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) diff --git a/sdk/ts/src/apis/AnnotationsApi.ts b/sdk/ts/src/apis/AnnotationsApi.ts new file mode 100644 index 0000000..e7fb1c3 --- /dev/null +++ b/sdk/ts/src/apis/AnnotationsApi.ts @@ -0,0 +1,191 @@ +/* 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> { + 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 { + 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>> { + 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> { + const response = await this.listAnnotationsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } +} diff --git a/sdk/ts/src/apis/HealthApi.ts b/sdk/ts/src/apis/HealthApi.ts new file mode 100644 index 0000000..0394f80 --- /dev/null +++ b/sdk/ts/src/apis/HealthApi.ts @@ -0,0 +1,64 @@ +/* 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> { + 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 { + const response = await this.healthCheckOperationIdRaw(initOverrides); + return await response.value(); + } +} diff --git a/sdk/ts/src/models/DtoAnnotationResponse.ts b/sdk/ts/src/models/DtoAnnotationResponse.ts new file mode 100644 index 0000000..01ec2f9 --- /dev/null +++ b/sdk/ts/src/models/DtoAnnotationResponse.ts @@ -0,0 +1,113 @@ +/* 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"], + }; +} diff --git a/sdk/ts/src/models/HandlersHealthStatus.ts b/sdk/ts/src/models/HandlersHealthStatus.ts new file mode 100644 index 0000000..a984cd4 --- /dev/null +++ b/sdk/ts/src/models/HandlersHealthStatus.ts @@ -0,0 +1,70 @@ +/* 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"], + }; +} diff --git a/ui/src/sdk/apis/AnnotationsApi.ts b/ui/src/sdk/apis/AnnotationsApi.ts new file mode 100644 index 0000000..419287d --- /dev/null +++ b/ui/src/sdk/apis/AnnotationsApi.ts @@ -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> { + 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 { + 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>> { + 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> { + const response = await this.listAnnotationsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/ui/src/sdk/apis/HealthApi.ts b/ui/src/sdk/apis/HealthApi.ts new file mode 100644 index 0000000..a9fdd75 --- /dev/null +++ b/ui/src/sdk/apis/HealthApi.ts @@ -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> { + 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 { + const response = await this.healthCheckOperationIdRaw(initOverrides); + return await response.value(); + } + +} diff --git a/ui/src/sdk/docs/AnnotationsApi.md b/ui/src/sdk/docs/AnnotationsApi.md new file mode 100644 index 0000000..8c5ee37 --- /dev/null +++ b/ui/src/sdk/docs/AnnotationsApi.md @@ -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 `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) + diff --git a/ui/src/sdk/docs/DtoAnnotationResponse.md b/ui/src/sdk/docs/DtoAnnotationResponse.md new file mode 100644 index 0000000..ea2d020 --- /dev/null +++ b/ui/src/sdk/docs/DtoAnnotationResponse.md @@ -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) + + diff --git a/ui/src/sdk/docs/HandlersHealthStatus.md b/ui/src/sdk/docs/HandlersHealthStatus.md new file mode 100644 index 0000000..d34fdf6 --- /dev/null +++ b/ui/src/sdk/docs/HandlersHealthStatus.md @@ -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) + + diff --git a/ui/src/sdk/docs/HealthApi.md b/ui/src/sdk/docs/HealthApi.md new file mode 100644 index 0000000..f6f82bc --- /dev/null +++ b/ui/src/sdk/docs/HealthApi.md @@ -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) + diff --git a/ui/src/sdk/models/DtoAnnotationResponse.ts b/ui/src/sdk/models/DtoAnnotationResponse.ts new file mode 100644 index 0000000..1f4ba84 --- /dev/null +++ b/ui/src/sdk/models/DtoAnnotationResponse.ts @@ -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'], + }; +} + diff --git a/ui/src/sdk/models/HandlersHealthStatus.ts b/ui/src/sdk/models/HandlersHealthStatus.ts new file mode 100644 index 0000000..af28d30 --- /dev/null +++ b/ui/src/sdk/models/HandlersHealthStatus.ts @@ -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'], + }; +} +