protected override void ProcessRecord() { base.ProcessRecord(); ListRouteTablesRequest request; try { request = new ListRouteTablesRequest { CompartmentId = CompartmentId, Limit = Limit, Page = Page, VcnId = VcnId, DisplayName = DisplayName, SortBy = SortBy, SortOrder = SortOrder, LifecycleState = LifecycleState }; IEnumerable <ListRouteTablesResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.Items, 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); } }
protected override void ProcessRecord() { base.ProcessRecord(); ListRouteTablesRequest request; try { request = new ListRouteTablesRequest { CompartmentId = CompartmentId, Limit = Limit, Page = Page, VcnId = VcnId, DisplayName = DisplayName, SortBy = SortBy, SortOrder = SortOrder, LifecycleState = LifecycleState }; IEnumerable <ListRouteTablesResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.Items, true); } FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/** * Gets RouteTable info of a single uniquely named RouteTable in the * specified compartment. * * @param vcnClient the service client to use to query a RouteTable. * @param compartmentId of the RouteTable. * @param vcnId of the RouteTable's associated VCN. * @return the InternetGateway. */ private static async Task <RouteTable> GetUniqueRouteTableByName(VirtualNetworkClient vcnClient, string compartmentId, string vcnId) { // Find the route table in a specific compartment var listRouteTablesRequest = new ListRouteTablesRequest { CompartmentId = compartmentId, VcnId = vcnId, DisplayName = RouteTableName }; var listRouteTablesResponse = await vcnClient.ListRouteTables(listRouteTablesRequest); if (listRouteTablesResponse.Items.Count != 1) { logger.Error($"Could not find unique RouteTable with name: {RouteTableName} in compartment: {compartmentId}"); return(null); } return(listRouteTablesResponse.Items[0]); }