GET /api/usergroups
모든 사용자 그룹 나열

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-09-11 14:33:34 UTC",
      "updated_at": "2019-09-11 14:33:34 UTC",
      "name": "usergroup200",
      "id": 15
    }
  ]
}

Params

Param Name Description
location_id
Optional

위치 별 범위

Validations:

  • Must be a Integer

organization_id
Optional

조직 별 범위

Validations:

  • Must be a Integer

search
Optional

필터 결과

Validations:

  • Must be a String

order
Optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
Optional

1 부터 페이지 번호

Validations:

  • Must be a number.

per_page
Optional

반환할 페이지 당 결과 수

Validations:

  • Must be a number.

Search fields

Field name 유형 Possible values
name string
role string
role_id integer

GET /api/usergroups/:id
사용자 그룹 표시

Examples

GET /api/usergroups/11-usergroup196
200
{
  "admin": false,
  "created_at": "2019-09-11 14:33:33 UTC",
  "updated_at": "2019-09-11 14:33:33 UTC",
  "name": "usergroup196",
  "id": 11,
  "external_usergroups": [],
  "usergroups": [],
  "users": [],
  "roles": []
}

Params

Param Name Description
location_id
Optional

위치 별 범위

Validations:

  • Must be a Integer

organization_id
Optional

조직 별 범위

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
사용자 그룹 생성

Examples

POST /api/usergroups
{
  "usergroup": {
    "name": "test_usergroup",
    "user_ids": [
      980190962,
      298486374,
      200482051
    ]
  }
}
201
{
  "admin": false,
  "created_at": "2019-09-11 14:33:33 UTC",
  "updated_at": "2019-09-11 14:33:33 UTC",
  "name": "test_usergroup",
  "id": 2,
  "external_usergroups": [],
  "usergroups": [],
  "users": [
    {
      "id": 980190962,
      "login": "one",
      "description": null
    },
    {
      "id": 298486374,
      "login": "two",
      "description": null
    },
    {
      "id": 200482051,
      "login": "test",
      "description": null
    }
  ],
  "roles": []
}

Params

Param Name Description
location_id
Optional

위치 별 범위

Validations:

  • Must be a Integer

organization_id
Optional

조직 별 범위

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: ko.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: ko.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: ko.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: ko.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type


PUT /api/usergroups/:id
사용자 그룹 업데이트

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/3-usergroup190
{
  "usergroup": {
    "name": "test_usergroup",
    "usergroup_ids": [
      4
    ]
  }
}
200
{
  "admin": false,
  "created_at": "2019-09-11 14:33:33 UTC",
  "updated_at": "2019-09-11 14:33:33 UTC",
  "name": "test_usergroup",
  "id": 3,
  "external_usergroups": [],
  "usergroups": [
    {
      "name": "usergroup191",
      "id": 4,
      "created_at": "2019-09-11 14:33:33 UTC",
      "updated_at": "2019-09-11 14:33:33 UTC"
    }
  ],
  "users": [],
  "roles": []
}

Params

Param Name Description
location_id
Optional

위치 별 범위

Validations:

  • Must be a Integer

organization_id
Optional

조직 별 범위

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: ko.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: ko.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: ko.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: ko.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be an array of any type


DELETE /api/usergroups/:id
사용자 그룹 삭제

Examples

DELETE /api/usergroups/17-usergroup202
{
  "usergroup": {}
}
200
{
  "id": 17,
  "name": "usergroup202",
  "created_at": "2019-09-11T14:33:34.088Z",
  "updated_at": "2019-09-11T14:33:34.088Z",
  "admin": false
}

Params

Param Name Description
location_id
Optional

위치 별 범위

Validations:

  • Must be a Integer

organization_id
Optional

조직 별 범위

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be a String