Illumio Community Hub

 View Only
Expand all | Collapse all

Could you please tell me how to obtain a list of all unused labels from the PCE through an API call?

  • 1.  Could you please tell me how to obtain a list of all unused labels from the PCE through an API call?

    Posted 09-07-2023 10:23

    Could you please tell me how to obtain a list of all unused labels from the PCE through an API call? I've read in the documentation that I need to use the 'usage' parameter, but it's not clear where in my request I should include it. Could you please provide an example?

     

    https://pce.my-company.com:8443/api/v2/orgs/2/labels


    #Deployment


  • 2.  RE: Could you please tell me how to obtain a list of all unused labels from the PCE through an API call?

    Posted 09-12-2023 14:42

    Baurzhan, one way to identify unused labels is the "Get Labels" API call specifying "usage=true". This will return true where it is used and false where it is not. If everything returns false, then it is extremely likely that the label is not in use. Here is an example of the API call https://pce.my-company.com:8443/api/v2/orgs/2/labels?usage=true

     

    Here is an example response from usage where ruleset and workload are in use:

       "usage": {

         "virtual_server": false,

         "label_group": false,

         "ruleset": true,

         "static_policy_scopes": false,

         "pairing_profile": false,

         "permission": false,

         "workload": true,

         "container_workload": false,

         "firewall_coexistence_scope": false,

         "containers_inherit_host_policy_scopes": false,

         "container_workload_profile": false,

         "blocked_connection_reject_scopes": false,

         "enforcement_boundary": false,

         "loopback_interfaces_in_policy_scopes": false,

         "ip_forwarding_enabled_scopes": false,

         "virtual_service": false

       }

     

    You can find more detail about this API at https://docs.illumio.com/core/22.2/API-Reference/index.html#get-labels



  • 3.  RE: Could you please tell me how to obtain a list of all unused labels from the PCE through an API call?

    Posted 09-13-2023 03:11

    Thank you Steve T88