Find a Puppet Enterprise environment node group ID

Find the ID of the environment node group in Puppet Enterprise using the ID of your Puppet Enterprise integration.


You need to have your workspace ID obtained in the previous task.

  1. Find the ID of your Puppet Enterprise integration.
    auth_header="Authorization: <API Token>"
    uri="https://<CD4PE host>/cd4pe/api/v2/pe-integrations?workspaceId=<workspace id>
    curl --insecure --header "$auth_header" --request GET "$uri"

    This returns information about your Puppet Enterprise integrations. For example, it might look similar to the following:

    {  
      "peIntegrations" : [  
        {  
          "id" : "e274e692-8423-48b6-a1f3-6e09138624ec",  
          "workspaceId" : "d5",  
          "name" : "example-pe", 
          "nodeClassifierUrl" : "puppet.example.com:4433", 
          ... 
        } 
      ]  
    } 
  2. Use the ID from your Puppet Enterprise integration to get information about the environments:
    auth_header="Authorization: <API Token>"
    uri="https://<CD4PE host>/cd4pe/api/v2/pe-integrations/<PE integration ID>/environments
    curl --insecure --header "$auth_header" --request GET "$uri"

    This returns information about the environments associated with your Puppet Enterprise integration. For example, it might look similar to the following:

    "environments" : [  
      {  
        "name" : "All Environments",  
        "id" : "00e0c92e-30c9-4569-bcc2-0a4ebeffe3a3",  
        "description" : "Environment group parent and default",  
        "environment" : "production"  
      },  
      {  
        "name" : "Development environment",  
        "id" : "c2184ce4-cb96-49eb-9724-4618db267769",  
        "description" : "Development nodes",  
        "environment" : "development"  
      } 
    ]


Use the environment node group ID as needed for API endpoints, such as triggering a deployment.