-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Releasing version 49.0.0
- Loading branch information
Showing
185 changed files
with
5,396 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
Aianomalydetection/Cmdlets/Get-OCIAianomalydetectionDetectAnomalyJob.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
* NOTE: Generated using OracleSDKGenerator, API Version: 20210101 | ||
* DO NOT EDIT this file manually. | ||
* | ||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. | ||
* 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. | ||
*/ | ||
|
||
using System; | ||
using System.Management.Automation; | ||
using Oci.AianomalydetectionService.Requests; | ||
using Oci.AianomalydetectionService.Responses; | ||
using Oci.AianomalydetectionService.Models; | ||
using Oci.Common.Model; | ||
using Oci.Common.Waiters; | ||
|
||
namespace Oci.AianomalydetectionService.Cmdlets | ||
{ | ||
[Cmdlet("Get", "OCIAianomalydetectionDetectAnomalyJob", DefaultParameterSetName = Default)] | ||
[OutputType(new System.Type[] { typeof(Oci.AianomalydetectionService.Models.DetectAnomalyJob), typeof(Oci.AianomalydetectionService.Responses.GetDetectAnomalyJobResponse) })] | ||
public class GetOCIAianomalydetectionDetectAnomalyJob : OCIAnomalyDetectionCmdlet | ||
{ | ||
|
||
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"Unique asynchronous job identifier.", ParameterSetName = LifecycleStateParamSet)] | ||
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"Unique asynchronous job identifier.", ParameterSetName = Default)] | ||
public string DetectAnomalyJobId { get; set; } | ||
|
||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The client request ID for tracing.", ParameterSetName = LifecycleStateParamSet)] | ||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The client request ID for tracing.", ParameterSetName = Default)] | ||
public string OpcRequestId { get; set; } | ||
|
||
[Parameter(Mandatory = true, HelpMessage = @"This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state.", ParameterSetName = LifecycleStateParamSet)] | ||
public Oci.AianomalydetectionService.Models.DetectAnomalyJob.LifecycleStateEnum[] WaitForLifecycleState { get; set; } | ||
|
||
[Parameter(Mandatory = false, HelpMessage = @"Check every WaitIntervalSeconds to see whether the resource has reached a desired state.", ParameterSetName = LifecycleStateParamSet)] | ||
public int WaitIntervalSeconds { get; set; } = WAIT_INTERVAL_SECONDS; | ||
|
||
[Parameter(Mandatory = false, HelpMessage = @"Maximum number of attempts to be made until the resource reaches a desired state.", ParameterSetName = LifecycleStateParamSet)] | ||
public int MaxWaitAttempts { get; set; } = MAX_WAITER_ATTEMPTS; | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
base.ProcessRecord(); | ||
GetDetectAnomalyJobRequest request; | ||
|
||
try | ||
{ | ||
request = new GetDetectAnomalyJobRequest | ||
{ | ||
DetectAnomalyJobId = DetectAnomalyJobId, | ||
OpcRequestId = OpcRequestId | ||
}; | ||
|
||
HandleOutput(request); | ||
FinishProcessing(response); | ||
} | ||
catch (OciException ex) | ||
{ | ||
TerminatingErrorDuringExecution(ex); | ||
} | ||
catch (Exception ex) | ||
{ | ||
TerminatingErrorDuringExecution(ex); | ||
} | ||
} | ||
|
||
protected override void StopProcessing() | ||
{ | ||
base.StopProcessing(); | ||
TerminatingErrorDuringExecution(new OperationCanceledException("Cmdlet execution interrupted")); | ||
} | ||
|
||
private void HandleOutput(GetDetectAnomalyJobRequest request) | ||
{ | ||
var waiterConfig = new WaiterConfiguration | ||
{ | ||
MaxAttempts = MaxWaitAttempts, | ||
GetNextDelayInSeconds = (_) => WaitIntervalSeconds | ||
}; | ||
|
||
switch (ParameterSetName) | ||
{ | ||
case LifecycleStateParamSet: | ||
response = client.Waiters.ForDetectAnomalyJob(request, waiterConfig, WaitForLifecycleState).Execute(); | ||
break; | ||
|
||
case Default: | ||
response = client.GetDetectAnomalyJob(request).GetAwaiter().GetResult(); | ||
break; | ||
} | ||
WriteOutput(response, response.DetectAnomalyJob); | ||
} | ||
|
||
private GetDetectAnomalyJobResponse response; | ||
private const string LifecycleStateParamSet = "LifecycleStateParamSet"; | ||
private const string Default = "Default"; | ||
} | ||
} |
124 changes: 124 additions & 0 deletions
124
Aianomalydetection/Cmdlets/Get-OCIAianomalydetectionDetectAnomalyJobsList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
/* | ||
* NOTE: Generated using OracleSDKGenerator, API Version: 20210101 | ||
* DO NOT EDIT this file manually. | ||
* | ||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. | ||
* 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. | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Management.Automation; | ||
using Oci.AianomalydetectionService.Requests; | ||
using Oci.AianomalydetectionService.Responses; | ||
using Oci.AianomalydetectionService.Models; | ||
using Oci.Common.Model; | ||
|
||
namespace Oci.AianomalydetectionService.Cmdlets | ||
{ | ||
[Cmdlet("Get", "OCIAianomalydetectionDetectAnomalyJobsList")] | ||
[OutputType(new System.Type[] { typeof(Oci.AianomalydetectionService.Models.DetectAnomalyJobCollection), typeof(Oci.AianomalydetectionService.Responses.ListDetectAnomalyJobsResponse) })] | ||
public class GetOCIAianomalydetectionDetectAnomalyJobsList : OCIAnomalyDetectionCmdlet | ||
{ | ||
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The ID of the compartment in which to list resources.")] | ||
public string CompartmentId { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The ID of the trained model for which to list the resources.")] | ||
public string ModelId { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The ID of the project for which to list the objects.")] | ||
public string ProjectId { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"Unique Async Job identifier")] | ||
public string DetectAnomalyJobId { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"<b>Filter</b> results by the specified lifecycle state. Must be a valid state for the resource type.")] | ||
public System.Nullable<Oci.AianomalydetectionService.Models.DetectAnomalyJob.LifecycleStateEnum> LifecycleState { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"A filter to return only resources that match the entire display name given.")] | ||
public string DisplayName { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The maximum number of items to return.", ParameterSetName = LimitSet)] | ||
public System.Nullable<int> Limit { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.")] | ||
public string Page { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The sort order to use, either 'asc' or 'desc'.")] | ||
public System.Nullable<Oci.AianomalydetectionService.Models.SortOrder> SortOrder { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.")] | ||
public System.Nullable<Oci.AianomalydetectionService.Requests.ListDetectAnomalyJobsRequest.SortByEnum> SortBy { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The client request ID for tracing.")] | ||
public string OpcRequestId { get; set; } | ||
|
||
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"Fetches all pages of results.", ParameterSetName = AllPageSet)] | ||
public SwitchParameter All { get; set; } | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
base.ProcessRecord(); | ||
ListDetectAnomalyJobsRequest request; | ||
|
||
try | ||
{ | ||
request = new ListDetectAnomalyJobsRequest | ||
{ | ||
CompartmentId = CompartmentId, | ||
ModelId = ModelId, | ||
ProjectId = ProjectId, | ||
DetectAnomalyJobId = DetectAnomalyJobId, | ||
LifecycleState = LifecycleState, | ||
DisplayName = DisplayName, | ||
Limit = Limit, | ||
Page = Page, | ||
SortOrder = SortOrder, | ||
SortBy = SortBy, | ||
OpcRequestId = OpcRequestId | ||
}; | ||
IEnumerable<ListDetectAnomalyJobsResponse> responses = GetRequestDelegate().Invoke(request); | ||
foreach (var item in responses) | ||
{ | ||
response = item; | ||
WriteOutput(response, response.DetectAnomalyJobCollection, true); | ||
} | ||
if(!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null) | ||
{ | ||
WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources."); | ||
} | ||
FinishProcessing(response); | ||
} | ||
catch (OciException ex) | ||
{ | ||
TerminatingErrorDuringExecution(ex); | ||
} | ||
catch (Exception ex) | ||
{ | ||
TerminatingErrorDuringExecution(ex); | ||
} | ||
} | ||
|
||
protected override void StopProcessing() | ||
{ | ||
base.StopProcessing(); | ||
TerminatingErrorDuringExecution(new OperationCanceledException("Cmdlet execution interrupted")); | ||
} | ||
|
||
private RequestDelegate GetRequestDelegate() | ||
{ | ||
IEnumerable<ListDetectAnomalyJobsResponse> DefaultRequest(ListDetectAnomalyJobsRequest request) => Enumerable.Repeat(client.ListDetectAnomalyJobs(request).GetAwaiter().GetResult(), 1); | ||
if (ParameterSetName.Equals(AllPageSet)) | ||
{ | ||
return req => client.Paginators.ListDetectAnomalyJobsResponseEnumerator(req); | ||
} | ||
return DefaultRequest; | ||
} | ||
|
||
private ListDetectAnomalyJobsResponse response; | ||
private delegate IEnumerable<ListDetectAnomalyJobsResponse> RequestDelegate(ListDetectAnomalyJobsRequest request); | ||
private const string AllPageSet = "AllPages"; | ||
private const string LimitSet = "Limit"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
Aianomalydetection/Cmdlets/Move-OCIAianomalydetectionDetectAnomalyJobCompartment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* NOTE: Generated using OracleSDKGenerator, API Version: 20210101 | ||
* DO NOT EDIT this file manually. | ||
* | ||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. | ||
* 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. | ||
*/ | ||
|
||
using System; | ||
using System.Management.Automation; | ||
using Oci.AianomalydetectionService.Requests; | ||
using Oci.AianomalydetectionService.Responses; | ||
using Oci.AianomalydetectionService.Models; | ||
using Oci.Common.Model; | ||
|
||
namespace Oci.AianomalydetectionService.Cmdlets | ||
{ | ||
[Cmdlet("Move", "OCIAianomalydetectionDetectAnomalyJobCompartment")] | ||
[OutputType(new System.Type[] { typeof(void), typeof(Oci.AianomalydetectionService.Responses.ChangeDetectAnomalyJobCompartmentResponse) })] | ||
public class MoveOCIAianomalydetectionDetectAnomalyJobCompartment : OCIAnomalyDetectionCmdlet | ||
{ | ||
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"Unique asynchronous job identifier.")] | ||
public string DetectAnomalyJobId { get; set; } | ||
|
||
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The details to change the compartment of the async anomaly detect job.")] | ||
public ChangeDetectAnomalyJobCompartmentDetails ChangeDetectAnomalyJobCompartmentDetails { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.")] | ||
public string IfMatch { get; set; } | ||
|
||
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The client request ID for tracing.")] | ||
public string OpcRequestId { get; set; } | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
base.ProcessRecord(); | ||
ChangeDetectAnomalyJobCompartmentRequest request; | ||
|
||
try | ||
{ | ||
request = new ChangeDetectAnomalyJobCompartmentRequest | ||
{ | ||
DetectAnomalyJobId = DetectAnomalyJobId, | ||
ChangeDetectAnomalyJobCompartmentDetails = ChangeDetectAnomalyJobCompartmentDetails, | ||
IfMatch = IfMatch, | ||
OpcRequestId = OpcRequestId | ||
}; | ||
|
||
response = client.ChangeDetectAnomalyJobCompartment(request).GetAwaiter().GetResult(); | ||
WriteOutput(response); | ||
FinishProcessing(response); | ||
} | ||
catch (OciException ex) | ||
{ | ||
TerminatingErrorDuringExecution(ex); | ||
} | ||
catch (Exception ex) | ||
{ | ||
TerminatingErrorDuringExecution(ex); | ||
} | ||
} | ||
|
||
protected override void StopProcessing() | ||
{ | ||
base.StopProcessing(); | ||
TerminatingErrorDuringExecution(new OperationCanceledException("Cmdlet execution interrupted")); | ||
} | ||
|
||
private ChangeDetectAnomalyJobCompartmentResponse response; | ||
} | ||
} |
Oops, something went wrong.