GET /api/filters
List all filters

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, ‘all’ to return all results

Validations:

  • Must match regular expression /\A([1-9]\d|all)\Z$/.

Search fields

Field name Type Possible values
limited true, false
location string
location_id integer
organization string
organization_id integer
override true, false
permission string
resource string
role string
role_id integer
search text
unlimited true, false

GET /api/filters/:id
Show a filter

Examples

GET /api/filters/321349837
200
{
  "search": null,
  "resource_type": "Architecture",
  "resource_type_label": "Architecture",
  "unlimited?": true,
  "created_at": "2020-05-20 13:44:29 UTC",
  "updated_at": "2020-05-20 13:44:29 UTC",
  "override?": false,
  "id": 321349837,
  "role": {
    "name": "Manager",
    "id": 1,
    "description": null,
    "origin": "foreman"
  },
  "permissions": [
    {
      "name": "view_architectures",
      "id": 350275019,
      "resource_type": "Architecture"
    },
    {
      "name": "create_architectures",
      "id": 912770095,
      "resource_type": "Architecture"
    },
    {
      "name": "edit_architectures",
      "id": 874798611,
      "resource_type": "Architecture"
    },
    {
      "name": "destroy_architectures",
      "id": 586604735,
      "resource_type": "Architecture"
    }
  ],
  "locations": [],
  "organizations": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/filters
Create a filter

Examples

POST /api/filters
{
  "filter": {
    "role_id": 8,
    "permission_ids": [
      135202335
    ],
    "organization_ids": [
      447626439
    ],
    "override": true
  }
}
201
{
  "search": null,
  "resource_type": "Medium",
  "resource_type_label": "Medium",
  "unlimited?": true,
  "created_at": "2020-11-04 14:59:40 UTC",
  "updated_at": "2020-11-04 14:59:40 UTC",
  "override?": true,
  "id": 1062414188,
  "role": {
    "name": "Destroy hosts",
    "id": 8,
    "description": null,
    "origin": ""
  },
  "permissions": [
    {
      "name": "view_media",
      "id": 135202335,
      "resource_type": "Medium"
    }
  ],
  "locations": [],
  "organizations": [
    {
      "id": 447626439,
      "name": "org13",
      "title": "org13",
      "description": null
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

filter
required

Validations:

  • Must be a Hash

filter[role_id]
required

Validations:

  • Must be a String

filter[search]
optional , nil allowed

Validations:

  • Must be a String

filter[override]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

filter[permission_ids]
optional , nil allowed

Validations:

  • Must be an array of any type

filter[organization_ids]
optional , nil allowed

Validations:

  • Must be an array of any type

filter[location_ids]
optional , nil allowed

Validations:

  • Must be an array of any type


PUT /api/filters/:id
Update a filter

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a String

filter
required

Validations:

  • Must be a Hash

filter[role_id]
optional

Validations:

  • Must be a String

filter[search]
optional , nil allowed

Validations:

  • Must be a String

filter[override]
optional , nil allowed

Validations:

  • Must be one of: true, false, 1, 0.

filter[permission_ids]
optional , nil allowed

Validations:

  • Must be an array of any type

filter[organization_ids]
optional , nil allowed

Validations:

  • Must be an array of any type

filter[location_ids]
optional , nil allowed

Validations:

  • Must be an array of any type


DELETE /api/filters/:id
Delete a filter

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be a String