|
| 1 | +/* |
| 2 | + * NOTE: Generated using OracleSDKGenerator, API Version: 20210201 |
| 3 | + * DO NOT EDIT this file manually. |
| 4 | + * |
| 5 | + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. |
| 6 | + * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. |
| 7 | + */ |
| 8 | + |
| 9 | +using System; |
| 10 | +using System.Management.Automation; |
| 11 | +using Oci.ApmconfigService.Requests; |
| 12 | +using Oci.ApmconfigService.Responses; |
| 13 | +using Oci.ApmconfigService.Models; |
| 14 | +using Oci.Common.Model; |
| 15 | + |
| 16 | +namespace Oci.ApmconfigService.Cmdlets |
| 17 | +{ |
| 18 | + [Cmdlet("Copy", "OCIApmconfigConfiguration")] |
| 19 | + [OutputType(new System.Type[] { typeof(Oci.ApmconfigService.Models.ImportConfigurationFailedItemsCollection), typeof(Oci.ApmconfigService.Responses.CopyConfigurationResponse) })] |
| 20 | + public class CopyOCIApmconfigConfiguration : OCIConfigCmdlet |
| 21 | + { |
| 22 | + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"JSON metadata for fast Export/Import configurations domain.")] |
| 23 | + public CopyConfigurationDetails CopyConfigurationDetails { get; set; } |
| 24 | + |
| 25 | + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The APM Domain ID the request is intended for.")] |
| 26 | + public string ApmDomainId { get; set; } |
| 27 | + |
| 28 | + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The Target APM Domain ID the request is intended for.")] |
| 29 | + public string ApmTargetDomainId { get; set; } |
| 30 | + |
| 31 | + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.")] |
| 32 | + public string OpcRetryToken { get; set; } |
| 33 | + |
| 34 | + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.")] |
| 35 | + public string OpcRequestId { get; set; } |
| 36 | + |
| 37 | + protected override void ProcessRecord() |
| 38 | + { |
| 39 | + base.ProcessRecord(); |
| 40 | + CopyConfigurationRequest request; |
| 41 | + |
| 42 | + try |
| 43 | + { |
| 44 | + request = new CopyConfigurationRequest |
| 45 | + { |
| 46 | + CopyConfigurationDetails = CopyConfigurationDetails, |
| 47 | + ApmDomainId = ApmDomainId, |
| 48 | + ApmTargetDomainId = ApmTargetDomainId, |
| 49 | + OpcRetryToken = OpcRetryToken, |
| 50 | + OpcRequestId = OpcRequestId |
| 51 | + }; |
| 52 | + |
| 53 | + response = client.CopyConfiguration(request).GetAwaiter().GetResult(); |
| 54 | + WriteOutput(response, response.ImportConfigurationFailedItemsCollection); |
| 55 | + FinishProcessing(response); |
| 56 | + } |
| 57 | + catch (OciException ex) |
| 58 | + { |
| 59 | + TerminatingErrorDuringExecution(ex); |
| 60 | + } |
| 61 | + catch (Exception ex) |
| 62 | + { |
| 63 | + TerminatingErrorDuringExecution(ex); |
| 64 | + } |
| 65 | + } |
| 66 | + |
| 67 | + protected override void StopProcessing() |
| 68 | + { |
| 69 | + base.StopProcessing(); |
| 70 | + TerminatingErrorDuringExecution(new OperationCanceledException("Cmdlet execution interrupted")); |
| 71 | + } |
| 72 | + |
| 73 | + private CopyConfigurationResponse response; |
| 74 | + } |
| 75 | +} |
0 commit comments