I am testing the PowerCLI capabilities for our NSX-T deployment and I'm finding some errors that I'm unable to sort out. Since I'm quite newbie with this, I'm sure someone here will be able to shed some light to my issue.
Basically, I'm trying to show the routing table of our Tier-0 logical router using Get-NsxtService cmd-let but I'm getting an invalid_request error with error code 299 "Required data source parameter source=realtime is missing". Both logical_router_id & transport_node_id are correct.
After successfully connecting to our NSXT:
PS C:\Users\USER1> Get-NsxtService -Name com.vmware.nsx.logical_routers.routing.route_table
PS C:\Users\USER1> $routingtable.help
Operations : com.vmware.nsx.model.logical_router_route_table list(string logical_router_id, string transport_node_id, string? cursor, string? included_fields, long? page_size, boolean? sort_ascending, string? sort_by, string?
Constants : LIST_SOURCE_CACHED: Possible value for source of operation RouteTable.list.
LIST_SOURCE_REALTIME: Possible value for source of operation RouteTable.list.
PS C:\Users\USER1> $routingtable.list("742b99e2-00e1-4691-9c00-362146coco55","356ec501-6b2a-4rr1-b16e-bd23549c91c8")
A server error occurred: 'com.vmware.vapi.std.errors.invalid_request': . Check $Error.Exception.ServerError for more details.
At line:1 char:1
+ $routingtable.list("742b99e2-00e1-4691-9c00-362146coco55","356ec501-6 ...
+ CategoryInfo : OperationStopped: (:) , CisServerException
+ FullyQualifiedErrorId : VMware.VimAutomation.Cis.Core.Types.V1.CisServerException
PS C:\Users\USER1> $Error.Exception.ServerError | ConvertTo-Json
"Documentation": "The InvalidRequest error indicates that the request is malformed in such a way that the server is unable to process it. \n Examples: \n\n - The XML in a SOAP request is not well-formed so the server cannot parse the request. \n - The XML in a SOAP request is well-formed but does not match the structure required by the SOAP specification. \n - A JSON-RPC request is not valid JSON. \n - The JSON sent in a JSON-RPC request is not a valid JSON-RPC Request object. \n - The Request object from a JSON-RPC request does not match the structure required by the API infrastructure. \n \n Counterexamples: \n\n - The parameter has a value that is not with the required range. The InvalidArgument error would be used instead. \n - The name of the operation specified in the request doesn\u0027t not match any known operation. The NotFound error would be used instead. \n \n Some transport protocols (for example JSON-RPC) include their own mechanism for reporting these kinds of errors, and the API infrastructure for a programming language may expose the errors using a language specific mechanism, so this error might not be used.\n",
"Documentation": "Stack of one or more localizable messages for human error consumers. \n The message at the top of the stack (first in the list) describes the error from the perspective of the operation the client invoked. Each subsequent message in the stack describes the \"cause\" of the prior message.\n"
"Documentation": "Data to facilitate clients responding to the operation reporting a standard error to indicating that it was unable to complete successfully. \n Operations may provide data that clients can use when responding to errors. Since the data that clients need may be specific to the context of the operation reporting the error, different operations that report the same error may provide different data in the error. The documentation for each each operation will describe what, if any, data it provides for each error it reports. The ArgumentLocations, FileLocations, and TransientIndication structures are intended as possible values for this field. DynamicID may also be useful as a value for this field (although that is not its primary purpose). Some services may provide their own specific structures for use as the value of this field when reporting errors from their operations.\n\nSome operations will not set this field when reporting errors."
"Value": "Required data source parameter source=realtime is missing."
I tried to perform the same operation with Get-LogicalRouterRoutingTable cmdlet but I'm having issues too.
PS C:\Users\USER1> Get-LogicalRouterRoutingRoutingTable -LogicalRouterId "742b99e2-00e1-4691-9c00-362146coco55" -TransportNodeId "356ec501-6b2a-4rr1-b16e-bd23549c91c8"
At line:1 char:2
+ Get-LogicalRouterRoutingRoutingTable -LogicalRouterId "742b99e2-00e1 ...
+ CategoryInfo : NotSpecified: (:) [Get-LogicalRouterRoutingRoutingTable], InvalidRequest
+ FullyQualifiedErrorId : VMware.VimAutomation.Cis.Core.Commands.Nsx.InvalidRequest,VMware.VimAutomation.Cis.Core.Commands.Nsx.GetLogicalRouterRoutingRoutingTable