list_aws_system_roles

ConsoleAccessApi.list_aws_system_roles(role_id, offset=None, limit=None, sortorder=None, sortby=None, projection_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

List AWS console access roles

Returns AWS console access roles (system and custom) from the console-access roles table. Requires role_id header (else AUTH-1001). Pagination via sort_page_in_code: offset is 1-based (converted to offset-1; omitted starts at 0); limit defaults to 100, max 500 (else IPV-1050). sortorder defaults to desc; sortby defaults to LastModifiedTime (value must be a string field on each item). Optional projectionExpression filters attributes. Response keys: roles, count, total_count, next_available (“yes” or “no”). Last page when next_available is “no”.

Parameters:
  • role_id (str) – Amorphic role ID used for authorization (is_user_action_valid). Missing returns AUTH-1001. (required)

  • offset (str) – 1-based page offset. Converted to offset-1. Omitted starts at index 0. Non-numeric values raise and return HTTP 500.

  • limit (str) – Page size. Default 100. Maximum 500 (PAGINATION_ITEMS_LIMIT); over max returns IPV-1050.

  • sortorder (str) – Sort direction. Default desc. Only the value desc enables descending; any other value sorts ascending.

  • sortby (str) – Field to sort by. Default LastModifiedTime. Must exist on items and support .lower() (string).

  • projection_expression (str) – Comma-separated attribute names to include on each role item. When omitted, all fields are returned.

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

AwsRolesList

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /aws-roles

Success (HTTP 200)

Paginated roles list (AwsRolesList). next_available is “yes” or “no”.

First page of roles

{
  "roles": [
    {
      "RoleId": "sys-readonly",
      "RoleName": "SystemRole-readonly",
      "RoleDescription": "Read-only console access",
      "RoleArn": "arn:aws:iam::123456789012:role/proj-dev-SystemRole-readonly",
      "UsersAttached": [
        "user1"
      ],
      "IsSystemGeneratedRole": true,
      "LastModifiedTime": "2024-06-01 12:00:00"
    }
  ],
  "count": 1,
  "total_count": 1,
  "next_available": "no"
}

Errors

Documented error codes: AUTH-1001, IPV-1050.

HTTP 400

Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: AUTH-1001 (missing role_id), IPV-1050 (limit > 500).

Missing role_id header

{
  "Message": "AUTH-1001 - Missing role information in event header"
}

limit greater than 500

{
  "Message": "IPV-1050 - Out of range for items per page, Limit is 500"
}

HTTP 500

Backend failure. Body is {“Message”: “…”}; generic Exception returns the exception string without a CODE prefix.

Unexpected failure

{
  "Message": "invalid literal for int() with base 10: 'abc'"
}