コード例 #1
0
        public async Task TestDeleteSparkJob()
        {
            TriggerClient client = CreateClient();

            TriggerResource resource = await DisposableTrigger.CreateResource(client, Recording);

            TriggerDeleteTriggerOperation deleteOperation = await client.StartDeleteTriggerAsync(resource.Name);

            await deleteOperation.WaitAndAssertSuccessfulCompletion();
        }
コード例 #2
0
        public async Task TestEventStatus()
        {
            TriggerClient client = CreateClient();

            await using DisposableTrigger trigger = await DisposableTrigger.Create(client, Recording);

            TriggerSubscriptionOperationStatus statusOperation = await client.GetEventSubscriptionStatusAsync(trigger.Name);

            Assert.AreEqual(statusOperation.TriggerName, trigger.Name);
        }
コード例 #3
0
        public async Task TestGetTrigger()
        {
            TriggerClient client = CreateClient();

            await using DisposableTrigger singleTrigger = await DisposableTrigger.Create(client, Recording);

            await foreach (var trigger in client.GetTriggersByWorkspaceAsync())
            {
                TriggerResource actualTrigger = await client.GetTriggerAsync(trigger.Name);

                Assert.AreEqual(trigger.Name, actualTrigger.Name);
                Assert.AreEqual(trigger.Id, actualTrigger.Id);
            }
        }
コード例 #4
0
        public async Task TestQueryRuns()
        {
            TriggerClient    triggerClient = CreateTriggerClient();
            TriggerRunClient runClient     = CreateRunClient();

            TriggerResource resource = await DisposableTrigger.CreateResource(triggerClient, Recording);

            TriggerStartTriggerOperation startOperation = await triggerClient.StartStartTriggerAsync(resource.Name);

            await startOperation.WaitAndAssertSuccessfulCompletion();

            TriggerRunsQueryResponse response = await runClient.QueryTriggerRunsByWorkspaceAsync(new RunFilterParameters (DateTimeOffset.MinValue, DateTimeOffset.MaxValue));

            Assert.GreaterOrEqual(response.Value.Count, 1);
        }
コード例 #5
0
        public async Task TestCancelRerun()
        {
            TriggerClient    triggerClient = CreateTriggerClient();
            TriggerRunClient runClient     = CreateRunClient();

            TriggerResource resource = await DisposableTrigger.CreateResource(triggerClient, Recording);

            TriggerStartTriggerOperation startOperation = await triggerClient.StartStartTriggerAsync(resource.Name);

            await startOperation.WaitAndAssertSuccessfulCompletion();

            TriggerRunsQueryResponse response = await runClient.QueryTriggerRunsByWorkspaceAsync(new RunFilterParameters (DateTimeOffset.MinValue, DateTimeOffset.MaxValue));

            // Find the active run and cancel (CancelTriggerInstanceAsync)

            // Rerun canceled run (RerunTriggerInstanceAsync)
        }
コード例 #6
0
        public async Task TestSubscribeUnsubscribe()
        {
            TriggerClient client = CreateClient();

            await using DisposableTrigger trigger = await DisposableTrigger.Create(client, Recording);

            TriggerSubscribeTriggerToEventsOperation subOperation = await client.StartSubscribeTriggerToEventsAsync(trigger.Name);

            TriggerSubscriptionOperationStatus subResponse = await subOperation.WaitForCompletionAsync();

            Assert.AreEqual(EventSubscriptionStatus.Enabled, subResponse.Status);

            TriggerUnsubscribeTriggerFromEventsOperation unsubOperation = await client.StartUnsubscribeTriggerFromEventsAsync(trigger.Name);

            TriggerSubscriptionOperationStatus unsubResponse = await unsubOperation.WaitForCompletionAsync();

            Assert.AreEqual(EventSubscriptionStatus.Disabled, unsubResponse.Status);
        }
コード例 #7
0
        public async Task TestStartStop()
        {
            TriggerClient  client         = CreateClient();
            PipelineClient pipelineClient = CreatePipelineClient();

            await using DisposableTrigger trigger = await DisposableTrigger.Create(client, Recording);

            await using DisposablePipeline pipeline = await DisposablePipeline.Create(pipelineClient, Recording);

            // SYNAPSE_API_ISSUE - How do we point the trigger to our pipeline

            TriggerStartTriggerOperation startOperation = await client.StartStartTriggerAsync(trigger.Name);

            Response startResponse = await startOperation.WaitForCompletionResponseAsync();

            startResponse.AssertSuccess();

            TriggerStopTriggerOperation stopOperation = await client.StartStopTriggerAsync(trigger.Name);

            Response stopResponse = await stopOperation.WaitForCompletionResponseAsync();

            stopResponse.AssertSuccess();
        }