/// <summary>Snippet for DeleteTrainingPipeline</summary> public void DeleteTrainingPipelineResourceNames() { // Snippet: DeleteTrainingPipeline(TrainingPipelineName, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) TrainingPipelineName name = TrainingPipelineName.FromProjectLocationTrainingPipeline("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]"); // Make the request Operation <Empty, DeleteOperationMetadata> response = pipelineServiceClient.DeleteTrainingPipeline(name); // Poll until the returned long-running operation is complete Operation <Empty, DeleteOperationMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Empty result = completedResponse.Result; // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <Empty, DeleteOperationMetadata> retrievedResponse = pipelineServiceClient.PollOnceDeleteTrainingPipeline(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Empty retrievedResult = retrievedResponse.Result; } // End snippet }
/// <summary>Snippet for GetTrainingPipeline</summary> public void GetTrainingPipelineResourceNames() { // Snippet: GetTrainingPipeline(TrainingPipelineName, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) TrainingPipelineName name = TrainingPipelineName.FromProjectLocationTrainingPipeline("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]"); // Make the request TrainingPipeline response = pipelineServiceClient.GetTrainingPipeline(name); // End snippet }
/// <summary>Snippet for GetTrainingPipeline</summary> public void GetTrainingPipeline() { // Snippet: GetTrainingPipeline(string, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) string name = "projects/[PROJECT]/locations/[LOCATION]/trainingPipelines/[TRAINING_PIPELINE]"; // Make the request TrainingPipeline response = pipelineServiceClient.GetTrainingPipeline(name); // End snippet }
/// <summary>Snippet for CreateTrainingPipeline</summary> public void CreateTrainingPipelineResourceNames() { // Snippet: CreateTrainingPipeline(LocationName, TrainingPipeline, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"); TrainingPipeline trainingPipeline = new TrainingPipeline(); // Make the request TrainingPipeline response = pipelineServiceClient.CreateTrainingPipeline(parent, trainingPipeline); // End snippet }
/// <summary>Snippet for CreateTrainingPipeline</summary> public void CreateTrainingPipeline() { // Snippet: CreateTrainingPipeline(string, TrainingPipeline, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) string parent = "projects/[PROJECT]/locations/[LOCATION]"; TrainingPipeline trainingPipeline = new TrainingPipeline(); // Make the request TrainingPipeline response = pipelineServiceClient.CreateTrainingPipeline(parent, trainingPipeline); // End snippet }
/// <summary>Snippet for ListTrainingPipelines</summary> public void ListTrainingPipelinesRequestObject() { // Snippet: ListTrainingPipelines(ListTrainingPipelinesRequest, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) ListTrainingPipelinesRequest request = new ListTrainingPipelinesRequest { ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), Filter = "", ReadMask = new FieldMask(), }; // Make the request PagedEnumerable <ListTrainingPipelinesResponse, TrainingPipeline> response = pipelineServiceClient.ListTrainingPipelines(request); // Iterate over all response items, lazily performing RPCs as required foreach (TrainingPipeline item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (ListTrainingPipelinesResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (TrainingPipeline item in page) { // Do something with each item Console.WriteLine(item); } } // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <TrainingPipeline> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (TrainingPipeline item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
/// <summary>Snippet for CancelTrainingPipeline</summary> public void CancelTrainingPipelineRequestObject() { // Snippet: CancelTrainingPipeline(CancelTrainingPipelineRequest, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) CancelTrainingPipelineRequest request = new CancelTrainingPipelineRequest { TrainingPipelineName = TrainingPipelineName.FromProjectLocationTrainingPipeline("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]"), }; // Make the request pipelineServiceClient.CancelTrainingPipeline(request); // End snippet }
/// <summary>Snippet for CreateTrainingPipeline</summary> public void CreateTrainingPipelineRequestObject() { // Snippet: CreateTrainingPipeline(CreateTrainingPipelineRequest, CallSettings) // Create client PipelineServiceClient pipelineServiceClient = PipelineServiceClient.Create(); // Initialize request argument(s) CreateTrainingPipelineRequest request = new CreateTrainingPipelineRequest { ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"), TrainingPipeline = new TrainingPipeline(), }; // Make the request TrainingPipeline response = pipelineServiceClient.CreateTrainingPipeline(request); // End snippet }