get_service_limits

ServiceLimitsApi.get_service_limits(role_id, service=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Get service quota limits and usage

Returns quota limit and usage for one service, or all services if service is omitted. Listing all also refreshes quota alarms. No role permission is checked; the caller must be a valid user. service=tenant-limits returns 204 when multitenancy is off; list-all omits that quota instead.

Parameters:
  • role_id (str) – Amorphic role ID recorded in audit logs. Not used for a permission check on this GET. (required)

  • service (str) – Quota to return. Matched case-insensitively. Omit to list all. Unknown values and an empty value return 500, not 400. Other query keys without service return GE-1034.

  • _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:

GetServiceLimitsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /limits/service-limits

Success (HTTP 200)

ServiceLimits is always present. AlarmThresholdPercentage is included only when listing all (SSM string). Usage is omitted for ssm-parameters on the list-all call. Message is set when CloudWatch has no datapoints for the last 3 hours.

All quotas (no service query)

{
  "AlarmThresholdPercentage": "80",
  "ServiceLimits": [
    {
      "QuotaName": "Event Rules",
      "Description": "Maximum number of rules an account can have per event bus",
      "Limit": 300,
      "Usage": 42
    },
    {
      "QuotaName": "SSM Parameters",
      "Description": "Maximum number of SSM Parameters that can be created in this account in the current region.",
      "Limit": 10000
    }
  ]
}

Single quota

{
  "ServiceLimits": [
    {
      "QuotaName": "Lambda Concurrency",
      "Description": "Maximum number of events that Lambda can process simultaneously in the current Region.",
      "Limit": 1000,
      "Usage": 120
    }
  ]
}

Success (HTTP 204)

service=tenant-limits and multitenancy is disabled. Body is still {“ServiceLimits”: [{}]}.

Request / response example

{
  "ServiceLimits": [
    {}
  ]
}

Errors

Documented error codes: GE-1060, GE-1034, AUTH-1001, AUTH-1030, RTE-1001.

HTTP 400

Invalid user or bad query. Body is {“Message”: “<CODE> - <text>”}. Codes: GE-1060 (user not valid), GE-1034 (query params present but service is missing). This GET does not return AUTH-1001 or AUTH-1030.

Caller is not a valid user

{
  "Message": "GE-1060 - User jane.doe is not valid user."
}

Other query keys without service

{
  "Message": "GE-1034 - Failed to process the api request, 'service' is required as a query parameter."
}

HTTP 500

Quota or usage lookup failure uses {“Message”: “GE-1034 - Unable to fetch service quota…”} or {“Message”: “GE-1034 - Unable to generate usage data with error - <text>”}. Unknown service and other uncaught errors use {“Message”: “RTE-1001 - <text>.”}. ClientError and InconsistentMetadataException also return 500.

Failed to read a service quota

{
  "Message": "GE-1034 - Unable to fetch service quota limits and usage error - An error occurred (AccessDeniedException) when calling the GetServiceQuota operation"
}

service is not a known quota key

{
  "Message": "RTE-1001 - 'ses-sending-rate'."
}