Esempio n. 1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListDetectorRecipesRequest request;

            try
            {
                request = new ListDetectorRecipesRequest
                {
                    CompartmentId        = CompartmentId,
                    DisplayName          = DisplayName,
                    ResourceMetadataOnly = ResourceMetadataOnly,
                    LifecycleState       = LifecycleState,
                    Limit = Limit,
                    Page  = Page,
                    CompartmentIdInSubtree = CompartmentIdInSubtree,
                    AccessLevel            = AccessLevel,
                    SortOrder    = SortOrder,
                    SortBy       = SortBy,
                    OpcRequestId = OpcRequestId
                };
                IEnumerable <ListDetectorRecipesResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.DetectorRecipeCollection, true);
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Esempio n. 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListDetectorRecipesRequest request;

            try
            {
                request = new ListDetectorRecipesRequest
                {
                    CompartmentId        = CompartmentId,
                    DisplayName          = DisplayName,
                    ResourceMetadataOnly = ResourceMetadataOnly,
                    LifecycleState       = LifecycleState,
                    Limit = Limit,
                    Page  = Page,
                    CompartmentIdInSubtree = CompartmentIdInSubtree,
                    AccessLevel            = AccessLevel,
                    SortOrder    = SortOrder,
                    SortBy       = SortBy,
                    OpcRequestId = OpcRequestId
                };
                IEnumerable <ListDetectorRecipesResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.DetectorRecipeCollection, 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 (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }