#23899 API and YAML design (IdP department/group labels) (#30015)

For #23899
This commit is contained in:
Rachael Shaw
2025-08-20 11:28:36 -04:00
committed by GitHub
parent 8d971cc90c
commit 03d2a854b7
2 changed files with 23 additions and 2 deletions
+11 -2
View File
@@ -4867,11 +4867,20 @@ Add a dynamic or manual label.
| name | string | body | **Required**. The label's name. |
| description | string | body | The label's description. |
| query | string | body | The query in SQL syntax used to filter the hosts. Only one of either `query` (to create a dynamic label) or `hosts` (to create a manual label) can be included in the request. |
| criteria | object | body | Criteria for adding hosts to a host vitals label. See [`criteria`](#criteria) for details. |
| hosts | array | body | The list of host identifiers (`hardware_serial`, `uuid`, or `hostname`) the label will apply to. Only one of either `query` (to create a dynamic label), `hosts` (to create a manual label), or `host_ids` (to create a manual label) can be included in the request. |
| host_ids | array | body | The list of Fleet host IDs the label will apply to. Only one of either `query` (to create a dynamic label) or `hosts`/`host_ids` (to create a manual label) can be included in the request.
| host_ids | array | body | The list of Fleet host IDs the label will apply to. Only one of either `query` (to create a dynamic label) or `hosts`/`host_ids` (to create a manual label) can be included in the request. |
| platform | string | body | The specific platform for the label to target. Provides an additional filter. Choices for platform are `darwin`, `windows`, `ubuntu`, and `centos`. All platforms are included by default and this option is represented by an empty string. |
If both `query` and `hosts` aren't specified, a manual label with no hosts will be created.
If `query`, `criteria`, and `hosts` aren't specified, a manual label with no hosts will be created.
#### criteria
| Name | Type | Description |
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| vital | string | The type of host vital to use when creating a host vital label. Can be `"end_user_idp_group"` or `"end_user_idp_department"`. |
| value | string | Hosts with vital data matching this value will be added to the label. |
#### Example