Beispiel #1
0
        private static void MainDcs(string[] args)
        {
            const string ak        = "{your ak string}";
            const string sk        = "{your sk string}";
            const string endpoint  = "{your endpoint}";
            const string projectId = "{your project id}";

            var config = HttpConfig.GetDefaultConfig();

            config.IgnoreSslVerification = true;
            var auth      = new BasicCredentials(ak, sk, projectId);
            var dcsClient = DcsClient.NewBuilder()
                            .WithCredential(auth)
                            .WithEndPoint(endpoint)
                            .WithHttpConfig(config).Build();

            // lifecycle hook test
            // CreateDcsInstance(dcsClient);
            // listFlavors(dcsClient);
            // stopMigrationTask(dcsClient);
            // createMigrationTask(dcsClient);
            // stopMigrationTask(dcsClient);
            // deleteMigrationTask(dcsClient);
            // createReplication(dcsClient);
            // deleteReplication(dcsClient);
            listMigrationTask(dcsClient);
        }