Skip to main content

REST APIs for 24.5

Label Groups Reference

This topic provides properties, parameters, and examples for label groups.

Query parameters for label groups

Parameter

Description

Type

Required

org_id

Organization

Integer

Yes

pversion

Security Policy Version

String

Yes

label_group_id

Label Group UUID, for [api_version][label_group_href] and [api_version][label_group_href]/member_of

String

Yes

usage

Include label usage flags.

Boolean

No

Properties for label groups

Property

Description

Type

href

URI of this label group

String

name

The specific name of a label group to return. Supports partial matches

String

key

Key by which to filter

String

created_at

Timestamp when this label group was first created

String

date/time

updated_at

Timestamp when this label group was last updated

String

date/time

deleted_at

Timestamp when this label group was deleted

String, null

created_by

The user who originally created this label group

"$ref": "../common/href_object.schema.json"

updated_by

The user who last updated this label group

"$ref": "../common/href_object.schema.json"

deleted_by

Users who deleted this label group

"$ref": "../common/href_object.schema.json"

Null

blocked_connection_reject_scopes

Label Group is referenced by Blocked Connection Reject Scopes.

Replaces the property blocked_connection_reject_scope

Boolean

loopback_interfaces_ in_policy_scopes

Label Group is referenced by Loopback Interfaces in Policy Scopes.

Boolean

ip_forwarding_enabled_scopes

IP Forwarding Enabled Scopes reference Label Group.

Boolean

Curl Command to Get Label Groups

curl -i -X GET https://pce.my-company.com:8443/api/v2/orgs/3/sec_policy/draft/label_groups -H "Accept: application/json" -u $KEY:$TOKEN

Response

When you get a collection of label groups, each label group is identified by an HREF. You need the HREF to update or delete an individual label group using the API.

{
    "href": "/orgs/2/sec_policy/draft/label_groups/4c8e3325-c6dd-4dc2-aadc-971e9de270e4",
    "created_at": "2020-07-25T00:46:52.552Z",
    "updated_at": "2020-07-25T00:59:00.177Z",
    "deleted_at": null,
    "created_by": {
      "href": "/users/3"
    },
    "updated_by": {
      "href": "/users/3"
    },
    "deleted_by": null,
    "name": "AppGroup1",
    "description": null,
    "key": "app",
    "labels": [],
    "sub_groups": [
      {
        "href": "/orgs/2/sec_policy/draft/label_groups/9b30081e-e105-44d8-9945-4c8a30dbe849",
        "name": "AppGroup3"
      }
    ]
  },
Request body to update a label group

This example request body updates the labels contained within a label group.

{
  "labels": [
    { "href": "/orgs/28/labels/1100" },
    { "href": "/orgs/28/labels/1098" },
    { "href": "/orgs/28/labels/1099" },
    { "href": "/orgs/28/labels/1101" }
  ],
  "sub_groups": []
}

Curl Command to Update Label Groups

In this example, the label group being updated with the request body from the code example above is identified by the its label group HREF.

curl -i -X PUT https://pce.my-company.com:8443/api/v2/orgs/2/sec_policy/draft/label_groups/3307b3d8-2ca2-48f5-877a-03ada95cd6de -H "Content-Type:application/json" -u $KEY:$TOKEN -d '{"labels":[{"href":"/orgs/28/labels/1100"},{"href":"/orgs/28/labels/1098"},{"href":"/orgs/28/labels/1099"},{"href":"/orgs/28/labels/1101"}],"sub_groups":[]}'

Curl Command to Delete a Label Group

curl -i -X DELETE https://pce.my-company.com:8443/api/v2/orgs/2/sec_policy/draft/label_groups/3307b3d8-2ca2-48f5-877a-03ada95cd6de -u $KEY:$TOKEN