コード例 #1
0
        private static void UnassignBlueprint(string assignmentName, IConfigReader config)
        {
            var mgr    = new BlueprintMgr(config);
            var result = mgr.Unassign(assignmentName).Result;

            Console.WriteLine(result);
        }
コード例 #2
0
        private static void DeleteBlueprint(string blueprintName, IConfigReader config)
        {
            var mgr    = new BlueprintMgr(config);
            var result = mgr.Delete(blueprintName).Result;

            Console.WriteLine(result);
        }
コード例 #3
0
        private static void PublishBlueprint(string blueprintName, string version, IConfigReader config)
        {
            var mgr    = new BlueprintMgr(config);
            var result = mgr.Publish(blueprintName, version).Result;

            Console.WriteLine(result);
        }
コード例 #4
0
        private static void GetBlueprintArtifact(string blueprintName, string artifactName, IConfigReader config)
        {
            var mgr    = new BlueprintMgr(config);
            var result = mgr.GetArtifact(blueprintName, artifactName).Result;

            Console.WriteLine(result);
        }
コード例 #5
0
        private static void AssignBlueprint(string blueprintName, string assignmentName, IConfigReader config)
        {
            var mgr      = new BlueprintMgr(config);
            var filePath = Path.Combine(config["AssignmentsDir"], blueprintName, $"{blueprintName}.json");
            var data     = File.ReadAllText(filePath);
            var result   = mgr.Assign(blueprintName, assignmentName, data).Result;

            Console.WriteLine(result);
        }
コード例 #6
0
        private static void AddBlueprintArtifact(string blueprintName, string artifactName, IConfigReader config)
        {
            var mgr      = new BlueprintMgr(config);
            var filePath = Path.Combine(config["BlueprintsDir"], blueprintName, $"{artifactName}.json");
            var data     = File.ReadAllText(filePath);
            var result   = mgr.AddArtifact(blueprintName, artifactName, data).Result;

            Console.WriteLine(result);
        }
コード例 #7
0
        private static void CreateBlueprint(string blueprintName, IConfigReader config)
        {
            var mgr      = new BlueprintMgr(config);
            var filePath = Path.Combine(config["BlueprintsDir"], blueprintName, $"{blueprintName}.json");
            var data     = File.ReadAllText(filePath);
            var result   = mgr.CreateBlueprint(blueprintName, data).Result;

            Console.WriteLine(result);
            var blueprintDir = Path.Combine(config["BlueprintsDir"], blueprintName);
            var files        = Directory.GetFiles(blueprintDir, "*.json");

            foreach (var artifactFilePath in files)
            {
                var artifactName = Path.GetFileNameWithoutExtension(artifactFilePath);
                if (!artifactName.Equals(blueprintName, StringComparison.InvariantCultureIgnoreCase))
                {
                    var artifactFileName = Path.GetFileName(artifactFilePath);
                    data   = File.ReadAllText(artifactFilePath);
                    result = mgr.AddArtifact(blueprintName, artifactName, data).Result;
                    Console.WriteLine(result);
                }
            }
        }