public override object GetParametersInstance()
    {
        WorkflowParameters wfp = new WorkflowParameters();

        wfp.Oracle            = new OracleType();
        wfp.Oracle.User       = "******";
        wfp.Oracle.Password   = "******";
        wfp.Oracle.DataSource = @"(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = XE)))";

        wfp.SQLServer = new SQLServerType();
        wfp.SQLServer.ConnectionTimeout  = 30;
        wfp.SQLServer.Database           = "SANDBOX";
        wfp.SQLServer.DataSource         = @"Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;";
        wfp.SQLServer.IntegratedSecurity = true;
        wfp.SQLServer.Password           = "******";
        wfp.SQLServer.TrustedConnection  = true;
        wfp.SQLServer.User = "******";

        wfp.Query           = "SELECT * from USERS where NAME = @userName";
        wfp.StoredProcedure = "dbo.uspGetUsers";

        wfp.Parameters = new List <ParameterType>();
        ParameterType param = new ParameterType();

        param.Name      = "userName";
        param.Value     = "Bill Gates";
        param.Direction = System.Data.ParameterDirection.Input;
        param.Type      = SqlParamterTypes.String;
        wfp.Parameters.Add(param);

        String xml = wfp.Serialize(false);

        xml = xml.Substring(xml.IndexOf("<"));
        return(xml);
    }
Beispiel #2
0
    public override object GetParametersInstance()
    {
        WorkflowParameters wfp = new WorkflowParameters();

        wfp.Files = new List <FileType>();
        FileType file = new FileType();

        file.Type          = ConfigType.KeyValue;
        file.RootDirectory = @"C:\Source";
        file.Source        = @"MyApp\Development\java.properties.Development";
        file.Destination   = @"MyApp\Development\java.properties";
        file.SettingsFile  = new SettingFileType();
        file.SettingsFile.CreateIfNotFoundStr   = "true";
        file.SettingsFile.HasEncryptedValuesStr = "false";
        file.SettingsFile.Value = @"MyApp\Development\Development.settings.csv";
        file.CopySourceStr      = "true";

        wfp.Files.Add(file);

        String xml = wfp.Serialize(false);

        xml = xml.Substring(xml.IndexOf("<"));
        return(xml);
    }
Beispiel #3
0
    public override object GetParametersInstance()
    {
        WorkflowParameters wfp = new WorkflowParameters
        {
            DatabaseType                   = DatabaseType.Oracle,
            ContinueOnError                = true,
            ShowSqlInOutput                = true,
            SetQuotedIdentifier            = true,
            IsTraditional                  = true,
            MigrationType                  = MigrationType.Prod,
            IsControlledMigration          = true,
            SuppressSqlServerImpersonation = true,
            NLS_LANG = "American_America.UTF8",

            AuditProcedures = new AuditProcedure()
        };

        wfp.AuditProcedures.PostRun = @"value";
        wfp.AuditProcedures.PreRun  = @"value";

        wfp.Environment     = "Development";
        wfp.ApplicationName = "MyApplication";

        wfp.ScriptFolder = new ScriptFolder
        {
            ContainerName = "Container",
            Name          = "Name",
            SourcePath    = @"C:\Scripts\",
            Type          = ScriptFolderType.DiskStatic,
            WorkRoot      = "WorkRoot"
        };

        wfp.ScriptCacheFolder     = @"C:\Scripts\CacheFolder";
        wfp.ScriptStagedFolder    = @"C:\Scripts\Staged";
        wfp.ScriptProcessedFolder = @"C:\Scripts\Processed";
        wfp.SchemaFolder          = @"C:\Scripts\Schema";

        wfp.DatabaseInstances = new DatabaseInstances
        {
            DatabaseInstance = new List <DatabaseInstance>()
        };
        DatabaseInstance instance = new DatabaseInstance
        {
            Name     = "MyDatabaseInstnace",
            Database = new List <Database>()
        };
        Database database = new Database
        {
            Name   = "MyDatabaseName",
            Schema = new List <string>()
        };

        database.Schema.Add("MyDatabaseSchema1");
        database.Schema.Add("MyDatabaseSchema2");
        instance.Database.Add(database);

        instance.PortNumber = "1521";
        wfp.DatabaseInstances.DatabaseInstance.Add(instance);

        wfp.RequestNumber            = "12345678";
        wfp.PackageAdapterInstanceId = "87654321";

        string xml = wfp.Serialize(indented: true);

        xml = xml.Replace("\r\n", "\n");   //this is only to make the XML pretty, like me
        return(xml);
    }
Beispiel #4
0
    public override object GetParametersInstance()
    {
        WorkflowParameters wfp = new WorkflowParameters();

        wfp.Servers = new List <string>();
        wfp.Servers.Add("localhost");
        wfp.Servers.Add("server001");

        wfp.RunAs          = new ImpersonationType();
        wfp.RunAs.User     = "******";
        wfp.RunAs.Password = "******";
        wfp.RunAs.Protocol = RunAsProtocolType.WinRm;

        wfp.RunUsing                = RunUsingProtocolType.ProcessStart;
        wfp.WorkingDir              = @"C:\Temp";
        wfp.Timeout                 = new TimeoutType();
        wfp.Timeout.Value           = 60000;
        wfp.Timeout.ActionOnTimeout = "Error";
        wfp.Timeout.KillProcess     = "true";

        wfp.ValidExitCodes = new List <ExitCodeType>();
        ExitCodeType code = new ExitCodeType();

        code.Operator = Operators.NotEqualTo;
        code.value    = "0";

        wfp.Ant           = new AntCommandType();
        wfp.Ant.Home      = @"C:\ant";
        wfp.Ant.BuildFile = @"C:\Temp\build.xml";
        wfp.Ant.Target    = "MyAntTarget";

        wfp.Powershell                    = new PowershellCommandType();
        wfp.Powershell.ArgType            = new ArgTypeType();
        wfp.Powershell.ArgType.PrefixWith = "-";
        wfp.Powershell.ArgType.UseQuotes  = "true";
        wfp.Powershell.ArgType.JoinWith   = ", ";
        wfp.Powershell.Command            = "hostname";
        wfp.Powershell.ExecutionPolicy    = ExecutionPolicyType.Bypass;
        wfp.Powershell.Script             = @"C:\Script\MyScript.ps1";

        wfp.Plink         = new PlinkCommandType();
        wfp.Plink.ArgType = new ArgTypeType();
        wfp.Plink.ArgType.SkipBlankValues = "true";
        wfp.Plink.ArgType.JoinWith        = " ";
        wfp.Plink.ArgType.PrefixWith      = "";
        wfp.Plink.ArgType.UseQuotes       = "false";
        wfp.Plink.Command              = "ls";
        wfp.Plink.CommandFile          = new CommandFileType();
        wfp.Plink.CommandFile.Name     = @"MyCommandFile.sh";
        wfp.Plink.CommandFile.CodePage = "";
        wfp.Plink.PrivateKey           = "MyKey.ppk";
        wfp.Plink.RunInteractive       = true;
        wfp.Plink.Users = new List <UserType>();
        UserType user = new UserType();

        user.Name     = "user@server";
        user.Password = "******";
        wfp.Plink.Users.Add(user);

        wfp.Pscp                    = new PscpCommandType();
        wfp.Pscp.Destination        = @"\Users\user\temp";
        wfp.Pscp.KeepFileAttributes = "true";
        wfp.Pscp.PrivateKey         = "MyKey.ppk";
        wfp.Pscp.Sources            = new List <string>();
        wfp.Pscp.Sources.Add("server001");
        wfp.Pscp.Users = new List <UserType>();
        UserType user2 = new UserType();

        user2.Name     = "user@server";
        user2.Password = "******";
        wfp.Pscp.Users.Add(user2);

        String xml = wfp.Serialize(false);

        xml = xml.Substring(xml.IndexOf("<"));
        return(xml);
    }
Beispiel #5
0
    public override object GetParametersInstance()
    {
        WorkflowParameters wfp = new WorkflowParameters
        {
            DeploymentRoot  = @"C:\Temp",
            SourceDirectory = @"Source",
            NextEnvironmentSourceDirectory   = @"NextSource",
            TruncateNextEnvironmentDirectory = true,
            TargetRemoteDestination          = @"\\server\share\dir1\dir2\target",
            BackupRemoteDestination          = @"BackupRemote",

            TargetServerDestination = @"C:\Temp\Target",
            BackupServerDestination = @"BackupServer",
            TruncateTargetDirectory = false,

            Servers = new List <string>()
        };

        wfp.Servers.Add("localhost");

        wfp.DeleteManifest = new DeleteManifestFile
        {
            FileName = @"C:\Temp\DeleteFileManifest\DeleteMe.txt",
            TreatExceptionsAsWarnings = true
        };

        wfp.Services = new List <Service>();
        Service svc = new Service
        {
            Name = @"MyServiceName",
            StopTimeoutToTerminate = 30000,
            StartTimeoutToMonitor  = 60000,
            StartModeOnStart       = Synapse.Handlers.Legacy.WinCore.ServiceStartMode.Automatic,
            StartModeOnStop        = Synapse.Handlers.Legacy.WinCore.ServiceStartMode.Disabled,
            StartService           = true,
            Path        = @"C:\Temp\MyService.exe",
            UserName    = @"MyUserName",
            Password    = @"MyPassword",
            Reprovision = true,
            Parameters  = "-p1 My -p2 Service -p3 Parameters"
        };

        wfp.Services.Add(svc);

        wfp.AppPools = new List <AppPool>();
        AppPool pool = new AppPool
        {
            Name      = @"MyAppPool",
            StartPool = true
        };

        wfp.AppPools.Add(pool);

        wfp.ConfigFiles = new List <ConfigFile>();
        ConfigFile config = new ConfigFile
        {
            Name             = @"MyConfigFile.txt",
            TransformFile    = @"MyTransformFile.xml",
            TransformInPlace = false
        };

        wfp.ConfigFiles.Add(config);

        string xml = wfp.Serialize(indented: true);

        xml = xml.Replace("\r\n", "\n");   //this is only to make the XML pretty, like me
        return(xml);
    }