Skip to content

create_node async

create_node(
    cluster_id: __string,
    *,
    config_overrides: Optional[AsyncMediaLiveClientConfig] = None,
    name: Optional[__string] = None,
    node_interface_mappings: Optional[__listOfNodeInterfaceMappingCreateRequest] = None,
    request_id: Optional[__string] = None,
    role: Optional[NodeRole] = None,
    tags: Optional[Tags] = None,
) -> CreateNodeResponse

Create a Node in the specified Cluster. You can also create Nodes using the CreateNodeRegistrationScript. Note that you can't move a Node to another Cluster.

Parameters:

  • cluster_id (__string) –

    The ID of the cluster.

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

    The user-specified name of the Node to be created.

  • node_interface_mappings (Optional[__listOfNodeInterfaceMappingCreateRequest], default: None ) –

    Documentation update needed

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

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

  • role (Optional[NodeRole], default: None ) –

    The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.

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

    A collection of key-value pairs.

Raises:

Source code in docs_src/capo_medialive/_services/async_media_live.py
async def create_node(
    self,
    cluster_id: "capo_medialive.types.__string.__string",
    *,
    config_overrides: Optional[AsyncMediaLiveClientConfig] = None,
    name: Optional["capo_medialive.types.__string.__string"] = None,
    node_interface_mappings: Optional[
        "capo_medialive.types.__list_of_node_interface_mapping_create_request.__listOfNodeInterfaceMappingCreateRequest"
    ] = None,
    request_id: Optional["capo_medialive.types.__string.__string"] = None,
    role: Optional["capo_medialive.types.node_role.NodeRole"] = None,
    tags: Optional["capo_medialive.types.tags.Tags"] = None,
) -> "capo_medialive.types.create_node_response.CreateNodeResponse":
    """Create a Node in the specified Cluster. You can also create Nodes using the CreateNodeRegistrationScript. Note that you can't move a Node to another Cluster.

    Args:
        cluster_id: The ID of the cluster.
        name: The user-specified name of the Node to be created.
        node_interface_mappings: Documentation update needed
        request_id: An ID that you assign to a create request. This ID ensures idempotency when creating resources.
        role: The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_medialive.types.create_node_request.CreateNodeRequest]",
    ) -> AsyncOperationResponse[
        "capo_medialive.types.create_node_response.CreateNodeResponse"
    ]:
        import capo_medialive._operations.media_live.create_node

        (
            output,
            http_response,
        ) = await capo_medialive._operations.media_live.create_node.async_create_node(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateNode")
    )
    input_: capo_medialive.types.create_node_request.CreateNodeRequest = {
        "cluster_id": cluster_id
    }
    if name is not None:
        input_["name"] = name
    if node_interface_mappings is not None:
        input_["node_interface_mappings"] = node_interface_mappings
    if request_id is None:
        request_id = str(uuid.uuid4())
    input_["request_id"] = request_id
    if role is not None:
        input_["role"] = role
    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