Use this operation to see information from the most recent run of each canary that you have created.
This operation supports resource-level authorization using an IAM policy and the Names parameter. If you specify the Names parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of the canaries, the request fails with a 403 response.
You are required to use the Names parameter if you are logged on to a user or role that has an IAM policy that restricts which canaries that you are allowed to view. For more information, see Limiting a user to viewing specific canaries.
Parameters:
-
next_token
(Optional[Token], default:
None
)
–
A token that indicates that there is more data available. You can use this token in a subsequent DescribeCanariesLastRun operation to retrieve the next set of results.
-
max_results
(Optional[MaxSize100], default:
None
)
–
Specify this parameter to limit how many runs are returned each time you use the DescribeLastRun operation. If you omit this parameter, the default of 100 is used.
-
names
(Optional[DescribeCanariesLastRunNameFilter], default:
None
)
–
Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names.
If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of the canaries, the request fails with a 403 response.
You are required to use the Names parameter if you are logged on to a user or role that has an IAM policy that restricts which canaries that you are allowed to view. For more information, see Limiting a user to viewing specific canaries.
-
browser_type
(Optional[BrowserType], default:
None
)
–
The type of browser to use for the canary run.
Raises:
Source code in docs_src/capo_synthetics/_services/synthetics.py
| def describe_canaries_last_run(
self,
*,
config_overrides: Optional[syntheticsClientConfig] = None,
next_token: Optional["capo_synthetics.types.token.Token"] = None,
max_results: Optional["capo_synthetics.types.max_size100.MaxSize100"] = None,
names: Optional[
"capo_synthetics.types.describe_canaries_last_run_name_filter.DescribeCanariesLastRunNameFilter"
] = None,
browser_type: Optional["capo_synthetics.types.browser_type.BrowserType"] = None,
) -> "capo_synthetics.types.describe_canaries_last_run_response.DescribeCanariesLastRunResponse":
"""<p>Use this operation to see information from the most recent run of each canary that you have created.</p> <p>This operation supports resource-level authorization using an IAM policy and the <code>Names</code> parameter. If you specify the <code>Names</code> parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of the canaries, the request fails with a 403 response.</p> <p>You are required to use the <code>Names</code> parameter if you are logged on to a user or role that has an IAM policy that restricts which canaries that you are allowed to view. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html"> Limiting a user to viewing specific canaries</a>.</p>
Args:
next_token: <p>A token that indicates that there is more data available. You can use this token in a subsequent <code>DescribeCanariesLastRun</code> operation to retrieve the next set of results.</p>
max_results: <p>Specify this parameter to limit how many runs are returned each time you use the <code>DescribeLastRun</code> operation. If you omit this parameter, the default of 100 is used.</p>
names: <p>Use this parameter to return only canaries that match the names that you specify here. You can specify as many as five canary names.</p> <p>If you specify this parameter, the operation is successful only if you have authorization to view all the canaries that you specify in your request. If you do not have permission to view any of the canaries, the request fails with a 403 response.</p> <p>You are required to use the <code>Names</code> parameter if you are logged on to a user or role that has an IAM policy that restricts which canaries that you are allowed to view. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html"> Limiting a user to viewing specific canaries</a>.</p>
browser_type: <p>The type of browser to use for the canary run.</p>
Raises:
capo_synthetics.errors.internal_server_exception.InternalServerException: <p>An unknown internal error occurred.</p>
capo_synthetics.errors.validation_exception.ValidationException: <p>A parameter could not be validated.</p>
capo_synthetics.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_synthetics.types.describe_canaries_last_run_request.DescribeCanariesLastRunRequest]",
) -> OperationResponse[
"capo_synthetics.types.describe_canaries_last_run_response.DescribeCanariesLastRunResponse"
]:
import capo_synthetics._operations.synthetics.describe_canaries_last_run
output, http_response = (
capo_synthetics._operations.synthetics.describe_canaries_last_run.describe_canaries_last_run(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeCanariesLastRun")
)
input_: capo_synthetics.types.describe_canaries_last_run_request.DescribeCanariesLastRunRequest = {}
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
if names is not None:
input_["names"] = names
if browser_type is not None:
input_["browser_type"] = browser_type
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|