Skip to content

attach_cluster_node_network_interface

attach_cluster_node_network_interface(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_name: Optional[ClusterNameOrArn] = None,
    node_id: Optional[ClusterNodeId] = None,
    network_interface_id: Optional[ClusterNetworkInterfaceId] = None,
) -> AttachClusterNodeNetworkInterfaceResponse

Attaches an elastic network interface (ENI) to a node in a HyperPod cluster.

To use this operation, you must have the sagemaker:AttachClusterNodeNetworkInterface permission.

Parameters:

  • cluster_name (Optional[ClusterNameOrArn], default: None ) –

    The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster that contains the target node.

  • node_id (Optional[ClusterNodeId], default: None ) –

    The unique identifier of the cluster node to which you want to attach the network interface. The node must belong to your specified HyperPod cluster and cannot be part of a Restricted Instance Group (RIG).

  • network_interface_id (Optional[ClusterNetworkInterfaceId], default: None ) –

    The unique identifier of the elastic network interface (ENI) to attach.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def attach_cluster_node_network_interface(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    cluster_name: Optional[
        "capo_sagemaker.types.cluster_name_or_arn.ClusterNameOrArn"
    ] = None,
    node_id: Optional["capo_sagemaker.types.cluster_node_id.ClusterNodeId"] = None,
    network_interface_id: Optional[
        "capo_sagemaker.types.cluster_network_interface_id.ClusterNetworkInterfaceId"
    ] = None,
) -> "capo_sagemaker.types.attach_cluster_node_network_interface_response.AttachClusterNodeNetworkInterfaceResponse":
    """<p> Attaches an elastic network interface (ENI) to a node in a HyperPod cluster. </p> <p> To use this operation, you must have the <code>sagemaker:AttachClusterNodeNetworkInterface</code> permission. </p>

    Args:
        cluster_name: <p> The name or Amazon Resource Name (ARN) of the SageMaker HyperPod cluster that contains the target node. </p>
        node_id: <p> The unique identifier of the cluster node to which you want to attach the network interface. The node must belong to your specified HyperPod cluster and cannot be part of a Restricted Instance Group (RIG). </p>
        network_interface_id: <p> The unique identifier of the elastic network interface (ENI) to attach. </p>

    Raises:
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.attach_cluster_node_network_interface_request.AttachClusterNodeNetworkInterfaceRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.attach_cluster_node_network_interface_response.AttachClusterNodeNetworkInterfaceResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.attach_cluster_node_network_interface

        output, http_response = (
            capo_sagemaker._operations.sage_maker.attach_cluster_node_network_interface.attach_cluster_node_network_interface(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AttachClusterNodeNetworkInterface")
    )
    input_: capo_sagemaker.types.attach_cluster_node_network_interface_request.AttachClusterNodeNetworkInterfaceRequest = {}
    if cluster_name is not None:
        input_["cluster_name"] = cluster_name
    if node_id is not None:
        input_["node_id"] = node_id
    if network_interface_id is not None:
        input_["network_interface_id"] = network_interface_id

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