Lists the hosts associated with your account.
Parameters:
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned nextToken value.
-
next_token
(Optional[NextToken], default:
None
)
–
The token that was returned from the previous ListHosts call, which can be used to return the next set of hosts in the list.
Raises:
Source code in docs_src/capo_codeconnections/_services/async_code_connections.py
| async def list_hosts(
self,
*,
config_overrides: Optional[AsyncCodeConnectionsClientConfig] = None,
max_results: Optional[
"capo_codeconnections.types.max_results.MaxResults"
] = None,
next_token: Optional["capo_codeconnections.types.next_token.NextToken"] = None,
) -> "capo_codeconnections.types.list_hosts_output.ListHostsOutput":
"""<p>Lists the hosts associated with your account.</p>
Args:
max_results: <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
next_token: <p>The token that was returned from the previous <code>ListHosts</code> call, which can be used to return the next set of hosts in the list.</p>
Raises:
capo_codeconnections.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_codeconnections.types.list_hosts_input.ListHostsInput]",
) -> AsyncOperationResponse[
"capo_codeconnections.types.list_hosts_output.ListHostsOutput"
]:
import capo_codeconnections._operations.code_connections_20231201.list_hosts
(
output,
http_response,
) = await capo_codeconnections._operations.code_connections_20231201.list_hosts.async_list_hosts(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListHosts")
)
input_: capo_codeconnections.types.list_hosts_input.ListHostsInput = {}
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
|