Skip to content

list_environments

list_environments(
    *,
    config_overrides: Optional[evsClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
    state: Optional[EnvironmentStateList] = None,
) -> ListEnvironmentsResponse

Lists the Amazon EVS environments in your Amazon Web Services account in the specified Amazon Web Services Region.

Parameters:

  • next_token (Optional[PaginationToken], default: None ) –

    A unique pagination token for each page. If nextToken is returned, there are more results available. Make the call again using the returned token with all other arguments unchanged to retrieve the next page. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return. If you specify MaxResults in the request, the response includes information up to the limit specified.

  • state (Optional[EnvironmentStateList], default: None ) –

    The state of an environment. Used to filter response results to return only environments with the specified environmentState.

Raises:

  • ValidationException –

    The input fails to satisfy the specified constraints. You will see this exception if invalid inputs are provided for any of the Amazon EVS environment operations, or if a list operation is performed on an environment resource that is still initializing.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_evs/_services/evs.py
def list_environments(
    self,
    *,
    config_overrides: Optional[evsClientConfig] = None,
    next_token: Optional["capo_evs.types.pagination_token.PaginationToken"] = None,
    max_results: Optional["capo_evs.types.max_results.MaxResults"] = None,
    state: Optional[
        "capo_evs.types.environment_state_list.EnvironmentStateList"
    ] = None,
) -> "capo_evs.types.list_environments_response.ListEnvironmentsResponse":
    """<p>Lists the Amazon EVS environments in your Amazon Web Services account in the specified Amazon Web Services Region.</p>

    Args:
        next_token: <p>A unique pagination token for each page. If <code>nextToken</code> is returned, there are more results available. Make the call again using the returned token with all other arguments unchanged to retrieve the next page. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
        max_results: <p>The maximum number of results to return. If you specify <code>MaxResults</code> in the request, the response includes information up to the limit specified.</p>
        state: <p>The state of an environment. Used to filter response results to return only environments with the specified <code>environmentState</code>.</p>

    Raises:
        capo_evs.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints. You will see this exception if invalid inputs are provided for any of the Amazon EVS environment operations, or if a list operation is performed on an environment resource that is still initializing.</p>
        capo_evs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_evs.types.list_environments_request.ListEnvironmentsRequest]",
    ) -> OperationResponse[
        "capo_evs.types.list_environments_response.ListEnvironmentsResponse"
    ]:
        import capo_evs._operations.amazon_elastic_v_mware_service.list_environments

        output, http_response = (
            capo_evs._operations.amazon_elastic_v_mware_service.list_environments.list_environments(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEnvironments")
    )
    input_: capo_evs.types.list_environments_request.ListEnvironmentsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if state is not None:
        input_["state"] = state

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output