traverse_agent_context
¶
traverse_agent_context(
agent_context_id: AgentContextIdentifier,
node_id: GenericNodeId,
traversal_strategy: TraversalStrategy,
*,
config_overrides: Optional[ContextClientConfig] = None,
max_results: Optional[int] = None,
next_token: Optional[str] = None,
) -> TraverseAgentContextResponse
Returns the neighbors of a seed node in an agent context, each with its properties, hop distance, and the edges that connect it to the seed. To get the seed node ID, call SearchAgentContext.
Parameters:
-
max_results(Optional[int], default:None) –Maximum total neighbors to return per page.
-
next_token(Optional[str], default:None) –Opaque continuation token from a prior response. Omit on the first page.
-
agent_context_id(AgentContextIdentifier) –The agent context to traverse, by ID or full Amazon Resource Name (ARN).
-
node_id(GenericNodeId) –The ID of the seed node to start traversal from.
-
traversal_strategy(TraversalStrategy) –Traversal directives: which edge types to follow, direction, and max depth.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.
-
InternalServerException–The request failed because of an internal error. Retry the request.
-
ThrottlingException–The request was denied because it exceeded a request rate quota. Wait, then retry the request.
-
ValidationException–The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.
-
ConflictException–The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.
-
ResourceNotFoundException–The specified resource was not found. Check that the ID is correct and that the resource exists in your account and Region.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Traverse from a node The following example follows outgoing HAS_COLUMN edges one hop from an AWS Glue table node, and returns two of the table's columns with the edge that connects each one to the table.
>>> client.traverse_agent_context(agent_context_id='ac-0123456789abcdef0123456789abcdef', node_id='glueTable:arn%3Aaws%3Aglue%3Aus-east-1%3A111122223333%3Atable%2Fsales_analytics%2Forders', max_results=2, traversal_strategy={'edgeTypes': ['AWS::CONTEXT::HAS_COLUMN'], 'direction': 'OUTGOING', 'maxDepth': 1})
Source code in docs_src/capo_context/_services/context.py
3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 | |