Skip to content

update_traffic_distribution

update_traffic_distribution(
    id: TrafficDistributionGroupIdOrArn,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    telephony_config: Optional[TelephonyConfig] = None,
    sign_in_config: Optional[SignInConfig] = None,
    agent_config: Optional[AgentConfig] = None,
) -> UpdateTrafficDistributionResponse

Updates the traffic distribution for a given traffic distribution group.

When you shift telephony traffic, also shift agents and/or agent sign-ins to ensure they can handle the calls in the other Region. If you don't shift the agents, voice calls will go to the shifted Region but there won't be any agents available to receive the calls.

The SignInConfig distribution is available only on a default TrafficDistributionGroup (see the IsDefault parameter in the TrafficDistributionGroup data type). If you call UpdateTrafficDistribution with a modified SignInConfig and a non-default TrafficDistributionGroup, an InvalidRequestException is returned.

For more information about updating a traffic distribution group, see Update telephony traffic distribution across Amazon Web Services Regions in the Connect Customer Administrator Guide.

Important things to know

  • Invoke the UpdateTrafficDistribution API in the region that should handle traffic.

Parameters:

  • id (TrafficDistributionGroupIdOrArn) –

    The identifier of the traffic distribution group. This can be the ID or the ARN if the API is being called in the Region where the traffic distribution group was created. The ARN must be provided if the call is from the replicated Region.

  • telephony_config (Optional[TelephonyConfig], default: None ) –

    The distribution of traffic between the instance and its replica(s).

  • sign_in_config (Optional[SignInConfig], default: None ) –

    The distribution that determines which Amazon Web Services Regions should be used to sign in agents in to both the instance and its replica(s).

  • agent_config (Optional[AgentConfig], default: None ) –

    The distribution of agents between the instance and its replica(s).

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def update_traffic_distribution(
    self,
    id: "capo_connect.types.traffic_distribution_group_id_or_arn.TrafficDistributionGroupIdOrArn",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    telephony_config: Optional[
        "capo_connect.types.telephony_config.TelephonyConfig"
    ] = None,
    sign_in_config: Optional[
        "capo_connect.types.sign_in_config.SignInConfig"
    ] = None,
    agent_config: Optional["capo_connect.types.agent_config.AgentConfig"] = None,
) -> "capo_connect.types.update_traffic_distribution_response.UpdateTrafficDistributionResponse":
    """<p>Updates the traffic distribution for a given traffic distribution group. </p> <important> <p>When you shift telephony traffic, also shift agents and/or agent sign-ins to ensure they can handle the calls in the other Region. If you don't shift the agents, voice calls will go to the shifted Region but there won't be any agents available to receive the calls.</p> </important> <note> <p>The <code>SignInConfig</code> distribution is available only on a default <code>TrafficDistributionGroup</code> (see the <code>IsDefault</code> parameter in the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_TrafficDistributionGroup.html">TrafficDistributionGroup</a> data type). If you call <code>UpdateTrafficDistribution</code> with a modified <code>SignInConfig</code> and a non-default <code>TrafficDistributionGroup</code>, an <code>InvalidRequestException</code> is returned.</p> </note> <p>For more information about updating a traffic distribution group, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/update-telephony-traffic-distribution.html">Update telephony traffic distribution across Amazon Web Services Regions </a> in the <i>Connect Customer Administrator Guide</i>. </p> <p> <b>Important things to know</b> </p> <ul> <li> <p>Invoke the UpdateTrafficDistribution API in the region that should handle traffic.</p> </li> </ul>

    Args:
        id: <p>The identifier of the traffic distribution group. This can be the ID or the ARN if the API is being called in the Region where the traffic distribution group was created. The ARN must be provided if the call is from the replicated Region. </p>
        telephony_config: <p>The distribution of traffic between the instance and its replica(s).</p>
        sign_in_config: <p>The distribution that determines which Amazon Web Services Regions should be used to sign in agents in to both the instance and its replica(s).</p>
        agent_config: <p>The distribution of agents between the instance and its replica(s).</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_conflict_exception.ResourceConflictException: <p>A resource already has that name.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.update_traffic_distribution_request.UpdateTrafficDistributionRequest]",
    ) -> OperationResponse[
        "capo_connect.types.update_traffic_distribution_response.UpdateTrafficDistributionResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.update_traffic_distribution

        output, http_response = (
            capo_connect._operations.amazon_connect_service.update_traffic_distribution.update_traffic_distribution(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTrafficDistribution")
    )
    input_: capo_connect.types.update_traffic_distribution_request.UpdateTrafficDistributionRequest = {
        "id": id
    }
    if telephony_config is not None:
        input_["telephony_config"] = telephony_config
    if sign_in_config is not None:
        input_["sign_in_config"] = sign_in_config
    if agent_config is not None:
        input_["agent_config"] = agent_config

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