UNPKG

@rockcarver/frodo-lib

Version:

A library to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.

195 lines 8.1 kB
import { ServerPropertiesSkeleton, ServerSkeleton } from '../../api/classic/ServerApi'; import { State } from '../../shared/State'; import { ExportMetaData } from '../OpsTypes'; export type Server = { /** * Create an empty server export template * @returns {ServerExportInterface} an empty server export template */ createServerExportTemplate(): ServerExportInterface; /** * Read server by id * @param {string} serverId Server id * @returns {Promise<ServerSkeleton>} a promise that resolves to a server object */ readServer(serverId: string): Promise<ServerSkeleton>; /** * Read server by url * @param {string} serverUrl Server url * @returns {Promise<ServerSkeleton>} a promise that resolves to a server object */ readServerByUrl(serverUrl: string): Promise<ServerSkeleton>; /** * Read all servers. * @returns {Promise<ServerSkeleton[]>} a promise that resolves to an array of server objects */ readServers(): Promise<ServerSkeleton[]>; /** * Export a single server by id. The response can be saved to file as is. * @param {string} serverId Server id * @param {ServerExportOptions} options Server export options * @returns {Promise<ServerExportInterface>} Promise resolving to a ServerExportInterface object. */ exportServer(serverId: string, options: ServerExportOptions): Promise<ServerExportInterface>; /** * Export a single server by url. The response can be saved to file as is. * @param {string} serverUrl Server url * @param {ServerExportOptions} options Server export options * @returns {Promise<ServerExportInterface>} Promise resolving to a ServerExportInterface object. */ exportServerByUrl(serverUrl: string, options: ServerExportOptions): Promise<ServerExportInterface>; /** * Export all servers. The response can be saved to file as is. * @param {ServerExportOptions} options Server export options * @returns {Promise<ServerExportInterface>} Promise resolving to a ServerExportInterface object. */ exportServers(options: ServerExportOptions): Promise<ServerExportInterface>; /** * Creates a server * @param {ServerSkeleton} serverData server object * @returns {Promise<ServerSkeleton>} a promise that resolves to a server object */ createServer(serverData: ServerSkeleton): Promise<ServerSkeleton>; /** * Imports the first server from the importData * @param importData server import data * @param options server import options */ importFirstServer(importData: ServerExportInterface, options: ServerImportOptions): Promise<ServerExportInterface>; /** * Imports servers along with their properties * @param {ServerExportInterface} importData server import data * @param {ServerImportOptions} options server import options * @param {string} serverId Optional server id. If supplied, only the server (and its properties) of that id is imported. Takes priority over serverUrl if both are provided. * @param {string} serverUrl Optional server url. If supplied, only the server of that url is imported. * @returns {Promise<ServerExportInterface>} a promise that resolves to a server export object */ importServers(importData: ServerExportInterface, options: ServerImportOptions, serverId?: string, serverUrl?: string): Promise<ServerExportInterface>; }; declare const _default: (state: State) => Server; export default _default; /** * Server export options */ export interface ServerExportOptions { /** * True to export the default server properties, false otherwise */ includeDefault: boolean; } /** * Server import options */ export interface ServerImportOptions { /** * True to import the default server properties, false otherwise */ includeDefault: boolean; } export type ServerExportSkeleton = ServerSkeleton & { properties: ServerPropertiesSkeleton; }; export interface ServerExportInterface { meta?: ExportMetaData; server: Record<string, ServerExportSkeleton>; defaultProperties: ServerPropertiesSkeleton; } /** * Create an empty server export template * @returns {ServerExportInterface} an empty server export template */ export declare function createServerExportTemplate({ state, }: { state: State; }): ServerExportInterface; /** * Read server by id * @param {string} serverId Server id * @returns {Promise<ServerSkeleton>} a promise that resolves to a server object */ export declare function readServer({ serverId, state, }: { serverId: string; state: State; }): Promise<ServerSkeleton>; /** * Read server by url * @param {string} serverUrl Server url * @returns {Promise<ServerSkeleton>} a promise that resolves to a server object */ export declare function readServerByUrl({ serverUrl, state, }: { serverUrl: string; state: State; }): Promise<ServerSkeleton>; /** * Read all servers. * @returns {Promise<ServerSkeleton[]>} a promise that resolves to an array of server objects */ export declare function readServers({ state, }: { state: State; }): Promise<ServerSkeleton[]>; /** * Export a single server by id. The response can be saved to file as is. * @param {string} serverId Server id * @param {ServerExportOptions} options Server export options * @returns {Promise<ServerExportInterface>} Promise resolving to a ServerExportInterface object. */ export declare function exportServer({ serverId, options, state, }: { serverId: string; options: ServerExportOptions; state: State; }): Promise<ServerExportInterface>; /** * Export a single server by url. The response can be saved to file as is. * @param {string} serverUrl Server url * @param {ServerExportOptions} options Server export options * @returns {Promise<ServerExportInterface>} Promise resolving to a ServerExportInterface object. */ export declare function exportServerByUrl({ serverUrl, options, state, }: { serverUrl: string; options: ServerExportOptions; state: State; }): Promise<ServerExportInterface>; /** * Export all servers. The response can be saved to file as is. * @param {ServerExportOptions} options Server export options * @returns {Promise<ServerExportInterface>} Promise resolving to a ServerExportInterface object. */ export declare function exportServers({ options, state, }: { options: ServerExportOptions; state: State; }): Promise<ServerExportInterface>; /** * Creates a server * @param {ServerSkeleton} serverData server object * @returns {Promise<ServerSkeleton>} a promise that resolves to a server object */ export declare function createServer({ serverData, state, }: { serverData: ServerSkeleton; state: any; }): Promise<ServerSkeleton>; /** * Import first server * @param {ServerExportInterface} importData import data * @param {ServerImportOptions} options import options * @returns {Promise<ServerExportInterface>} a promise that resolves to a server export object */ export declare function importFirstServer({ importData, options, state, }: { importData: ServerExportInterface; options?: ServerImportOptions; state: State; }): Promise<ServerExportInterface>; /** * Imports servers along with their properties * @param {string} serverId Optional server id. If supplied, only the server (and its properties) of that id is imported. Takes priority over serverUrl if both are provided. * @param {string} serverUrl Optional server url. If supplied, only the server of that url is imported. * @param {ServerExportInterface} importData server import data * @param {ServerImportOptions} options server import options * @returns {Promise<ServerExportInterface>} a promise that resolves to a server export object */ export declare function importServers({ serverId, serverUrl, importData, options, state, }: { serverId?: string; serverUrl?: string; importData: ServerExportInterface; options: ServerImportOptions; state: any; }): Promise<ServerExportInterface>; //# sourceMappingURL=ServerOps.d.ts.map