Skip to content

create_channel_placement_group

create_channel_placement_group(
    cluster_id: __string,
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    name: Optional[__string] = None,
    nodes: Optional[__listOf__string] = None,
    request_id: Optional[__string] = None,
    tags: Optional[Tags] = None,
) -> CreateChannelPlacementGroupResponse

Create a ChannelPlacementGroup in the specified Cluster. As part of the create operation, you specify the Nodes to attach the group to.After you create a ChannelPlacementGroup, you add Channels to the group (you do this by modifying the Channels to add them to a specific group). You now have an association of Channels to ChannelPlacementGroup, and ChannelPlacementGroup to Nodes. This association means that all the Channels in the group are able to run on any of the Nodes associated with the group.

Parameters:

  • cluster_id (__string) –

    The ID of the cluster.

  • name (Optional[__string], default: None ) –

    Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.

  • nodes (Optional[__listOf__string], default: None ) –

    An array of one ID for the Node that you want to associate with the ChannelPlacementGroup. (You can't associate more than one Node with the ChannelPlacementGroup.) The Node and the ChannelPlacementGroup must be in the same Cluster.

  • request_id (Optional[__string], default: None ) –

    An ID that you assign to a create request. This ID ensures idempotency when creating resources. the request.

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

    A collection of key-value pairs.

Raises:

Source code in docs_src/capo_medialive/_services/media_live.py
def create_channel_placement_group(
    self,
    cluster_id: "capo_medialive.types.__string.__string",
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    name: Optional["capo_medialive.types.__string.__string"] = None,
    nodes: Optional[
        "capo_medialive.types.__list_of__string.__listOf__string"
    ] = None,
    request_id: Optional["capo_medialive.types.__string.__string"] = None,
    tags: Optional["capo_medialive.types.tags.Tags"] = None,
) -> "capo_medialive.types.create_channel_placement_group_response.CreateChannelPlacementGroupResponse":
    """Create a ChannelPlacementGroup in the specified Cluster. As part of the create operation, you specify the Nodes to attach the group to.After you create a ChannelPlacementGroup, you add Channels to the group (you do this by modifying the Channels to add them to a specific group). You now have an association of Channels to ChannelPlacementGroup, and ChannelPlacementGroup to Nodes. This association means that all the Channels in the group are able to run on any of the Nodes associated with the group.

    Args:
        cluster_id: The ID of the cluster.
        name: Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
        nodes: An array of one ID for the Node that you want to associate with the ChannelPlacementGroup. (You can't associate more than one Node with the ChannelPlacementGroup.) The Node and the ChannelPlacementGroup must be in the same Cluster.
        request_id: An ID that you assign to a create request. This ID ensures idempotency when creating resources. the request.
        tags: A collection of key-value pairs.

    Raises:
        capo_medialive.errors.bad_gateway_exception.BadGatewayException: Placeholder documentation for BadGatewayException
        capo_medialive.errors.bad_request_exception.BadRequestException: Placeholder documentation for BadRequestException
        capo_medialive.errors.forbidden_exception.ForbiddenException: Placeholder documentation for ForbiddenException
        capo_medialive.errors.gateway_timeout_exception.GatewayTimeoutException: Placeholder documentation for GatewayTimeoutException
        capo_medialive.errors.internal_server_error_exception.InternalServerErrorException: Placeholder documentation for InternalServerErrorException
        capo_medialive.errors.too_many_requests_exception.TooManyRequestsException: Placeholder documentation for TooManyRequestsException
        capo_medialive.errors.unprocessable_entity_exception.UnprocessableEntityException: Placeholder documentation for UnprocessableEntityException
        capo_medialive.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_medialive.types.create_channel_placement_group_request.CreateChannelPlacementGroupRequest]",
    ) -> OperationResponse[
        "capo_medialive.types.create_channel_placement_group_response.CreateChannelPlacementGroupResponse"
    ]:
        import capo_medialive._operations.media_live.create_channel_placement_group

        output, http_response = (
            capo_medialive._operations.media_live.create_channel_placement_group.create_channel_placement_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateChannelPlacementGroup")
    )
    input_: capo_medialive.types.create_channel_placement_group_request.CreateChannelPlacementGroupRequest = {
        "cluster_id": cluster_id
    }
    if name is not None:
        input_["name"] = name
    if nodes is not None:
        input_["nodes"] = nodes
    if request_id is None:
        request_id = str(uuid.uuid4())
    input_["request_id"] = request_id
    if tags is not None:
        input_["tags"] = tags

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