UNPKG

@gridscale/gsclient-js

Version:
131 lines (130 loc) 5.08 kB
import { api as globalApi, ApiSettings, LogData, APIClass } from './api'; import { Server } from './Objects/Server'; import { Storage } from './Objects/Storage'; import { Network } from './Objects/Network'; import { IP } from './Objects/IP'; import { ISOImage } from './Objects/ISOImage'; import { SSHKey } from './Objects/SSHKey'; import { Template } from './Objects/Template'; import { Location } from './Objects/Location'; import { ObjectStorage } from './Objects/ObjectStorage'; import { Label } from './Objects/Label'; import { Loadbalancer } from './Objects/Loadbalancer'; import { Events } from './Objects/Events'; import { Firewall } from './Objects/Firewall'; import { PAAS } from './Objects/PAAS'; import { Deleted } from './Objects/Deleted'; import { PaasServiceTemplate } from './Objects/PaasServiceTemplate'; import { PaasService } from './Objects/PaasService'; import { PaasSecurityZone } from './Objects/PaasSecurityZone'; import { PaasServiceMetrics } from './Objects/PaasServiceMetrics'; import { MarketplaceApplication } from './Objects/MarketplaceApplication'; import { MarketplaceApplication as ServiceMarketplaceApplication } from './Objects/ServiceMarketplace/MarketplaceApplication'; import { Certificate } from './Objects/Certificate'; import { BackupLocation } from './Objects/BackupLocation'; import { MarketplacePlan } from './Objects/ServiceMarketplace/MarketplacePlan'; import { MarketplacePlanSettings } from './Objects/ServiceMarketplace/MarketplacePlanSettings'; import { MarketplaceApplicationInstance } from './Objects/ServiceMarketplace/MarketplaceApplicationInstance'; import { MarketplaceVersion } from './Objects/ServiceMarketplace/MarketplaceVersion'; import { GPU } from './Objects/GPU'; import { PaasDeprecatedClusters } from './Objects/PaasDeprecatedClusters'; import { ContractStorageBackup } from './Objects/ContractStorageBackup'; /** * generate Client Class for all Connections * test */ declare class GridscaleClient { Server: Server; Storage: Storage; Network: Network; IP: IP; ISOImage: ISOImage; SSHKey: SSHKey; Template: Template; Location: Location; ObjectStorage: ObjectStorage; Label: Label; Loadbalancer: Loadbalancer; Events: Events; Firewall: Firewall; Certificate: Certificate; BackupLocation: BackupLocation; GPU: GPU; ContractStorageBackup: ContractStorageBackup; /** * @deprecated */ PAAS: PAAS; PaasDeprecatedClusters: PaasDeprecatedClusters; PaasService: PaasService; PaasServiceTemplate: PaasServiceTemplate; PaasSecurityZone: PaasSecurityZone; Deleted: Deleted; MarketplaceApplication: MarketplaceApplication; ServiceMarketplaceApplication: ServiceMarketplaceApplication; ServiceMarketplaceApplicationInstance: MarketplaceApplicationInstance; ServiceMarketplacePlan: MarketplacePlan; ServiceMarketplacePlanSettings: MarketplacePlanSettings; ServiceMarketplaceVersion: MarketplaceVersion; watchRequest: (_requestid: string) => ReturnType<typeof globalApi.watchRequest>; VERSION: string; private myapi; /** * Init Client with Default Values * * * @param _token Security Token * @param _userId UUID of User * @param _options * @param _isolated (if true, use isolated api which can be used alongside other instances. Default behavior is shared settings/tokens between the client instances) */ constructor(_token: string, _userId: string, _options?: ApiSettings, _isolated?: boolean); /** * Set the identifier of the client (used in X-Api-Client Header) * @param _client */ setApiClient(_client: string): void; /** * Set a new Token and User-UUID * @param _token * @param _userId */ setToken(_token: string, _userUUID: string): void; /** * Set the HTTP endpoint of the API * @param _endpoint */ setEndpoint(_endpoint: string): void; /** * Inject a custom fetch method, otherwise the API will decide if to use the browser's fetch method or a polyfill * @param _fetch */ setFetch(_fetch: Function): void; /** * set addiotional headers */ setAdditionalHeaders(additionalHeaders: Record<string, string>): void; /** * Add an additional logger callback, called whenever an error is happening * @param _callback */ addLogger(_callback: (logData: LogData) => void): void; /** * Calls the Validate Token Endpoint of the API * @returns HTTP Promise */ validateToken(): Promise<import("./api").ApiResult<any>>; /** * Get the paas service metrics API which is a special one as the service-uuid is required early in the URL * @param _serviceUUID */ PaasServiceMetrics(_serviceUUID: string): PaasServiceMetrics; /** * Stringifies all non string-values of a HTTP Response (e.g. headers) * @param object * @deprecated */ stringifyResponseRequest<T>(object: Object): T; get api(): APIClass; } export { GridscaleClient as Client };