update_logs_retention_period¶
- LogsRetentionPeriodApi.update_logs_retention_period(period, role_id=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Update system logs retention period
Writes the logs retention period to SSM. No role permission is required. role_id is still required (AUTH-1001). Takes effect within a day. No request body; period is a query parameter.
- Parameters:
period (str) – Retention value to store. Must be one of the allowed strings (including N/A). Missing → IPV-1052. Other values → IPV-1041. API Gateway sends this as a string. (required)
role_id (str) – Amorphic role ID recorded in audit logs. Missing this header returns AUTH-1001. Not used for a permission check.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: PUT /logs-retention-period
Success (HTTP 200)¶
SSM parameter was updated.
Request / response example
{
"Message": "System logs retention period updated. It will be applied to logs within a day"
}
Errors¶
Documented error codes: AUTH-1001, IPV-1052, IPV-1041, AUTH-1030, RTE-1001.
HTTP 400
Validation, auth, or GenericFailureException. Body is {“Message”: “<CODE> - <text>”}. Codes: AUTH-1001 (missing role_id), IPV-1052 (missing period), IPV-1041 (period not in the allow-list). This PUT does not return AUTH-1030.
role_id header missing
{
"Message": "AUTH-1001 - Missing role information in event header"
}
period query missing
{
"Message": "IPV-1052 - Missing mandatory parameter(s) period in queryStringParameters/pathParameters"
}
period is not an allowed value
{
"Message": "IPV-1041 - Invalid parameter - period, allowed values/keys are ['N/A', '60', '90', '120', '150', '180', '365', '400', '545', '731', '1827', '2192', '2557', '2922', '3288', '3653']"
}
HTTP 500
InconsistentMetadataException uses {“Message”: “<CODE> - <text>”}. Other uncaught errors use {“Message”: “RTE-1001 - <text>.”}.
Uncaught handler failure
{
"Message": "RTE-1001 - An error occurred (ParameterNotFound) when calling the PutParameter operation."
}