GET /api/usergroups
Vypsat všechny skupiny uživatelů

Examples

GET /api/usergroups
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "admin": false,
      "created_at": "2019-11-07 08:35:24 UTC",
      "updated_at": "2019-11-07 08:35:24 UTC",
      "name": "usergroup23",
      "id": 15
    }
  ]
}

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

výsledky filtru

Validations:

  • Must be a String

order
Optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
Optional

Číslo stránky, začíná od jedničky

Validations:

  • Must be a number.

per_page
Optional

Number of results per page to return

Validations:

  • Must be a number.

Search fields

Název kolonky Typ Možné hodnoty
name string
role string
role_id integer

GET /api/usergroups/:id
Zobrazit skupinu uživatelů

Examples

GET /api/usergroups/10-usergroup19
200
{
  "admin": false,
  "created_at": "2019-11-07 08:35:24 UTC",
  "updated_at": "2019-11-07 08:35:24 UTC",
  "name": "usergroup19",
  "id": 10,
  "external_usergroups": [],
  "usergroups": [],
  "users": [],
  "roles": []
}

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/usergroups
Vytvořit skupinu uživatelů

Examples

POST /api/usergroups
{
  "usergroup": {
    "name": "test_usergroup",
    "usergroup_ids": [
      5
    ]
  }
}
201
{
  "admin": false,
  "created_at": "2019-11-07 08:35:24 UTC",
  "updated_at": "2019-11-07 08:35:24 UTC",
  "name": "test_usergroup",
  "id": 6,
  "external_usergroups": [],
  "usergroups": [
    {
      "name": "usergroup15",
      "id": 5,
      "created_at": "2019-11-07 08:35:24 UTC",
      "updated_at": "2019-11-07 08:35:24 UTC"
    }
  ],
  "users": [],
  "roles": []
}

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

usergroup
Required

Validations:

  • Must be a Hash

usergroup[name]
Required

Validations:

  • Must be a String

usergroup[admin]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

is an admin user group

Validations:

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

usergroup[user_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type

usergroup[usergroup_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type

usergroup[role_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type


PUT /api/usergroups/:id
Aktualizovat skupinu uživatelů

User groups linked to external groups (LDAP) are automatically synced with these groups on update. Remember this synchronization will remove any LDAP users manually added to the Foreman user group. Only LDAP users in the external groups will remain. Internal users can be added or removed freely.

Examples

PUT /api/usergroups/4-usergroup14
{
  "usergroup": {
    "name": "test_usergroup",
    "user_ids": [
      980190962
    ]
  }
}
200
{
  "admin": false,
  "created_at": "2019-11-07 08:35:24 UTC",
  "updated_at": "2019-11-07 08:35:24 UTC",
  "name": "test_usergroup",
  "id": 4,
  "external_usergroups": [],
  "usergroups": [],
  "users": [
    {
      "id": 980190962,
      "login": "one",
      "description": null
    }
  ],
  "roles": []
}

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

usergroup
Required

Validations:

  • Must be a Hash

usergroup[name]
Optional

Validations:

  • Must be a String

usergroup[admin]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

is an admin user group

Validations:

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

usergroup[user_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type

usergroup[usergroup_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type

usergroup[role_ids]
Optional , <span class="translation_missing" title="translation missing: cs-CZ.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type


DELETE /api/usergroups/:id
Smazat skupinu uživatelů

Examples

DELETE /api/usergroups/24-usergroup30
{
  "usergroup": {}
}
200
{
  "id": 24,
  "name": "usergroup30",
  "created_at": "2019-11-07T08:35:25.560Z",
  "updated_at": "2019-11-07T08:35:25.560Z",
  "admin": false
}

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