Skip to content

update_collection_group

update_collection_group(
    id: CollectionGroupId,
    *,
    config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
    description: Optional[str] = None,
    capacity_limits: Optional[CollectionGroupCapacityLimits] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateCollectionGroupResponse

Updates the description and capacity limits of a collection group.

Parameters:

  • id (CollectionGroupId) –

    The unique identifier of the collection group to update.

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

    A new description for the collection group.

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

    Updated capacity limits for the collection group, in OpenSearch Compute Units (OCUs).

  • client_token (Optional[ClientToken], default: None ) –

    Unique, case-sensitive identifier to ensure idempotency of the request.

Raises:

  • ConflictException –

    When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.

  • InternalServerException –

    Thrown when an error internal to the service occurs while processing a request.

  • ServiceQuotaExceededException –

    Thrown when you attempt to create more resources than the service allows based on service quotas.

  • ValidationException –

    Thrown when the HTTP request contains invalid input or is missing required input.

  • UnknownServiceError –

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

Source code in docs_src/capo_opensearchserverless/_services/open_search_serverless.py
def update_collection_group(
    self,
    id: "capo_opensearchserverless.types.collection_group_id.CollectionGroupId",
    *,
    config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
    description: Optional[str] = None,
    capacity_limits: Optional[
        "capo_opensearchserverless.types.collection_group_capacity_limits.CollectionGroupCapacityLimits"
    ] = None,
    client_token: Optional[
        "capo_opensearchserverless.types.client_token.ClientToken"
    ] = None,
) -> "capo_opensearchserverless.types.update_collection_group_response.UpdateCollectionGroupResponse":
    """<p>Updates the description and capacity limits of a collection group.</p>

    Args:
        id: <p>The unique identifier of the collection group to update.</p>
        description: <p>A new description for the collection group.</p>
        capacity_limits: <p>Updated capacity limits for the collection group, in OpenSearch Compute Units (OCUs).</p>
        client_token: <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>

    Raises:
        capo_opensearchserverless.errors.conflict_exception.ConflictException: <p>When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.</p>
        capo_opensearchserverless.errors.internal_server_exception.InternalServerException: <p>Thrown when an error internal to the service occurs while processing a request.</p>
        capo_opensearchserverless.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Thrown when you attempt to create more resources than the service allows based on service quotas.</p>
        capo_opensearchserverless.errors.validation_exception.ValidationException: <p>Thrown when the HTTP request contains invalid input or is missing required input.</p>
        capo_opensearchserverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_opensearchserverless.types.update_collection_group_request.UpdateCollectionGroupRequest]",
    ) -> OperationResponse[
        "capo_opensearchserverless.types.update_collection_group_response.UpdateCollectionGroupResponse"
    ]:
        import capo_opensearchserverless._operations.open_search_serverless.update_collection_group

        output, http_response = (
            capo_opensearchserverless._operations.open_search_serverless.update_collection_group.update_collection_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCollectionGroup")
    )
    input_: capo_opensearchserverless.types.update_collection_group_request.UpdateCollectionGroupRequest = {
        "id": id
    }
    if description is not None:
        input_["description"] = description
    if capacity_limits is not None:
        input_["capacity_limits"] = capacity_limits
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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