Lists the active log subscriptions for the Amazon Web Services account.
Parameters:
-
directory_id
(Optional[DirectoryId], default:
None
)
–
If a DirectoryID is provided, lists only the log subscription associated with that directory. If no DirectoryId is provided, lists all log subscriptions associated with your Amazon Web Services account. If there are no log subscriptions for the Amazon Web Services account or the directory, an empty list will be returned.
-
next_token
(Optional[NextToken], default:
None
)
–
The token for the next set of items to return.
-
limit
(Optional[Limit], default:
None
)
–
The maximum number of items returned.
Raises:
Source code in docs_src/capo_directory_service/_services/directory_service.py
| def list_log_subscriptions(
self,
*,
config_overrides: Optional[DirectoryServiceClientConfig] = None,
directory_id: Optional[
"capo_directory_service.types.directory_id.DirectoryId"
] = None,
next_token: Optional[
"capo_directory_service.types.next_token.NextToken"
] = None,
limit: Optional["capo_directory_service.types.limit.Limit"] = None,
) -> "capo_directory_service.types.list_log_subscriptions_result.ListLogSubscriptionsResult":
"""<p>Lists the active log subscriptions for the Amazon Web Services account.</p>
Args:
directory_id: <p>If a <i>DirectoryID</i> is provided, lists only the log subscription associated with that directory. If no <i>DirectoryId</i> is provided, lists all log subscriptions associated with your Amazon Web Services account. If there are no log subscriptions for the Amazon Web Services account or the directory, an empty list will be returned.</p>
next_token: <p>The token for the next set of items to return.</p>
limit: <p>The maximum number of items returned.</p>
Raises:
capo_directory_service.errors.client_exception.ClientException: <p>A client exception has occurred.</p>
capo_directory_service.errors.entity_does_not_exist_exception.EntityDoesNotExistException: <p>The specified entity could not be found.</p>
capo_directory_service.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> value is not valid.</p>
capo_directory_service.errors.service_exception.ServiceException: <p>An exception has occurred in Directory Service.</p>
capo_directory_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_directory_service.types.list_log_subscriptions_request.ListLogSubscriptionsRequest]",
) -> OperationResponse[
"capo_directory_service.types.list_log_subscriptions_result.ListLogSubscriptionsResult"
]:
import capo_directory_service._operations.directory_service_20150416.list_log_subscriptions
output, http_response = (
capo_directory_service._operations.directory_service_20150416.list_log_subscriptions.list_log_subscriptions(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListLogSubscriptions")
)
input_: capo_directory_service.types.list_log_subscriptions_request.ListLogSubscriptionsRequest = {}
if directory_id is not None:
input_["directory_id"] = directory_id
if next_token is not None:
input_["next_token"] = next_token
if limit is not None:
input_["limit"] = limit
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|