Skip to content

create_quota_share

create_quota_share(
    *,
    config_overrides: Optional[BatchClientConfig] = None,
    quota_share_name: Optional[String] = None,
    job_queue: Optional[String] = None,
    capacity_limits: Optional[QuotaShareCapacityLimits] = None,
    resource_sharing_configuration: Optional[
        QuotaShareResourceSharingConfiguration
    ] = None,
    preemption_configuration: Optional[QuotaSharePreemptionConfiguration] = None,
    state: Optional[QuotaShareState] = None,
    tags: Optional[TagrisTagsMap] = None,
) -> CreateQuotaShareResponse

Creates an Batch quota share. Each quota share operates as a virtual queue with a configured compute capacity, resource sharing strategy, and borrow limits.

Parameters:

  • quota_share_name (Optional[String], default: None ) –

    The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).

  • job_queue (Optional[String], default: None ) –

    The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the VALID state before you can associate it with a quota share.

  • capacity_limits (Optional[QuotaShareCapacityLimits], default: None ) –

    A list that specifies the quantity and type of compute capacity allocated to the quota share.

  • resource_sharing_configuration (Optional[QuotaShareResourceSharingConfiguration], default: None ) –

    Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.

  • preemption_configuration (Optional[QuotaSharePreemptionConfiguration], default: None ) –

    Specifies the preemption behavior for jobs in a quota share.

  • state (Optional[QuotaShareState], default: None ) –

    The state of the quota share. If the quota share is ENABLED, it is able to accept jobs. If the quota share is DISABLED, new jobs won't be accepted but jobs already submitted can finish. The default state is ENABLED.

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

    The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see Tagging your Batch resources in Batch User Guide.

Raises:

  • ClientException –

    These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.

  • ServerException –

    These errors are usually caused by a server issue.

  • UnknownServiceError –

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

Source code in docs_src/capo_batch/_services/batch.py
def create_quota_share(
    self,
    *,
    config_overrides: Optional[BatchClientConfig] = None,
    quota_share_name: Optional["capo_batch.types.string.String"] = None,
    job_queue: Optional["capo_batch.types.string.String"] = None,
    capacity_limits: Optional[
        "capo_batch.types.quota_share_capacity_limits.QuotaShareCapacityLimits"
    ] = None,
    resource_sharing_configuration: Optional[
        "capo_batch.types.quota_share_resource_sharing_configuration.QuotaShareResourceSharingConfiguration"
    ] = None,
    preemption_configuration: Optional[
        "capo_batch.types.quota_share_preemption_configuration.QuotaSharePreemptionConfiguration"
    ] = None,
    state: Optional["capo_batch.types.quota_share_state.QuotaShareState"] = None,
    tags: Optional["capo_batch.types.tagris_tags_map.TagrisTagsMap"] = None,
) -> "capo_batch.types.create_quota_share_response.CreateQuotaShareResponse":
    """<p>Creates an Batch quota share. Each quota share operates as a virtual queue with a configured compute capacity, resource sharing strategy, and borrow limits. </p>

    Args:
        quota_share_name: <p>The name of the quota share. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).</p>
        job_queue: <p>The Batch job queue associated with the quota share. This can be the job queue name or ARN. A job queue must be in the <code>VALID</code> state before you can associate it with a quota share.</p>
        capacity_limits: <p>A list that specifies the quantity and type of compute capacity allocated to the quota share. </p>
        resource_sharing_configuration: <p>Specifies whether a quota share reserves, lends, or both lends and borrows idle compute capacity.</p>
        preemption_configuration: <p>Specifies the preemption behavior for jobs in a quota share.</p>
        state: <p>The state of the quota share. If the quota share is <code>ENABLED</code>, it is able to accept jobs. If the quota share is <code>DISABLED</code>, new jobs won't be accepted but jobs already submitted can finish. The default state is <code>ENABLED</code>.</p>
        tags: <p>The tags that you apply to the quota share to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a> in <i>Batch User Guide</i>.</p>

    Raises:
        capo_batch.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.</p>
        capo_batch.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
        capo_batch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_batch.types.create_quota_share_request.CreateQuotaShareRequest]",
    ) -> OperationResponse[
        "capo_batch.types.create_quota_share_response.CreateQuotaShareResponse"
    ]:
        import capo_batch._operations.aws_batch_v20160810.create_quota_share

        output, http_response = (
            capo_batch._operations.aws_batch_v20160810.create_quota_share.create_quota_share(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateQuotaShare")
    )
    input_: capo_batch.types.create_quota_share_request.CreateQuotaShareRequest = {}
    if quota_share_name is not None:
        input_["quota_share_name"] = quota_share_name
    if job_queue is not None:
        input_["job_queue"] = job_queue
    if capacity_limits is not None:
        input_["capacity_limits"] = capacity_limits
    if resource_sharing_configuration is not None:
        input_["resource_sharing_configuration"] = resource_sharing_configuration
    if preemption_configuration is not None:
        input_["preemption_configuration"] = preemption_configuration
    if state is not None:
        input_["state"] = state
    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