Skip to content

create_node_registration_script async

create_node_registration_script(
    cluster_id: __string,
    *,
    config_overrides: Optional[AsyncMediaLiveClientConfig] = None,
    id: Optional[__string] = None,
    name: Optional[__string] = None,
    node_interface_mappings: Optional[__listOfNodeInterfaceMapping] = None,
    request_id: Optional[__string] = None,
    role: Optional[NodeRole] = None,
) -> CreateNodeRegistrationScriptResponse

Create the Register Node script for all the nodes intended for a specific Cluster. You will then run the script on each hardware unit that is intended for that Cluster. The script creates a Node in the specified Cluster. It then binds the Node to this hardware unit, and activates the node hardware for use with MediaLive Anywhere.

Parameters:

  • cluster_id (__string) –

    The ID of the cluster

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

    If you're generating a re-registration script for an already existing node, this is where you provide the id.

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

    Specify a pattern for MediaLive Anywhere to use to assign a name to each Node in the Cluster. The pattern can include the variables $hn (hostname of the node hardware) and $ts for the date and time that the Node is created, in UTC (for example, 2024-08-20T23:35:12Z).

  • node_interface_mappings (Optional[__listOfNodeInterfaceMapping], 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.

Raises:

Source code in docs_src/capo_medialive/_services/async_media_live.py
async def create_node_registration_script(
    self,
    cluster_id: "capo_medialive.types.__string.__string",
    *,
    config_overrides: Optional[AsyncMediaLiveClientConfig] = None,
    id: Optional["capo_medialive.types.__string.__string"] = None,
    name: Optional["capo_medialive.types.__string.__string"] = None,
    node_interface_mappings: Optional[
        "capo_medialive.types.__list_of_node_interface_mapping.__listOfNodeInterfaceMapping"
    ] = None,
    request_id: Optional["capo_medialive.types.__string.__string"] = None,
    role: Optional["capo_medialive.types.node_role.NodeRole"] = None,
) -> "capo_medialive.types.create_node_registration_script_response.CreateNodeRegistrationScriptResponse":
    """Create the Register Node script for all the nodes intended for a specific Cluster. You will then run the script on each hardware unit that is intended for that Cluster. The script creates a Node in the specified Cluster. It then binds the Node to this hardware unit, and activates the node hardware for use with MediaLive Anywhere.

    Args:
        cluster_id: The ID of the cluster
        id: If you're generating a re-registration script for an already existing node, this is where you provide the id.
        name: Specify a pattern for MediaLive Anywhere to use to assign a name to each Node in the Cluster. The pattern can include the variables $hn (hostname of the node hardware) and $ts for the date and time that the Node is created, in UTC (for example, 2024-08-20T23:35:12Z).
        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.

    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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_medialive.types.create_node_registration_script_request.CreateNodeRegistrationScriptRequest]",
    ) -> AsyncOperationResponse[
        "capo_medialive.types.create_node_registration_script_response.CreateNodeRegistrationScriptResponse"
    ]:
        import capo_medialive._operations.media_live.create_node_registration_script

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateNodeRegistrationScript")
    )
    input_: capo_medialive.types.create_node_registration_script_request.CreateNodeRegistrationScriptRequest = {
        "cluster_id": cluster_id
    }
    if id is not None:
        input_["id"] = 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

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