Skip to content

create_cluster

create_cluster(
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    cluster_type: Optional[ClusterType] = None,
    instance_role_arn: Optional[__string] = None,
    name: Optional[__string] = None,
    network_settings: Optional[ClusterNetworkSettingsCreateRequest] = None,
    request_id: Optional[__string] = None,
    tags: Optional[Tags] = None,
) -> CreateClusterResponse

Create a new Cluster.

Parameters:

  • cluster_type (Optional[ClusterType], default: None ) –

    Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.

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

    The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.

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

    Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.

  • network_settings (Optional[ClusterNetworkSettingsCreateRequest], default: None ) –

    Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.

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

    The unique ID of 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_cluster(
    self,
    *,
    config_overrides: Optional[MediaLiveClientConfig] = None,
    cluster_type: Optional["capo_medialive.types.cluster_type.ClusterType"] = None,
    instance_role_arn: Optional["capo_medialive.types.__string.__string"] = None,
    name: Optional["capo_medialive.types.__string.__string"] = None,
    network_settings: Optional[
        "capo_medialive.types.cluster_network_settings_create_request.ClusterNetworkSettingsCreateRequest"
    ] = None,
    request_id: Optional["capo_medialive.types.__string.__string"] = None,
    tags: Optional["capo_medialive.types.tags.Tags"] = None,
) -> "capo_medialive.types.create_cluster_response.CreateClusterResponse":
    """Create a new Cluster.

    Args:
        cluster_type: Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.
        instance_role_arn: The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.
        name: Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.
        network_settings: Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.
        request_id: The unique ID of 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.conflict_exception.ConflictException: Placeholder documentation for ConflictException
        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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_medialive.types.create_cluster_request.CreateClusterRequest]",
    ) -> OperationResponse[
        "capo_medialive.types.create_cluster_response.CreateClusterResponse"
    ]:
        import capo_medialive._operations.media_live.create_cluster

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCluster")
    )
    input_: capo_medialive.types.create_cluster_request.CreateClusterRequest = {}
    if cluster_type is not None:
        input_["cluster_type"] = cluster_type
    if instance_role_arn is not None:
        input_["instance_role_arn"] = instance_role_arn
    if name is not None:
        input_["name"] = name
    if network_settings is not None:
        input_["network_settings"] = network_settings
    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