Skip to content

Latest commit

 

History

History
1317 lines (739 loc) · 34.6 KB

File metadata and controls

1317 lines (739 loc) · 34.6 KB

@onzag/itemize / Modules / server/services/openstack / OpenstackService

Class: OpenstackService

server/services/openstack.OpenstackService

Provides the pkgloud client container

Param

the client to use

Param

the container name

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new OpenstackService(config, registry, configs): OpenstackService

Parameters

Name Type
config ISensitiveConfigOpenstackContainerType
registry RegistryService
configs Object
configs.config IConfigRawJSONDataType
configs.dbConfig IDBConfigRawJSONDataType
configs.redisConfig IRedisConfigRawJSONDataType
configs.sensitiveConfig ISensitiveConfigRawJSONDataType

Returns

OpenstackService

Inherited from

default.constructor

Defined in

server/services/index.ts:58

Properties

appConfig

appConfig: IConfigRawJSONDataType

Inherited from

default.appConfig

Defined in

server/services/index.ts:35


appDbConfig

appDbConfig: IDBConfigRawJSONDataType

Inherited from

default.appDbConfig

Defined in

server/services/index.ts:37


appRedisConfig

appRedisConfig: IRedisConfigRawJSONDataType

Inherited from

default.appRedisConfig

Defined in

server/services/index.ts:38


appSensitiveConfig

appSensitiveConfig: ISensitiveConfigRawJSONDataType

Inherited from

default.appSensitiveConfig

Defined in

server/services/index.ts:36


config

config: ISensitiveConfigOpenstackContainerType

Inherited from

default.config

Defined in

server/services/index.ts:33


globalCustomServices

globalCustomServices: Object

Index signature

▪ [name: string]: ServiceProvider<any>

Inherited from

default.globalCustomServices

Defined in

server/services/index.ts:48


globalDatabaseConnection

globalDatabaseConnection: DatabaseConnection

Inherited from

default.globalDatabaseConnection

Defined in

server/services/index.ts:40


globalInstance

globalInstance: boolean = false

Inherited from

default.globalInstance

Defined in

server/services/index.ts:55


globalMailProvider

globalMailProvider: default<any>

Inherited from

default.globalMailProvider

Defined in

server/services/index.ts:46


globalPhoneProvider

globalPhoneProvider: default<any>

Inherited from

default.globalPhoneProvider

Defined in

server/services/index.ts:47


globalRawDB

globalRawDB: ItemizeRawDB

Inherited from

default.globalRawDB

Defined in

server/services/index.ts:44


globalRedis

globalRedis: ItemizeRedisClient

Inherited from

default.globalRedis

Defined in

server/services/index.ts:43


globalRedisPub

globalRedisPub: ItemizeRedisClient

Inherited from

default.globalRedisPub

Defined in

server/services/index.ts:41


globalRedisSub

globalRedisSub: ItemizeRedisClient

Inherited from

default.globalRedisSub

Defined in

server/services/index.ts:42


globalRoot

globalRoot: default

Inherited from

default.globalRoot

Defined in

server/services/index.ts:45


id

id: string

Inherited from

default.id

Defined in

server/services/base/StorageProvider.ts:16


instanceName

instanceName: string

Inherited from

default.instanceName

Defined in

server/services/index.ts:54


localAppData

localAppData: IAppDataType

Inherited from

default.localAppData

Defined in

server/services/index.ts:52


localInstance

localInstance: boolean = false

Inherited from

default.localInstance

Defined in

server/services/index.ts:56


prefix

prefix: string

Inherited from

default.prefix

Defined in

server/services/base/StorageProvider.ts:15


registry

registry: RegistryService

Inherited from

default.registry

Defined in

server/services/index.ts:34

Methods

copyFolder

copyFolder(remotePath, targetPath, target): Promise<void>

Should copy a folder from one container to another target container, note that during calls the target container may be itself, optimize if necessary for such calls

NECESSARY FOR CUSTOM SERVER COPY CALLS TO FUNCTION

Parameters

Name Type
remotePath string
targetPath string
target default<any>

Returns

Promise<void>

Inherited from

default.copyFolder

Defined in

server/services/base/StorageProvider.ts:112


download

download(at): ReadStream

This function is necessary for downloading a file

Parameters

Name Type Description
at string the remote file to download

Returns

ReadStream

Inherited from

default.download

Defined in

server/services/base/StorageProvider.ts:56


dumpFolder

dumpFolder(remotePath, localPath): Promise<void>

This function is executed once an entire folder is requested to be downloaded locally in the given local path

NECESSARY FOR DUMPING TO FUNCTION

Parameters

Name Type Description
remotePath string the remote path
localPath string the local path

Returns

Promise<void>

Inherited from

default.dumpFolder

Defined in

server/services/base/StorageProvider.ts:97


execute

execute(): void

Performs the execution of the service, basically it will do the run function and then re-run as specified

Returns

void

Inherited from

default.execute

Defined in

server/services/index.ts:170


exists

exists(at): Promise<boolean>

It's executed to verify whether a given remote resource exists

NECESSARY FOR CORE ITEMIZE TO FUNCTION

Parameters

Name Type Description
at string the resource to check for

Returns

Promise<boolean>

Inherited from

default.exists

Defined in

server/services/base/StorageProvider.ts:82


expressRouter

expressRouter(options?): Router

Parameters

Name Type
options? RouterOptions

Returns

Router

Inherited from

default.expressRouter

Defined in

server/services/index.ts:116


getId

getId(): string

Returns

string

Inherited from

default.getId

Defined in

server/services/base/StorageProvider.ts:30


getInstanceName

getInstanceName(): string

Returns

string

Inherited from

default.getInstanceName

Defined in

server/services/index.ts:80


getPrefix

getPrefix(): string

Returns

string

Inherited from

default.getPrefix

Defined in

server/services/base/StorageProvider.ts:26


getRouter

getRouter(appData): Router | Promise<Router>

Provides a router endpoint, the router endpoint will exist directly under the rest services this enables to create webhooks and other subservices that are attached to this service

If the service provider if executed on a global environment the endpoint does not get created, this means that in the global manager this won't be executed, or anything that is meant for the global manager

The router gets attached to /rest/service

Parameters

Name Type
appData IAppDataType

Returns

Router | Promise<Router>

Inherited from

default.getRouter

Defined in

server/services/index.ts:266


getRunCycleTime

getRunCycleTime(): number

Determines whether the run function should run over again

Returns

number

Inherited from

default.getRunCycleTime

Defined in

server/services/index.ts:239


getTriggerRegistry

getTriggerRegistry(): ITriggerRegistry | Promise<ITriggerRegistry>

Allows to setup trigger registries via the service so that they trigger just as normal trigger will do

Returns

ITriggerRegistry | Promise<ITriggerRegistry>

Inherited from

default.getTriggerRegistry

Defined in

server/services/index.ts:293


initialize

initialize(): Promise<void>

This function is executed during the initialization of the service

If your service is a global service you will have access to the global resources while this function executes

Returns

Promise<void>

Overrides

default.initialize

Defined in

server/services/openstack.ts:58


isInstanceGlobal

isInstanceGlobal(): boolean

Returns

boolean

Inherited from

default.isInstanceGlobal

Defined in

server/services/index.ts:84


isInstanceLocal

isInstanceLocal(): boolean

Returns

boolean

Inherited from

default.isInstanceLocal

Defined in

server/services/index.ts:88


logDebug

logDebug<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logDebug

Defined in

server/services/index.ts:96


logError

logError<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingErrorStructure<T>

Returns

void

Inherited from

default.logError

Defined in

server/services/index.ts:100


logInfo

logInfo<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logInfo

Defined in

server/services/index.ts:92


read

read(at): Promise<string>

It's executed to read files

NECESSARY FOR SEO TO FUNCTION

Parameters

Name Type Description
at string the file to read

Returns

Promise<string>

Inherited from

default.read

Defined in

server/services/base/StorageProvider.ts:124


removeFolder

removeFolder(at): Promise<void>

This function is executed once a folder removal is requested

NECESSARY FOR CORE ITEMIZE TO FUNCTION

Parameters

Name Type Description
at string the remote folder to remove

Returns

Promise<void>

Inherited from

default.removeFolder

Defined in

server/services/base/StorageProvider.ts:69


run

run(): void | Promise<void>

Executes some code

Returns

void | Promise<void>

Inherited from

default.run

Defined in

server/services/index.ts:247


setId

setId(id): void

Parameters

Name Type
id string

Returns

void

Inherited from

default.setId

Defined in

server/services/base/StorageProvider.ts:22


setInstanceName

setInstanceName(n): void

Parameters

Name Type
n string

Returns

void

Inherited from

default.setInstanceName

Defined in

server/services/index.ts:76


setPrefix

setPrefix(prefix): void

Parameters

Name Type
prefix string

Returns

void

Inherited from

default.setPrefix

Defined in

server/services/base/StorageProvider.ts:18


setupGlobalResources

setupGlobalResources(globalDatabaseConnection, globalClient, globalPub, globalSub, globalMailProvider, globalPhoneProvider, globalCustomServices, root): void

Parameters

Name Type
globalDatabaseConnection DatabaseConnection
globalClient ItemizeRedisClient
globalPub ItemizeRedisClient
globalSub ItemizeRedisClient
globalMailProvider default<any>
globalPhoneProvider default<any>
globalCustomServices Object
root default

Returns

void

Inherited from

default.setupGlobalResources

Defined in

server/services/index.ts:124


setupLocalResources

setupLocalResources(appData): void

Parameters

Name Type
appData IAppDataType

Returns

void

Inherited from

default.setupLocalResources

Defined in

server/services/index.ts:148


upload

upload(at, readStream, mustBeVerified): Promise<void>

This function is executed when the service uploading a read stream

NECESSARY FOR CORE ITEMIZE TO FUNCTION

Parameters

Name Type Description
at string the remote file to use
readStream ReadStream the stream to read from
mustBeVerified boolean a boolean that specifies whether the resouce must be verified and return a 200 when requested

Returns

Promise<void>

Overrides

default.upload

Defined in

server/services/openstack.ts:115


verifyResourceIsReady

verifyResourceIsReady(url, done): void

Verifies whether a given uploaded resource is actually ready, as containers, might have been done uploading but are not ready to serve the file itself

Parameters

Name Type Description
url URL the url to verify
done () => void the callback once it's done

Returns

void

Defined in

server/services/openstack.ts:80


expressRouter

expressRouter(options?): Router

Parameters

Name Type
options? RouterOptions

Returns

Router

Inherited from

default.expressRouter

Defined in

server/services/index.ts:120


getRouter

getRouter(appData): Router | Promise<Router>

Provides a router endpoint, but this method is static, which means it only gets added once

If the service provider if executed on a global environment the endpoint does not get created, this means that in the global manager this won't be executed, or anything that is meant for the global manager

the router gets attached to /rest/service

Parameters

Name Type
appData IAppDataType

Returns

Router | Promise<Router>

Inherited from

default.getRouter

Defined in

server/services/index.ts:283


getTriggerRegistry

getTriggerRegistry(): ITriggerRegistry | Promise<ITriggerRegistry>

Allows to setup trigger registries via the service so that they trigger just as normal trigger will do

This gets attached if a class is used rather than per instance

Returns

ITriggerRegistry | Promise<ITriggerRegistry>

Inherited from

default.getTriggerRegistry

Defined in

server/services/index.ts:305


getType

getType(): ServiceProviderType

Specifies whether the current service is a global service if true global services will only execute initialize and a router will not be extracted from them

it will instead have access to the global resources

Returns

ServiceProviderType

Overrides

default.getType

Defined in

server/services/openstack.ts:54


logDebug

logDebug<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logDebug

Defined in

server/services/index.ts:108


logError

logError<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingErrorStructure<T>

Returns

void

Inherited from

default.logError

Defined in

server/services/index.ts:112


logInfo

logInfo<T>(data): void

Type parameters

Name
T

Parameters

Name Type
data IItemizeLoggingStructure<T>

Returns

void

Inherited from

default.logInfo

Defined in

server/services/index.ts:104