Lists the ontologies in your account, with the status of each.
Parameters:
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of ontology summaries to return in one page, 1–100. Defaults to 50. A value outside this range fails with ValidationException. AWS Context doesn't clamp it.
-
next_token
(Optional[PaginationToken], default:
None
)
–
Opaque continuation token from a prior response's nextToken. Omit on the first page.
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.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
List ontologies
The following example lists the ontologies in the account: one created with CreateOntology and one created by an ontology induction and then published.
>>> await client.list_ontologies(max_results=50)
Source code in docs_src/capo_context/_services/async_context.py
| async def list_ontologies(
self,
*,
config_overrides: Optional[AsyncContextClientConfig] = None,
max_results: Optional["capo_context.types.max_results.MaxResults"] = None,
next_token: Optional[
"capo_context.types.pagination_token.PaginationToken"
] = None,
) -> "capo_context.types.list_ontologies_response.ListOntologiesResponse":
"""<p>Lists the ontologies in your account, with the status of each.</p>
Args:
max_results: <p>The maximum number of ontology summaries to return in one page, 1–100. Defaults to 50. A value outside this range fails with ValidationException. AWS Context doesn't clamp it.</p>
next_token: <p>Opaque continuation token from a prior response's nextToken. Omit on the first page.</p>
Raises:
capo_context.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.</p>
capo_context.errors.internal_server_exception.InternalServerException: <p>The request failed because of an internal error. Retry the request.</p>
capo_context.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a request rate quota. Wait, then retry the request.</p>
capo_context.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.</p>
capo_context.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
List ontologies
The following example lists the ontologies in the account: one created with CreateOntology and one created by an ontology induction and then published.
>>> await client.list_ontologies(max_results=50)
"""
async def _handler(
req: "AsyncOperationRequest[capo_context.types.list_ontologies_request.ListOntologiesRequest]",
) -> AsyncOperationResponse[
"capo_context.types.list_ontologies_response.ListOntologiesResponse"
]:
import capo_context._operations.context.list_ontologies
(
output,
http_response,
) = await capo_context._operations.context.list_ontologies.async_list_ontologies(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListOntologies")
)
input_: capo_context.types.list_ontologies_request.ListOntologiesRequest = {}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|