Esempio n. 1
0
        public bool WithVMService()
        {
            /*
             * VM service initialization
             */
            VMService = new BVMServiceGC(ProgramID, RequiredEnvironmentVariables["GOOGLE_CLOUD_PROJECT_ID"], RequiredEnvironmentVariables["GOOGLE_CLOUD_COMPUTE_ZONE"],
                                         (string Message) =>
            {
                LoggingService.WriteLogs(BLoggingServiceMessageUtility.Single(EBLoggingServiceLogType.Critical, Message), ProgramID, "Initialization");
            });

            if (VMService == null || !VMService.HasInitializationSucceed())
            {
                LoggingService.WriteLogs(BLoggingServiceMessageUtility.Single(EBLoggingServiceLogType.Critical, "VM service initialization has failed."), ProgramID, "Initialization");
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        public bool WithVMService()
        {
            /*
             * VM service initialization
             */
            VMService = new BVMServiceAZ(
                RequiredEnvironmentVariables["AZ_CLIENT_ID"],
                RequiredEnvironmentVariables["AZ_CLIENT_SECRET"],
                RequiredEnvironmentVariables["AZ_TENANT_ID"],
                RequiredEnvironmentVariables["AZ_RESOURCE_GROUP_NAME"],
                ProgramID,
                (string Message) =>
            {
                LoggingService.WriteLogs(BLoggingServiceMessageUtility.Single(EBLoggingServiceLogType.Critical, Message), ProgramID, "Initialization");
            });

            if (VMService == null || !VMService.HasInitializationSucceed())
            {
                LoggingService.WriteLogs(BLoggingServiceMessageUtility.Single(EBLoggingServiceLogType.Critical, "VM service initialization has failed."), ProgramID, "Initialization");
                return(false);
            }

            return(true);
        }