예제 #1
0
        public async Task TestDeleteDataFlow()
        {
            string dataFlowName = Recording.GenerateName("DataFlow");

            DataFlowCreateOrUpdateDataFlowOperation createOperation = await DataFlowClient.StartCreateOrUpdateDataFlowAsync(dataFlowName, new DataFlowResource(new DataFlow()));

            await createOperation.WaitForCompletionAsync();

            DataFlowDeleteDataFlowOperation deleteOperation = await DataFlowClient.StartDeleteDataFlowAsync(dataFlowName);

            Response response = await deleteOperation.WaitForCompletionAsync();

            Assert.AreEqual(200, response.Status);
        }
        public async Task DeleteDataFlow()
        {
            DataFlowClient client = CreateClient();

            DataFlowResource resource = await DisposableDataFlow.CreateResource(client, this.Recording);

            DataFlowDeleteDataFlowOperation operation = await client.StartDeleteDataFlowAsync(resource.Name);

            Response response = await operation.WaitForCompletionAsync();

            switch (response.Status)
            {
            case 200:
            case 204:
                break;

            default:
                Assert.Fail($"Unexpected status ${response.Status} returned");
                break;
            }
        }
예제 #3
0
        public async Task DataFlowSample()
        {
            #region Snippet:CreateDataFlowClientPrep
            // Replace the string below with your actual endpoint url.
            string endpoint = "<my-endpoint-url>";
            /*@@*/ endpoint = TestEnvironment.EndpointUrl;

            string dataFlowName = "Test-DataFlow";
            #endregion

            #region Snippet:CreateDataFlowClient
            DataFlowClient client = new DataFlowClient(endpoint: new Uri(endpoint), credential: new DefaultAzureCredential());
            #endregion

            #region Snippet:CreateDataFlow
            DataFlowCreateOrUpdateDataFlowOperation operation       = client.StartCreateOrUpdateDataFlow(dataFlowName, new DataFlowResource(new DataFlow()));
            Response <DataFlowResource>             createdDataflow = await operation.WaitForCompletionAsync();

            #endregion

            #region Snippet:RetrieveDataFlow
            DataFlowResource retrievedDataflow = client.GetDataFlow(dataFlowName);
            #endregion

            #region Snippet:ListDataFlows
            Pageable <DataFlowResource> dataFlows = client.GetDataFlowsByWorkspace();
            foreach (DataFlowResource dataflow in dataFlows)
            {
                System.Console.WriteLine(dataflow.Name);
            }
            #endregion

            #region Snippet:DeleteDataFlow
            DataFlowDeleteDataFlowOperation deleteOperation = client.StartDeleteDataFlow(dataFlowName);
            await deleteOperation.WaitForCompletionAsync();

            #endregion
        }
예제 #4
0
        public async Task RenameDataFlow()
        {
            DataFlowClient client = CreateClient();

            DataFlowResource resource = await DisposableDataFlow.CreateResource(client, this.Recording);

            string newFlowName = Recording.GenerateAssetName("DataFlow2");

            DataFlowRenameDataFlowOperation renameOperation = await client.StartRenameDataFlowAsync(resource.Name, new ArtifactRenameRequest()
            {
                NewName = newFlowName
            });

            await renameOperation.WaitForCompletionAsync();

            DataFlowResource dataFlow = await client.GetDataFlowAsync(newFlowName);

            Assert.AreEqual(newFlowName, dataFlow.Name);

            DataFlowDeleteDataFlowOperation operation = await client.StartDeleteDataFlowAsync(newFlowName);

            await operation.WaitForCompletionAsync();
        }
예제 #5
0
        public async ValueTask DisposeAsync()
        {
            DataFlowDeleteDataFlowOperation operation = await _client.StartDeleteDataFlowAsync(Name);

            await operation.WaitForCompletionAsync();
        }