GET /api/filters
Listar todos os filtros

Exemplos

GET /api/filters
200
{
  "total": 63,
  "subtotal": 63,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "search": null,
      "resource_type": "Architecture",
      "resource_type_label": "Architecture",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 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"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "AuthSource",
      "resource_type_label": "Auth source",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 170801529,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_authenticators",
          "id": 687843582,
          "resource_type": "AuthSource"
        },
        {
          "name": "create_authenticators",
          "id": 956119309,
          "resource_type": "AuthSource"
        },
        {
          "name": "edit_authenticators",
          "id": 395314704,
          "resource_type": "AuthSource"
        },
        {
          "name": "destroy_authenticators",
          "id": 1067518973,
          "resource_type": "AuthSource"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Environment",
      "resource_type_label": "Environment",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 1026099682,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_environments",
          "id": 189359466,
          "resource_type": "Environment"
        },
        {
          "name": "create_environments",
          "id": 290807607,
          "resource_type": "Environment"
        },
        {
          "name": "edit_environments",
          "id": 1063021050,
          "resource_type": "Environment"
        },
        {
          "name": "destroy_environments",
          "id": 505866180,
          "resource_type": "Environment"
        },
        {
          "name": "import_environments",
          "id": 782644867,
          "resource_type": "Environment"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "VariableLookupKey",
      "resource_type_label": "Smart variable",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 592288835,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_external_variables",
          "id": 593459230,
          "resource_type": "VariableLookupKey"
        },
        {
          "name": "create_external_variables",
          "id": 140923897,
          "resource_type": "VariableLookupKey"
        },
        {
          "name": "edit_external_variables",
          "id": 1050695340,
          "resource_type": "VariableLookupKey"
        },
        {
          "name": "destroy_external_variables",
          "id": 693514154,
          "resource_type": "VariableLookupKey"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Domain",
      "resource_type_label": "Domain",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 340438230,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_domains",
          "id": 623290985,
          "resource_type": "Domain"
        },
        {
          "name": "create_domains",
          "id": 776153244,
          "resource_type": "Domain"
        },
        {
          "name": "edit_domains",
          "id": 914687015,
          "resource_type": "Domain"
        },
        {
          "name": "destroy_domains",
          "id": 808331307,
          "resource_type": "Domain"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "CommonParameter",
      "resource_type_label": "Common parameter",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 222559602,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_globals",
          "id": 101322209,
          "resource_type": "CommonParameter"
        },
        {
          "name": "create_globals",
          "id": 225414942,
          "resource_type": "CommonParameter"
        },
        {
          "name": "edit_globals",
          "id": 363439011,
          "resource_type": "CommonParameter"
        },
        {
          "name": "destroy_globals",
          "id": 318934959,
          "resource_type": "CommonParameter"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Hostgroup",
      "resource_type_label": "Hostgroup",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 977587707,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_hostgroups",
          "id": 51094894,
          "resource_type": "Hostgroup"
        },
        {
          "name": "create_hostgroups",
          "id": 175778558,
          "resource_type": "Hostgroup"
        },
        {
          "name": "edit_hostgroups",
          "id": 214584076,
          "resource_type": "Hostgroup"
        },
        {
          "name": "destroy_hostgroups",
          "id": 1009240528,
          "resource_type": "Hostgroup"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Host",
      "resource_type_label": "Host",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 721145960,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_hosts",
          "id": 988725676,
          "resource_type": "Host"
        },
        {
          "name": "create_hosts",
          "id": 740433627,
          "resource_type": "Host"
        },
        {
          "name": "edit_hosts",
          "id": 561976263,
          "resource_type": "Host"
        },
        {
          "name": "destroy_hosts",
          "id": 619977594,
          "resource_type": "Host"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Medium",
      "resource_type_label": "Medium",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 503111935,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_media",
          "id": 135202335,
          "resource_type": "Medium"
        },
        {
          "name": "create_media",
          "id": 516151662,
          "resource_type": "Medium"
        },
        {
          "name": "edit_media",
          "id": 329176178,
          "resource_type": "Medium"
        },
        {
          "name": "destroy_media",
          "id": 370531533,
          "resource_type": "Medium"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Model",
      "resource_type_label": "Model",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 643462867,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_models",
          "id": 537547377,
          "resource_type": "Model"
        },
        {
          "name": "create_models",
          "id": 509054658,
          "resource_type": "Model"
        },
        {
          "name": "edit_models",
          "id": 173772800,
          "resource_type": "Model"
        },
        {
          "name": "destroy_models",
          "id": 147454802,
          "resource_type": "Model"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Operatingsystem",
      "resource_type_label": "Operatingsystem",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 291325508,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_operatingsystems",
          "id": 940057595,
          "resource_type": "Operatingsystem"
        },
        {
          "name": "create_operatingsystems",
          "id": 1038489107,
          "resource_type": "Operatingsystem"
        },
        {
          "name": "edit_operatingsystems",
          "id": 887912542,
          "resource_type": "Operatingsystem"
        },
        {
          "name": "destroy_operatingsystems",
          "id": 936871672,
          "resource_type": "Operatingsystem"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Ptable",
      "resource_type_label": "Ptable",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 139728896,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_ptables",
          "id": 769440046,
          "resource_type": "Ptable"
        },
        {
          "name": "create_ptables",
          "id": 649673681,
          "resource_type": "Ptable"
        },
        {
          "name": "edit_ptables",
          "id": 1048516464,
          "resource_type": "Ptable"
        },
        {
          "name": "destroy_ptables",
          "id": 953432930,
          "resource_type": "Ptable"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Puppetclass",
      "resource_type_label": "Puppetclass",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 1062414187,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_puppetclasses",
          "id": 849307952,
          "resource_type": "Puppetclass"
        },
        {
          "name": "create_puppetclasses",
          "id": 270035150,
          "resource_type": "Puppetclass"
        },
        {
          "name": "edit_puppetclasses",
          "id": 308015866,
          "resource_type": "Puppetclass"
        },
        {
          "name": "destroy_puppetclasses",
          "id": 76106844,
          "resource_type": "Puppetclass"
        },
        {
          "name": "import_puppetclasses",
          "id": 849710366,
          "resource_type": "Puppetclass"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Usergroup",
      "resource_type_label": "Usergroup",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 557298380,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_usergroups",
          "id": 44766150,
          "resource_type": "Usergroup"
        },
        {
          "name": "create_usergroups",
          "id": 198876242,
          "resource_type": "Usergroup"
        },
        {
          "name": "edit_usergroups",
          "id": 225115552,
          "resource_type": "Usergroup"
        },
        {
          "name": "destroy_usergroups",
          "id": 1032290172,
          "resource_type": "Usergroup"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "User",
      "resource_type_label": "User",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 372277853,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_users",
          "id": 916456187,
          "resource_type": "User"
        },
        {
          "name": "create_users",
          "id": 544005512,
          "resource_type": "User"
        },
        {
          "name": "edit_users",
          "id": 758239380,
          "resource_type": "User"
        },
        {
          "name": "destroy_users",
          "id": 683333673,
          "resource_type": "User"
        }
      ]
    },
    {
      "search": null,
      "resource_type": null,
      "resource_type_label": "(Miscellaneous)",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 255448041,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "access_settings",
          "id": 139485686,
          "resource_type": null
        },
        {
          "name": "access_dashboard",
          "id": 220719619,
          "resource_type": null
        },
        {
          "name": "view_statistics",
          "id": 955233873,
          "resource_type": null
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Report",
      "resource_type_label": "Report",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 943645556,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_reports",
          "id": 407024322,
          "resource_type": "Report"
        },
        {
          "name": "destroy_reports",
          "id": 222966002,
          "resource_type": "Report"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "FactValue",
      "resource_type_label": "Fact value",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 679608033,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_facts",
          "id": 958901131,
          "resource_type": "FactValue"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Audit",
      "resource_type_label": "Audit",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 528928374,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_audit_logs",
          "id": 202577195,
          "resource_type": "Audit"
        }
      ]
    },
    {
      "search": null,
      "resource_type": "Location",
      "resource_type_label": "Location",
      "unlimited?": true,
      "created_at": "2019-11-07 09:06:15 UTC",
      "updated_at": "2019-11-07 09:06:15 UTC",
      "override?": false,
      "id": 225912082,
      "role": {
        "name": "Manager",
        "id": 1,
        "description": null,
        "origin": "foreman"
      },
      "permissions": [
        {
          "name": "view_locations",
          "id": 342396477,
          "resource_type": "Location"
        },
        {
          "name": "edit_locations",
          "id": 360701043,
          "resource_type": "Location"
        },
        {
          "name": "create_locations",
          "id": 919402658,
          "resource_type": "Location"
        },
        {
          "name": "destroy_locations",
          "id": 302614650,
          "resource_type": "Location"
        }
      ]
    }
  ]
}

Parâmentros

Nome parâmetro Descrição
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
opcional

filtrar resultados

Validations:

  • Must be a String

order
opcional

Classificar campo e ordem, ex.: ‘id DESC’

Validations:

  • Must be a String

page
opcional

Número de página, iniciando em 1

Validations:

  • Must be a number.

per_page
opcional

Número de resultados por página para retornar

Validations:

  • Must be a number.

Pesquisar campos

Nome do campo Tipo Valores possíveis
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
Mostrar um filtro

Exemplos

GET /api/filters/321349837
200
{
  "search": null,
  "resource_type": "Architecture",
  "resource_type_label": "Architecture",
  "unlimited?": true,
  "created_at": "2019-11-07 09:06:15 UTC",
  "updated_at": "2019-11-07 09:06:15 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": []
}

Parâmentros

Nome parâmetro Descrição
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

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
Criar um filtro

Exemplos

POST /api/filters
{
  "filter": {
    "role_id": 17,
    "permission_ids": [
      350275019
    ],
    "override": true,
    "location_ids": [
      255093256
    ],
    "organization_ids": [
      447626438
    ]
  }
}
422
{
  "error": {
    "id": null,
    "errors": {
      "organization_ids": [
        "You can't assign organizations to this resource"
      ],
      "location_ids": [
        "You can't assign locations to this resource"
      ]
    },
    "full_messages": [
      "Organization ids You can't assign organizations to this resource",
      "Location ids You can't assign locations to this resource"
    ]
  }
}

Parâmentros

Nome parâmetro Descrição
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

filter
requerido

Validations:

  • Must be a Hash

filter[role_id]
requerido

Validations:

  • Must be a String

filter[search]
opcional , nulo permitido

Validations:

  • Must be a String

filter[override]
opcional , nulo permitido

Validations:

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

filter[permission_ids]
opcional , nulo permitido

Validations:

  • Must be an array of any type

filter[organization_ids]
opcional , nulo permitido

Validations:

  • Must be an array of any type

filter[location_ids]
opcional , nulo permitido

Validations:

  • Must be an array of any type


PUT /api/filters/:id
Atualizar um filtro

Exemplos

PUT /api/filters/1062414190
{
  "filter": {
    "override": false
  }
}
200
{
  "search": null,
  "resource_type": "Domain",
  "resource_type_label": "Domain",
  "unlimited?": false,
  "created_at": "2019-11-07 08:51:43 UTC",
  "updated_at": "2019-11-07 08:51:43 UTC",
  "override?": false,
  "id": 1062414190,
  "role": {
    "name": "New Role",
    "id": 19,
    "description": null,
    "origin": null
  },
  "permissions": [
    {
      "name": "view_domains",
      "id": 623290985,
      "resource_type": "Domain"
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Parâmentros

Nome parâmetro Descrição
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be a String

filter
requerido

Validations:

  • Must be a Hash

filter[role_id]
opcional

Validations:

  • Must be a String

filter[search]
opcional , nulo permitido

Validations:

  • Must be a String

filter[override]
opcional , nulo permitido

Validations:

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

filter[permission_ids]
opcional , nulo permitido

Validations:

  • Must be an array of any type

filter[organization_ids]
opcional , nulo permitido

Validations:

  • Must be an array of any type

filter[location_ids]
opcional , nulo permitido

Validations:

  • Must be an array of any type


DELETE /api/filters/:id
Apagar um filtro

Exemplos

DELETE /api/filters/10997177
{
  "filter": {}
}
200
{
  "id": 10997177,
  "search": null,
  "role_id": 8,
  "created_at": "2019-11-07T09:06:15.401Z",
  "updated_at": "2019-11-07T09:06:15.401Z",
  "taxonomy_search": null,
  "override": false
}

Parâmentros

Nome parâmetro Descrição
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be a String