Label Groups
This Public Stable API helps you write rules more efficiently if the same labels are used repeatedly in rulesets. When you add labels to a label group, the label group can be used in a rule or ruleset scope to represent multiple labels. A label group can also be a member (child) of other label groups.
Label Groups API Methods
Functionality | HTTP | URI |
---|---|---|
Get a collection of label groups. |
|
|
Get an individual label group. |
|
|
Get an individual label group to see if it is a member of other label groups. |
|
|
Create a new label group. |
|
|
Update an individual label group. |
|
|
Delete an individual label grou.p |
|
|
Active vs. Draft
Get a Collection of Label Groups
This method gets all label groups in your organization. Use this to discover the label_group_id
to GET a specific label group or for POST, PUT, and DELETE operations.
By default, the maximum number returned on a GET collection of label groups is 500. If you want to get more than 500 label groups, use Asynchronous GET Collections.
URI to Get a Collection of Label Groups
GET [org_href]/sec_policy/draft/label_groups
URI to Get an Individual Label
GET [label_group_href]
Label Group Belonging to Other Groups
This method determines if an individual label group is a member of other label groups. For example, if one label group is also a “child” of three other label groups, the response to this call returns the three “parent” label groups to which the specified label group belongs.
URI to Check if a Label Group Belongs to Other Label Groups
GET [api_version][label_group_href]/member_of
Response
If the specified label group does not belong to any other label groups, the call returns an HTTP 200 message. If the specified label group does belong to other label groups, the response lists the parent label groups. For example:
[ { "href": "/orgs/7/sec_policy/draft/label_groups/b51c986b-db35-47d4-ab77-aae570d1f164", "name": "MyLablesUS" } ]
Update a Label Group
To update an individual label group, use the HREF of the label group, which is obtained from an API call to get a collection of label groups.
URI to Update a Label Group
PUT [label_group_href]
Delete a Label Group
To delete an individual label group, specify the HREF of the label group you want to delete, which is obtained from an API call to get a collection of label groups.
URI to Delete a Label Group
DELETE [api_version][label_group_href]