f5-conx-core
Version:
F5 SDK for JavaScript with Typescript type definitions
130 lines (129 loc) • 3.85 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import path from "path";
import { ExtHttp } from "./externalHttps";
/**
* basic frame work to interact with iHealth
* from Sergio Pereira
* https://clouddocs.f5.com/api/ihealth/Authentication.html
*/
export declare class IhealthClient extends ExtHttp {
username: string;
private _password;
private _api_host;
private _host;
private _headers;
private _authURL;
/**
* list/add/delete qkviews endpoint
* https://clouddocs.f5.com/api/ihealth/QKView_Collection_Methods.html
*/
private _collectionURL;
private _cookies;
private _cookiesExpiration;
/**
* token timer value
*
* Starts when a token is refreshed, start value is token time out
*
* An asyncronous timer counts down till zero
*
*/
tokenTimeout: number | undefined;
/**
* system interval id for the async token timer
*
* **pre-emptivly clears token at <10 seconds but keeps counting to zero**
*/
protected _tokenIntervalId: NodeJS.Timeout | undefined;
/**
* qkview metadata for listing and fetching further qkview details
*/
qkviews: qkviewMetaData[];
constructor(username: string, password: string);
/**
* Login to iHealth with user creds and save auth cookie
*/
private login;
/**
* clear login token
* - to be used when we detect login failure scenario
*/
clearLogin(): Promise<number>;
/**
* bigip auth token lifetime countdown
* will clear auth token details when finished
* prompting the next http call to get a new token
*/
private tokenTimer;
/**
* list qkviews/IDs = '/qkview-analyzer/api/qkviews/'
*
* **includes all metaData -> held in qkviews class param**
*/
listQkviews(): Promise<void>;
/**
* list qkviews/IDs = '/qkview-analyzer/api/qkviews/'
*/
qkviewMetaData(id: string): Promise<import(".").AxiosResponseWithTimings>;
/**
* list qkviews/IDs = '/qkview-analyzer/api/qkviews/'
*/
uploadiHealth(file: path.ParsedPath): Promise<import(".").AxiosResponseWithTimings>;
/**
* list commands = '/qkview-analyzer/api/qkviews/{qkview_id}/commands'
*
* https://clouddocs.f5.com/api/ihealth/QKView_Command_Output.html
*
* @param id qkview-id
*/
listCommands(id: string): Promise<import(".").AxiosResponseWithTimings>;
/**
* cmd output = '/qkview-analyzer/api/qkviews/{qkview_id}/commands/{a}'
*
* https://clouddocs.f5.com/api/ihealth/QKView_Command_Output.html
*
* @param id qkview-id
* @param cmd command to execute on qkview
*/
qkviewCommand(id: string, cmd: string): Promise<import(".").AxiosResponseWithTimings>;
/**
* get diagnostics for qkview
* - '/qkview-analyzer/api/qkviews/{qkview_id}/diagnostics?set=hit'
* https://clouddocs.f5.com/api/ihealth/QKView_Diagnostics.html
* @param id qkview-id
*/
getDiagnostics(id: string): Promise<import(".").AxiosResponseWithTimings>;
}
export type qkviewMetaData = {
files: string;
commands: string;
bigip: string;
gui_uri: string;
primary_blade_uri: string;
chassis_serial: string;
hostname: string;
visible_in_gui: boolean;
description: string;
f5_support_case: string;
entitlement: {
expiriation_date: string;
days_left: string;
};
generation_date: number;
upload: {
performed_by: {
name: string;
email: string;
};
date: number;
};
expiration_date: number;
processing_status: string;
processing_messages: string;
file_size: number;
file_name: string;
diagnostics: string;
secondary_blade_url: string;
id: number | string;
};