rough in '/agent/share/http-healthcheck' for remoted healthchecks (#1002)

This commit is contained in:
Michael Quigley
2025-07-18 11:57:30 -04:00
parent a73125977b
commit b99e414fce
37 changed files with 2536 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ models/EnvironmentAndResources.ts
models/Frontend.ts
models/GetSparklines200Response.ts
models/GetSparklinesRequest.ts
models/HttpHealthcheck200Response.ts
models/HttpHealthcheckRequest.ts
models/InviteRequest.ts
models/InviteTokenGenerateRequest.ts
models/ListFrontends200ResponseInner.ts

View File

@@ -18,6 +18,8 @@ import type {
CreateFrontend201Response,
Enroll200Response,
EnrollRequest,
HttpHealthcheck200Response,
HttpHealthcheckRequest,
Ping200Response,
RemoteAccessRequest,
RemoteShare200Response,
@@ -33,6 +35,10 @@ import {
Enroll200ResponseToJSON,
EnrollRequestFromJSON,
EnrollRequestToJSON,
HttpHealthcheck200ResponseFromJSON,
HttpHealthcheck200ResponseToJSON,
HttpHealthcheckRequestFromJSON,
HttpHealthcheckRequestToJSON,
Ping200ResponseFromJSON,
Ping200ResponseToJSON,
RemoteAccessRequestFromJSON,
@@ -53,6 +59,10 @@ export interface EnrollOperationRequest {
body?: EnrollRequest;
}
export interface HttpHealthcheckOperationRequest {
body?: HttpHealthcheckRequest;
}
export interface PingRequest {
body?: EnrollRequest;
}
@@ -120,6 +130,40 @@ export class AgentApi extends runtime.BaseAPI {
return await response.value();
}
/**
*/
async httpHealthcheckRaw(requestParameters: HttpHealthcheckOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HttpHealthcheck200Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication
}
let urlPath = `/agent/share/http-healthcheck`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: HttpHealthcheckRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => HttpHealthcheck200ResponseFromJSON(jsonValue));
}
/**
*/
async httpHealthcheck(requestParameters: HttpHealthcheckOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HttpHealthcheck200Response> {
const response = await this.httpHealthcheckRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async pingRaw(requestParameters: PingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Ping200Response>> {

View File

@@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 1.0.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 HttpHealthcheck200Response
*/
export interface HttpHealthcheck200Response {
/**
*
* @type {boolean}
* @memberof HttpHealthcheck200Response
*/
healthy?: boolean;
/**
*
* @type {string}
* @memberof HttpHealthcheck200Response
*/
error?: string;
}
/**
* Check if a given object implements the HttpHealthcheck200Response interface.
*/
export function instanceOfHttpHealthcheck200Response(value: object): value is HttpHealthcheck200Response {
return true;
}
export function HttpHealthcheck200ResponseFromJSON(json: any): HttpHealthcheck200Response {
return HttpHealthcheck200ResponseFromJSONTyped(json, false);
}
export function HttpHealthcheck200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): HttpHealthcheck200Response {
if (json == null) {
return json;
}
return {
'healthy': json['healthy'] == null ? undefined : json['healthy'],
'error': json['error'] == null ? undefined : json['error'],
};
}
export function HttpHealthcheck200ResponseToJSON(json: any): HttpHealthcheck200Response {
return HttpHealthcheck200ResponseToJSONTyped(json, false);
}
export function HttpHealthcheck200ResponseToJSONTyped(value?: HttpHealthcheck200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'healthy': value['healthy'],
'error': value['error'],
};
}

View File

@@ -0,0 +1,105 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 1.0.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 HttpHealthcheckRequest
*/
export interface HttpHealthcheckRequest {
/**
*
* @type {string}
* @memberof HttpHealthcheckRequest
*/
envZId?: string;
/**
*
* @type {string}
* @memberof HttpHealthcheckRequest
*/
shareToken?: string;
/**
*
* @type {string}
* @memberof HttpHealthcheckRequest
*/
httpVerb?: string;
/**
*
* @type {string}
* @memberof HttpHealthcheckRequest
*/
endpoint?: string;
/**
*
* @type {number}
* @memberof HttpHealthcheckRequest
*/
expectedHttpResponse?: number;
/**
*
* @type {number}
* @memberof HttpHealthcheckRequest
*/
timeoutMs?: number;
}
/**
* Check if a given object implements the HttpHealthcheckRequest interface.
*/
export function instanceOfHttpHealthcheckRequest(value: object): value is HttpHealthcheckRequest {
return true;
}
export function HttpHealthcheckRequestFromJSON(json: any): HttpHealthcheckRequest {
return HttpHealthcheckRequestFromJSONTyped(json, false);
}
export function HttpHealthcheckRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): HttpHealthcheckRequest {
if (json == null) {
return json;
}
return {
'envZId': json['envZId'] == null ? undefined : json['envZId'],
'shareToken': json['shareToken'] == null ? undefined : json['shareToken'],
'httpVerb': json['httpVerb'] == null ? undefined : json['httpVerb'],
'endpoint': json['endpoint'] == null ? undefined : json['endpoint'],
'expectedHttpResponse': json['expectedHttpResponse'] == null ? undefined : json['expectedHttpResponse'],
'timeoutMs': json['timeoutMs'] == null ? undefined : json['timeoutMs'],
};
}
export function HttpHealthcheckRequestToJSON(json: any): HttpHealthcheckRequest {
return HttpHealthcheckRequestToJSONTyped(json, false);
}
export function HttpHealthcheckRequestToJSONTyped(value?: HttpHealthcheckRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'envZId': value['envZId'],
'shareToken': value['shareToken'],
'httpVerb': value['httpVerb'],
'endpoint': value['endpoint'],
'expectedHttpResponse': value['expectedHttpResponse'],
'timeoutMs': value['timeoutMs'],
};
}

View File

@@ -23,6 +23,8 @@ export * from './EnvironmentAndResources';
export * from './Frontend';
export * from './GetSparklines200Response';
export * from './GetSparklinesRequest';
export * from './HttpHealthcheck200Response';
export * from './HttpHealthcheckRequest';
export * from './InviteRequest';
export * from './InviteTokenGenerateRequest';
export * from './ListFrontends200ResponseInner';