To use this function add it to the class library file named OrchestratorPluginSQLService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: OrchestratorPluginSQLService.ts
Description: Orchestrator Function to Add an SQL Database
Public Function: SQLDatabaseAdd
publicSQLDatabaseAdd(strName:string,strType:string,strConnectionURL:string,strUusername:string,strPassword:string,strSessionMode:string):SQLDatabase{
try{
letobjSQLDatabase:SQLDatabase=newSQLDatabase();
objSQLDatabase.name=strName;
objSQLDatabase.type=strType;
objSQLDatabase.connectionURL=strConnectionURL;
objSQLDatabase.username=strUusername;
objSQLDatabase.password=strPassword;
objSQLDatabase.sessionMode=strSessionMode;
objSQLDatabase=SQLDatabaseManager.addDatabase(objSQLDatabase);
this.objLogger.info(`Database object added:${objSQLDatabase}.`);
this.objLogger.info(`SQLDatabase Create of:${strName} Successfull.`);
returnobjSQLDatabase;
}
catch (objException){
this.objLogger.info(`SQLDatabase Create of:${strName} Failed.`);
returnnull;
}
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
