update_space
async
¶
update_space(
space_id: SpaceId,
*,
config_overrides: Optional[AsyncOpenSearchMemoryClientConfig] = None,
memory_strategies: Optional[MemoryStrategyList] = None,
event_expiry_days: Optional[EventExpiryDays] = None,
memory_expiry_days: Optional[MemoryExpiryDays] = None,
extraction_model_id: Optional[ExtractionModelId] = None,
) -> UpdateSpaceResponse
Updates a space's memory strategies, retention settings, or extraction model. Supply only the fields to change. Omitted fields keep their current values.
If the request changes the set of strategies, a strategy's configuration, a retention setting, or the extraction model, the space moves to UPDATING. When the change is complete, the space returns to ACTIVE, or moves to FAILED if the change can't be applied. While the space is UPDATING, GetSpace returns the previous configuration. A request that only changes strategy descriptions or repeats the values the space has stored is applied immediately and doesn't change the status. Sending a retention value that the space never set also moves the space to UPDATING, even one that matches the behavior without it, such as 90 for eventExpiryDays or 0 for memoryExpiryDays. A space that is CREATING, UPDATING, or DELETING can't be updated: the request fails with ConflictException.
Parameters:
-
space_id(SpaceId) –The ID of the space to update.
-
memory_strategies(Optional[MemoryStrategyList], default:None) –The complete new list of memory strategies. The service removes strategies that aren't in the list from the space. Removing a strategy stops extraction for it but doesn't delete its memories: they're kept, until they expire if the space sets
memoryExpiryDays, and they're available again if you later add a strategy with the sametypeandname. To delete them, useDeleteMemorybefore you remove the strategy, or delete the space.To keep a strategy, include it with the same
typeandnamethatGetSpacereturns. For a kept strategy, anyconfigurationmember you omit keeps its current value. It doesn't return to the default, and you can't clear a member once it's set. Omit this field to leave the strategies unchanged. The list must name at least one strategy. You can't remove every strategy from a space withUpdateSpace.The serialized list can be at most 384 KiB.
-
event_expiry_days(Optional[EventExpiryDays], default:None) –How many days the space keeps each event, from 1 to 365. Omit it to leave the current value unchanged. Events already stored keep the expiry they were written with.
-
memory_expiry_days(Optional[MemoryExpiryDays], default:None) –How many days the space keeps each memory, from 0 to 3650. 0 means memories never expire. Omit it to leave the current value unchanged. You can't clear the setting. To make memories written from then on never expire, send 0.
GetSpacethen returns 0.A change applies to memories written after it. Memories already stored keep the expiry they were written with. A memory the service rewrites later, such as a summary it keeps up to date, takes the setting in force at that rewrite. A change moves the space to
UPDATING. Sending the value that the space has stored doesn't. -
extraction_model_id(Optional[ExtractionModelId], default:None) –The model that extracts and consolidates memories for every strategy in the space:
anthropic.claude-opus-5-5oranthropic.claude-haiku-5-5. Omit it to leave the current value unchanged. Once set, it can't be cleared back to the service default.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this operation. To use this operation, you must have AWS Identity and Access Management (IAM) permissions for the operation, and on the resource it acts on. If the space uses a customer managed AWS Key Management Service (AWS KMS) key, you must also have permission to use the key.
-
ConflictException–The request conflicts with the current state of the resource. For example, the space is being created, updated, or deleted, a space with the same name already exists, or you reused a client token with different parameters. Wait for the space to finish being created, updated, or deleted, or use a different name or client token, and then retry.
-
InternalServerException–The service couldn't process the request because of an internal error. Retry the request.
-
ResourceNotFoundException–The specified resource doesn't exist. Check the IDs in the request.
-
ServiceQuotaExceededException–The request would exceed a quota, such as the number of spaces in your account or the number of strategies in a space.
-
ThrottlingException–The service throttled the request. Retry the request with exponential backoff.
-
ValidationException–The request isn't valid. The
reason,message, andfieldListmembers describe the problem. Fix the request, and then try again. -
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_opensearchmemory/_services/async_open_search_memory.py
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 | |