Skip to content

create_performance_monitor async

create_performance_monitor(
    monitor_name: ResourceName,
    targets: PerformanceMonitorTargets,
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    scope_arn: Optional[Arn] = None,
    client_token: Optional[UuidString] = None,
    tags: Optional[TagMap] = None,
) -> CreatePerformanceMonitorOutput

Create a performance monitor to monitor the traffic of the Amazon Virtual Private Clouds (VPCs) that you specify as targets, to determine whether the Amazon Web Services network is causing issues for your workloads. With a performance monitor, you can identify network degradation across paths between Availability Zones and across Amazon Web Services Regions.

Parameters:

  • monitor_name (ResourceName) –

    The name of the performance monitor.

  • scope_arn (Optional[Arn], default: None ) –

    The Amazon Resource Name (ARN) of the scope for the performance monitor.

  • targets (PerformanceMonitorTargets) –

    The resources to monitor. Each target identifies a resource, currently a VPC, for which you can track network performance. For a VPC, specify the VPC ARN.

  • client_token (Optional[UuidString], default: None ) –

    A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. If the token matches a previous request, the service ignores the request without returning an error. Don't reuse the same client token for other API requests.

  • tags (Optional[TagMap], default: None ) –

    The tags for a performance monitor. You can add a maximum of 200 tags.

Raises:

Source code in docs_src/capo_networkflowmonitor/_services/async_network_flow_monitor.py
async def create_performance_monitor(
    self,
    monitor_name: "capo_networkflowmonitor.types.resource_name.ResourceName",
    targets: "capo_networkflowmonitor.types.performance_monitor_targets.PerformanceMonitorTargets",
    *,
    config_overrides: Optional[AsyncNetworkFlowMonitorClientConfig] = None,
    scope_arn: Optional["capo_networkflowmonitor.types.arn.Arn"] = None,
    client_token: Optional[
        "capo_networkflowmonitor.types.uuid_string.UuidString"
    ] = None,
    tags: Optional["capo_networkflowmonitor.types.tag_map.TagMap"] = None,
) -> "capo_networkflowmonitor.types.create_performance_monitor_output.CreatePerformanceMonitorOutput":
    """<p>Create a performance monitor to monitor the traffic of the Amazon Virtual Private Clouds (VPCs) that you specify as targets, to determine whether the Amazon Web Services network is causing issues for your workloads. With a performance monitor, you can identify network degradation across paths between Availability Zones and across Amazon Web Services Regions.</p>

    Args:
        monitor_name: <p>The name of the performance monitor.</p>
        scope_arn: <p>The Amazon Resource Name (ARN) of the scope for the performance monitor.</p>
        targets: <p>The resources to monitor. Each target identifies a resource, currently a VPC, for which you can track network performance. For a VPC, specify the VPC ARN.</p>
        client_token: <p>A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. If the token matches a previous request, the service ignores the request without returning an error. Don't reuse the same client token for other API requests.</p>
        tags: <p>The tags for a performance monitor. You can add a maximum of 200 tags.</p>

    Raises:
        capo_networkflowmonitor.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_networkflowmonitor.errors.conflict_exception.ConflictException: <p>The requested resource is in use.</p>
        capo_networkflowmonitor.errors.internal_server_exception.InternalServerException: <p>An internal error occurred.</p>
        capo_networkflowmonitor.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeded a service quota.</p>
        capo_networkflowmonitor.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkflowmonitor.errors.validation_exception.ValidationException: <p>Invalid request.</p>
        capo_networkflowmonitor.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkflowmonitor.types.create_performance_monitor_input.CreatePerformanceMonitorInput]",
    ) -> AsyncOperationResponse[
        "capo_networkflowmonitor.types.create_performance_monitor_output.CreatePerformanceMonitorOutput"
    ]:
        import capo_networkflowmonitor._operations.network_flow_monitor.create_performance_monitor

        (
            output,
            http_response,
        ) = await capo_networkflowmonitor._operations.network_flow_monitor.create_performance_monitor.async_create_performance_monitor(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePerformanceMonitor")
    )
    input_: capo_networkflowmonitor.types.create_performance_monitor_input.CreatePerformanceMonitorInput = {
        "monitor_name": monitor_name,
        "targets": targets,
    }
    if scope_arn is not None:
        input_["scope_arn"] = scope_arn
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output