get_context_graph
¶
get_context_graph(
start_time: datetime,
end_time: datetime,
*,
config_overrides: Optional[CloudWatchOmniClientConfig] = None,
node_filters: Optional[NodeFilters] = None,
edge_filters: Optional[EdgeFilters] = None,
depth: Optional[int] = None,
max_results: Optional[int] = None,
max_edges_per_node: Optional[int] = None,
include_metadata: Optional[bool] = None,
next_token: Optional[PaginationToken] = None,
) -> GetContextGraphOutput
Queries the context graph with filtering, traversal, and pagination support. Pagination note: nodes and edges are returned together as a coherent subgraph. Pagination cursors advance over nodes (the primary collection); each page includes all edges connecting nodes within that page. Callers should treat nodes as the paginated collection and edges as supplementary relationship data attached to those nodes.
Parameters:
-
node_filters(Optional[NodeFilters], default:None) –Criteria restricting which nodes are returned.
-
edge_filters(Optional[EdgeFilters], default:None) –Criteria restricting which edges are returned.
-
start_time(datetime) –Start of the time range (UTC), inclusive.
-
end_time(datetime) –End of the time range (UTC), inclusive.
-
depth(Optional[int], default:None) –How many hops to traverse out from the nodes matched by nodeFilters. 0 returns only the matched nodes themselves.
-
max_results(Optional[int], default:None) –The maximum number of nodes to return in a single page.
-
max_edges_per_node(Optional[int], default:None) –The maximum number of edges to return per node, bounding the fan-out of a densely connected node.
-
include_metadata(Optional[bool], default:None) –Whether to return the metadata block, semantics included, on each node and edge. Off by default because it costs an extra lookup per returned node.
-
next_token(Optional[PaginationToken], default:None) –Pagination token from a previous response, to retrieve the next page.
Raises:
-
AccessDeniedException–The caller is not authorized to perform this action.
-
InternalServerException–An unexpected error occurred while processing the request.
-
ThrottlingException–The request was throttled due to exceeding the allowed request rate.
-
ValidationException–A parameter is specified incorrectly.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Query a service and its immediate dependencies The following example returns context graph nodes matching the filter and traverses one hop out to their direct dependencies, over a one-hour window. Payloads are shown as JSON; on the wire they are CBOR-encoded.
>>> client.get_context_graph(node_filters={'nodeType': 'SERVICE', 'namespace': ['ecommerce']}, start_time='2026-09-16T00:00:00Z', end_time='2026-09-16T01:00:00Z', depth=1, max_results=100, include_metadata=False)
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 | |