Creates a CLI token for the Airflow CLI. To learn more, see Creating an Apache Airflow CLI token.
Parameters:
-
name
(EnvironmentName)
–
The name of the Amazon MWAA environment. For example, MyMWAAEnvironment.
Raises:
Source code in docs_src/capo_mwaa/_services/mwaa.py
| def create_cli_token(
self,
name: "capo_mwaa.types.environment_name.EnvironmentName",
*,
config_overrides: Optional[MWAAClientConfig] = None,
) -> "capo_mwaa.types.create_cli_token_response.CreateCliTokenResponse":
"""<p>Creates a CLI token for the Airflow CLI. To learn more, see <a href="https://docs.aws.amazon.com/mwaa/latest/userguide/call-mwaa-apis-cli.html">Creating an Apache Airflow CLI token</a>.</p>
Args:
name: <p>The name of the Amazon MWAA environment. For example, <code>MyMWAAEnvironment</code>.</p>
Raises:
capo_mwaa.errors.resource_not_found_exception.ResourceNotFoundException: <p>ResourceNotFoundException: The resource is not available.</p>
capo_mwaa.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_mwaa.types.create_cli_token_request.CreateCliTokenRequest]",
) -> OperationResponse[
"capo_mwaa.types.create_cli_token_response.CreateCliTokenResponse"
]:
import capo_mwaa._operations.amazon_mwaa.create_cli_token
output, http_response = (
capo_mwaa._operations.amazon_mwaa.create_cli_token.create_cli_token(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_mwaa.types.create_cli_token_response.CreateCliTokenResponse",
) -> dict[str, Any]:
import capo_mwaa.types.create_cli_token_response
return capo_mwaa.types.create_cli_token_response.redact_sensitive(output)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("CreateCliToken", redact_output=_redact_output),
)
input_: capo_mwaa.types.create_cli_token_request.CreateCliTokenRequest = {
"name": name
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|