Skip to content

create_cluster_scheduler_config async

create_cluster_scheduler_config(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    name: Optional[EntityName] = None,
    cluster_arn: Optional[ClusterArn] = None,
    scheduler_config: Optional[SchedulerConfig] = None,
    description: Optional[EntityDescription] = None,
    tags: Optional[TagList] = None,
) -> CreateClusterSchedulerConfigResponse

Create cluster policy configuration. This policy is used for task prioritization and fair-share allocation of idle compute. This helps prioritize critical workloads and distributes idle compute across entities.

Parameters:

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

    The name for the cluster policy. The name must be unique within the SageMaker AI HyperPod cluster specified by ClusterArn. You can use the same name in other clusters within a Region or across Regions.

  • cluster_arn (Optional[ClusterArn], default: None ) –

    ARN of the cluster.

  • scheduler_config (Optional[SchedulerConfig], default: None ) –

    Configuration about the monitoring schedule.

  • description (Optional[EntityDescription], default: None ) –

    Description of the cluster policy.

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

    Tags of the cluster policy.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_cluster_scheduler_config(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    name: Optional["capo_sagemaker.types.entity_name.EntityName"] = None,
    cluster_arn: Optional["capo_sagemaker.types.cluster_arn.ClusterArn"] = None,
    scheduler_config: Optional[
        "capo_sagemaker.types.scheduler_config.SchedulerConfig"
    ] = None,
    description: Optional[
        "capo_sagemaker.types.entity_description.EntityDescription"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_cluster_scheduler_config_response.CreateClusterSchedulerConfigResponse":
    """<p>Create cluster policy configuration. This policy is used for task prioritization and fair-share allocation of idle compute. This helps prioritize critical workloads and distributes idle compute across entities.</p>

    Args:
        name: <p>The name for the cluster policy. The name must be unique within the SageMaker AI HyperPod cluster specified by <code>ClusterArn</code>. You can use the same name in other clusters within a Region or across Regions.</p>
        cluster_arn: <p>ARN of the cluster.</p>
        scheduler_config: <p>Configuration about the monitoring schedule.</p>
        description: <p>Description of the cluster policy.</p>
        tags: <p>Tags of the cluster policy.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_cluster_scheduler_config_request.CreateClusterSchedulerConfigRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_cluster_scheduler_config_response.CreateClusterSchedulerConfigResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_cluster_scheduler_config

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_cluster_scheduler_config.async_create_cluster_scheduler_config(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateClusterSchedulerConfig")
    )
    input_: capo_sagemaker.types.create_cluster_scheduler_config_request.CreateClusterSchedulerConfigRequest = {}
    if name is not None:
        input_["name"] = name
    if cluster_arn is not None:
        input_["cluster_arn"] = cluster_arn
    if scheduler_config is not None:
        input_["scheduler_config"] = scheduler_config
    if description is not None:
        input_["description"] = description
    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