get_memory
¶
get_memory(
space_id: SpaceId,
memory_id: MemoryId,
*,
config_overrides: Optional[OpenSearchMemoryClientConfig] = None,
actor_id: Optional[ActorId] = None,
strategy_name: Optional[StrategyName] = None,
) -> GetMemoryOutput
Gets a memory by ID, as returned by SearchMemories or ListMemories. A memory that doesn't exist returns ResourceNotFoundException. Unlike SearchMemories, this operation also returns memories that consolidation has superseded.
A memory past its expiry (set from the space's memoryExpiryDays when the memory is written) reads as not found: ResourceNotFoundException, the same answer as for an ID that does not exist.
If the space uses a customer managed AWS KMS key, the call can also fail because of the key. It fails with AccessDeniedException if you aren't allowed to use the key, and with ThrottlingException if AWS KMS throttles the request. It fails with ValidationException if the key is disabled, pending deletion, or deleted.
Parameters:
-
space_id(SpaceId) –The ID of the space that holds the memory.
-
memory_id(MemoryId) –The memory's ID, as returned by
SearchMemoriesorListMemories. -
actor_id(Optional[ActorId], default:None) –The ID of the actor the memory must belong to. Omit it to skip this check. If it doesn't match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist. -
strategy_name(Optional[StrategyName], default:None) –The name of the strategy the memory must belong to. Omit it to skip this check. If it doesn't match the stored memory, the call fails with
ResourceNotFoundException, as if the memory did not exist.
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.
-
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.
-
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/open_search_memory.py
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 | |