示例#1
0
        public static async ValueTask <PipelineResource> CreateResource(PipelineClient client, TestRecording recording)
        {
            string pipelineName = recording.GenerateId("Pipeline", 16);
            PipelineCreateOrUpdatePipelineOperation createOperation = await client.StartCreateOrUpdatePipelineAsync(pipelineName, new PipelineResource());

            return(await createOperation.WaitForCompletionAsync());
        }
        public async Task CreateAndRunPipeline()
        {
            const string PipelineName = "Test-Pipeline";
            const string JobName      = "SparkJobName";
            const string ActivityName = "ActivityName";
            string       workspaceUrl = TestEnvironment.WorkspaceUrl;

            var pipelineClient = new PipelineClient(endpoint: new Uri(workspaceUrl), credential: new DefaultAzureCredential());

            var sparkJob         = new SynapseSparkJobReference(SparkJobReferenceType.SparkJobDefinitionReference, JobName);
            var activity         = new SynapseSparkJobDefinitionActivity(ActivityName, sparkJob);
            var pipelineResource = new PipelineResource();

            pipelineResource.Activities.Add(activity);

            Console.WriteLine("Create pipeline if not already exists.");
            await pipelineClient.StartCreateOrUpdatePipelineAsync(PipelineName, pipelineResource);

            Console.WriteLine("Pipeline created");

            Console.WriteLine("Running pipeline.");
            CreateRunResponse runOperation = await pipelineClient.CreatePipelineRunAsync(PipelineName);

            Console.WriteLine("Run started. ID: {0}", runOperation.RunId);
        }
        public async Task TestCreatePipeline()
        {
            string pipelineName = Recording.GenerateName("Pipeline");
            PipelineCreateOrUpdatePipelineOperation operation = await PipelineClient.StartCreateOrUpdatePipelineAsync(pipelineName, new PipelineResource());

            PipelineResource pipeline = await operation.WaitForCompletionAsync();

            Assert.AreEqual(pipelineName, pipeline.Name);
        }
示例#4
0
        public async Task TestCreatePipeline()
        {
            var operation = await PipelineClient.StartCreateOrUpdatePipelineAsync("MyPipeline", new PipelineResource());

            while (!operation.HasValue)
            {
                operation.UpdateStatus();
            }
            Assert.AreEqual("MyPipeline", operation.Value.Name);
        }
        public async Task TestDeletePipeline()
        {
            string pipelineName = Recording.GenerateName("Pipeline");

            PipelineCreateOrUpdatePipelineOperation createOperation = await PipelineClient.StartCreateOrUpdatePipelineAsync(pipelineName, new PipelineResource());

            await createOperation.WaitForCompletionAsync();

            PipelineDeletePipelineOperation deleteOperation = await PipelineClient.StartDeletePipelineAsync(pipelineName);

            Response response = await deleteOperation.WaitForCompletionAsync();

            Assert.AreEqual(200, response.Status);
        }
示例#6
0
        private async Task CreatePipeline(string pipelineName)
        {
            const string JobName      = "SparkJobName";
            const string ActivityName = "ActivityName";

            string endpoint = TestEnvironment.EndpointUrl;

            var pipelineClient = new PipelineClient(endpoint: new Uri(endpoint), credential: new DefaultAzureCredential());

            var sparkJob         = new SynapseSparkJobReference(SparkJobReferenceType.SparkJobDefinitionReference, JobName);
            var activity         = new SynapseSparkJobDefinitionActivity(ActivityName, sparkJob);
            var pipelineResource = new PipelineResource();

            pipelineResource.Activities.Add(activity);

            Console.WriteLine("Create pipeline if not already exists.");
            PipelineCreateOrUpdatePipelineOperation operation = await pipelineClient.StartCreateOrUpdatePipelineAsync(pipelineName, pipelineResource);

            await operation.WaitForCompletionAsync();

            Console.WriteLine("Pipeline created");
        }