UNPKG

f5-conx-core

Version:

F5 SDK for JavaScript with Typescript type definitions

193 lines (192 loc) 4.24 kB
/** * Copyright 2021 F5 Networks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * target/tenant/app index type * - now includes app pieces * * ```ts * const exmp = { * "target": { * "tenant": { * "app": { * Pool: 1, * Service_HTTP: 1, * ... * }, * }, * }, * } * ``` * */ export interface As3AppMap { [key: string]: { [key: string]: { [key: string]: unknown; }; }; } /** * target/tenant/app/app-pieces index type * * ```ts * const example = { * target: "10.200.244.5", * tenants: [ * { * tenant: "core1_sample_01", * apps: [ * { * app: "A1", * parts: { * Pool: 1, * Service_HTTP: 1, * }, * }, * ], * }, * ], * }, * ``` * */ export interface As3AppMapTargets extends As3AppMapTenants { target: string; tenants: As3AppMapTenants; } /** * tenant/app/app-pieces index type * * ```ts * const example = { * tenant: "core1_sample_01", * apps: [ * { * app: "A1", * parts: { * Pool: 1, * Service_HTTP: 1, * }, * }, * ], * }, * ``` * */ export interface As3AppMapTenants { tenant: string; apps: { app: string; components: Record<string, unknown>; }[]; } export type As3App = { class: 'Application'; [key: string]: Record<string, unknown> | string; }; export type As3Declaration = { class: 'AS3'; $schema?: string; persist?: boolean; action?: string; declaration: AdcDeclaration; }; export interface As3Controls { class?: 'Controls'; userAgent?: string; archiveId?: number; archiveTimestamp?: string; logLevel?: string; trace?: string; traceResponse?: string; } /** * as3 adc declaration (app declaration only) * * Does not include parent AS3 data (which is for posting to as3 service) */ export type AdcDeclaration = { id?: string; class: 'ADC'; target?: Target; updateMode?: string; controls?: As3Controls; schemaVersion: string; [key: string]: As3Tenant | As3Controls | Target | string | boolean | undefined; }; export interface As3Tenant { class: 'Tenant'; [key: string]: As3App | string; } export interface Target { address?: string; hostname?: string; } /** * primary as3 example with TS type declaration */ export declare const exampleAs3Declaration: As3Declaration; /** * as3 /declare endpoint output for bigiq with multiple targets */ export declare const As3DeclareEndpoint: AdcDeclaration[]; /** * full AS3 parent class as3 declaration */ export declare const as3ExampleDec: As3Declaration; /** * declaration only part of the as3 * * Does not include the parent as3 class */ export declare const AdcExampleDec: AdcDeclaration; /** * example as3 declare response with multiple tenants * used for parse decs function */ export declare const as3Tens: AdcDeclaration; /** * example as3 declare response with multiple targets */ export declare const as3TargetTens: AdcDeclaration[]; /** * as3 task response type */ export type As3TaskType = { items: As3TaskItemType[]; }; export type As3TaskItemType = { id: string; results: As3TaskResultsType[]; declaration: AdcDeclaration | Record<string, never>; }; /** * as3 task response Results type */ export type As3TaskResultsType = { code: number; message: string; errors?: string[]; host?: string; tenant?: string; lineCount?: number; runTime?: number; declarationFullId?: string; }; /** * example as3 task response */ export declare const as3Tasks: As3TaskType;