create_agent_context
async
¶
create_agent_context(
connection_mappings: ConnectionMappingList,
*,
config_overrides: Optional[AsyncContextClientConfig] = None,
client_token: Optional[ClientToken] = None,
name: Optional[ResourceName] = None,
description: Optional[UserDefinedString] = None,
trace_analysis_config: Optional[TraceAnalysisConfig] = None,
workforce_sign_in_config: Optional[WorkforceSignInConfig] = None,
entity_resolution_config: Optional[EntityResolutionConfig] = None,
trusted_identity_sources: Optional[TrustedIdentitySourceList] = None,
tags: Optional[TagMap] = None,
curation_policy_ids: Optional[CurationPolicyIdentifierList] = None,
) -> CreateAgentContextResponse
Creates an agent context over one or more connections. Creation is asynchronous. GetAgentContext returns its status.
Parameters:
-
client_token(Optional[ClientToken], default:None) –Client idempotency token. The AWS SDKs generate one when it is absent. An identical request with the same token returns the existing agent context. The same token with a different request returns ValidationException.
trustedIdentitySourceswith the same entries in another order is the same request. -
name(Optional[ResourceName], default:None) –Optional. The name of the agent context. If you omit it, the name is
default. You can change it later with UpdateAgentContext. -
description(Optional[UserDefinedString], default:None) –Optional human-readable description of the agent context. An empty string is the same as none.
-
connection_mappings(ConnectionMappingList) –The connection mappings for this agent context, up to 20. CreateAgentContext requires at least one: an empty list returns
ValidationException. Each entry binds a connection to one or more ontologies, optionally scoped by a data filter, extraction depth, and path segments. Each referenced connection must exist, be owned by your account, and beACTIVE. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next. -
trace_analysis_config(Optional[TraceAnalysisConfig], default:None) –The agent context's trace analysis settings. Optional. You can change it with UpdateAgentContext.
-
workforce_sign_in_config(Optional[WorkforceSignInConfig], default:None) –Optional workforce sign-in settings. A config with
signInUrlturns sign-in on (statusdefaults to ENABLED).statusENABLED withoutsignInUrlis a ValidationException. You can change it with UpdateAgentContext. -
entity_resolution_config(Optional[EntityResolutionConfig], default:None) –Optional entity resolution settings. When the config or its
statusis absent,statusreads ENABLED. You can change it with UpdateAgentContext. -
trusted_identity_sources(Optional[TrustedIdentitySourceList], default:None) –Optional identity sources to trust in addition to your account. At most 100 unique entries, each with exactly one member. Order is not significant. An empty list and an absent member are the same value: only your account is trusted. You can change it with UpdateAgentContext.
-
tags(Optional[TagMap], default:None) –Tags to add to the agent context when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with
aws:. To add tags, you also needcontext:TagResourcepermission on the new agent context. If you specify more than 50 user tags, the request fails withServiceQuotaExceededException, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails withValidationException. -
curation_policy_ids(Optional[CurationPolicyIdentifierList], default:None) –Curation policies to associate with the new agent context, as IDs or ARNs, instead of the default curation policies. If you omit it or the list is empty, AWS Context associates the default curation policies. Each policy must be
ACTIVEand owned by your account, and you needcontext:AssociateCurationPolicypermission on each. AWS Context checks both again on aclientTokenretry. If a policy doesn't exist, the request fails withResourceNotFoundException. If one has been deleted, it fails withConflictException. Change the policies later with AssociateCurationPolicy and DisassociateCurationPolicy.
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.
-
ServiceQuotaExceededException–The request would exceed a service quota. Check the quota that
quotaCodenames, reduce your usage, and then retry the request. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create an agent context The following example creates an agent context over one AWS Glue Data Catalog connection, scoped to the sales database and mapped to the AWS managed Data ontology.
>>> await client.create_agent_context(client_token='a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', name='sales-analytics', description='Sales pipeline and revenue tables for the analytics agents.', connection_mappings=[{'connectionId': 'conn-7b1e4d9a2c6f4b08a3e5d1c9f2a6b4e7', 'ontologyMappings': [{'ontologyId': 'arn:aws:context:us-east-1::ontology/data'}], 'pathSegments': [{'level': 'glueDatabase', 'id': 'sales'}]}], tags={'team': 'sales-analytics'})
Source code in docs_src/capo_context/_services/async_context.py
797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | |