Security

 View Only
  • 1.  Using Python/requests/REST API how to associate a new device to a nad_group

    Posted Feb 07, 2025 02:59 AM

    Hello,
    Im trying to figure out how to add a device to a nad_group when creating a new device. Going through the api explorer I see a field for it, as "Optional". I include the nad_group name in the field, and will get back a "200" response, but the nad_group device is not added to the nad_group:

    This is the input data:
    {
            "nad_groups": [
             "Junos"
            ],
            "name": "test-dev",
            "ip_address": "99.99.99.99",
            "tacacs_secret": "secret",
            "vendor_name": "Juniper",
            "attributes": {
                "platform": "Junos"
            }
        }

    This is the output:

    Response Body

    {
      "id": 3417,
      "name": "test-dev",
      "ip_address": "99.99.99.99",
      "radius_secret": "",
      "tacacs_secret": "",
      "vendor_name": "Juniper",
      "coa_capable": false,
      "coa_port": 3799,
      "attributes": {
        "platform": "Junos"
      },
      "_links": {
        "self": {
          "href": "https://np-clearpass.intcx.net/api/network-device/3417"
        }
      }
    }

    Response Code

    201


    Not sure what I'm missing,



  • 2.  RE: Using Python/requests/REST API how to associate a new device to a nad_group

    Posted Feb 07, 2025 11:06 AM

    Patch the device group with the new device.



    ------------------------------
    Carson Hulcher, ACEX#110
    ------------------------------



  • 3.  RE: Using Python/requests/REST API how to associate a new device to a nad_group

    Posted Feb 12, 2025 01:55 PM

    Oh, I was hoping to be able to add the Device to the Device group at the time the device was being created. If i cant be done this way, then why is the "nad_groups" feild listed as an "optional" parameter?




  • 4.  RE: Using Python/requests/REST API how to associate a new device to a nad_group

    Posted Feb 12, 2025 02:08 PM

    Probably because that field can be populated by the Get operation and someone left the data definition alone for all operations.



    ------------------------------
    Carson Hulcher, ACEX#110
    ------------------------------