set_service_quota_alarm_threshold¶
- ServiceLimitsApi.set_service_quota_alarm_threshold(role_id, update_service_limits_request, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Set service quota alarm threshold
Writes the quota-alarm threshold percent to SSM. Requires system-settings.manage and a valid user. Missing or out-of-range AlarmThresholdPercentage is caught and returned as 500 GE-1034, not 400.
- Parameters:
role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Also recorded in audit logs. (required)
update_service_limits_request (UpdateServiceLimitsRequest) – (required)
_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 /limits/service-limits
Request¶
Request / response example
{
"AlarmThresholdPercentage": 80
}
Success (HTTP 200)¶
Threshold was written to SSM.
Request / response example
{
"Message": "Successfully updated service quota alarm threshold."
}
Errors¶
Documented error codes: AUTH-1001, AUTH-1003, AUTH-1030, IPV-1002, GE-1060, IPV-1008, IPV-1004, GE-1034, RTE-1001.
HTTP 400
Authorization or user failure. Body is {“Message”: “<CODE> - <text>”}. Codes: AUTH-1001 (missing role_id), AUTH-1003 (user not on role), AUTH-1030 (missing system-settings.manage), IPV-1002 (role_id not found), GE-1060 (user not valid). IPV-1008 and IPV-1004 are not returned as 400; they are wrapped into 500 GE-1034.
role_id header missing
{
"Message": "AUTH-1001 - Missing role information in event header"
}
User is not attached to the role
{
"Message": "AUTH-1003 - User is not authorized to use Role - AdminRole"
}
Caller lacks system-settings.manage
{
"Message": "AUTH-1030 - User is not authorized to set service quota limit alarm threshold due to the following missing permission(s) - {'System Settings': ['manage']}"
}
role_id does not exist
{
"Message": "IPV-1002 - Invalid RoleId - role-123, resource not found."
}
Caller is not a valid user
{
"Message": "GE-1060 - User jane.doe is not valid user."
}
HTTP 500
Body validation and SSM failures use {“Message”: “GE-1034 - Unable to update the service quota alarm threshold with error - <text>”}. That includes wrapped IPV-1008 (missing key) and IPV-1004 (not 1-99). Invalid JSON and other uncaught errors use {“Message”: “RTE-1001 - <text>.”}.
AlarmThresholdPercentage missing (wrapped)
{
"Message": "GE-1034 - Unable to update the service quota alarm threshold with error - IPV-1008 - Invalid request body, missing key(s) - AlarmThresholdPercentage"
}
Threshold not in 1-99 (wrapped)
{
"Message": "GE-1034 - Unable to update the service quota alarm threshold with error - IPV-1004 - Invalid parameter - AlarmThresholdPercentage, the field value must satisfy these requirements: Must have value in 1-99"
}
Request body is not valid JSON
{
"Message": "RTE-1001 - Expecting value: line 1 column 1 (char 0)."
}