Configuration Automation - Ping CLI

Generating resource templates

Most resource types in Ping CLI support a template action that generates a complete JSON body skeleton. Use it as a starting point when creating or replacing a resource rather than authoring the request body from scratch.

How it works

Running pingcli <product> <resource> template prints a JSON object to stdout containing every field that create and replace accept, with all values set to their zero defaults. You edit the skeleton to supply the values you want, then feed the file back to create or replace using --from-file.

pingcli pingone groups template

Output:

{
  "customData": {},
  "description": "",
  "displayName": "",
  "externalId": "",
  "name": "",
  "population": {
    "id": ""
  },
  "sourceId": "",
  "sourceType": "",
  "userFilter": ""
}

Fields set to empty strings, zero, false, or empty arrays are optional or will use service defaults. You only need to populate the fields relevant to your use case.

Basic workflow

  1. Generate the skeleton and save it to a file:

    pingcli pingone groups template > group.json
  2. Edit the file to supply your values. Remove or leave blank any fields you don’t need:

    {
      "name": "Developers",
      "description": "Internal developer group",
      "population": {
        "id": "<population-id>"
      }
    }
  3. Pass the edited file to create:

    pingcli pingone groups create --environment-id <env-id> --from-file group.json

You can also write directly to a file using --output-file instead of shell redirection:

pingcli pingone groups template --output-file group.json

Resources with multiple type variants

Some resources support multiple configuration types in a single template output. For example, pingcli pingone applications template emits all four protocol variants (oidc, saml, wsfed, and externalLink) as separate top-level blocks:

pingcli pingone applications template > application.json

Partial output:

{
  "externalLink": {
    "enabled": false,
    "homePageUrl": "",
    "name": "",
    "protocol": "",
    "type": ""
  },
  "oidc": {
    "clientId": "",
    "enabled": false,
    "grantTypes": [],
    "name": "",
    "protocol": "",
    "redirectUris": [],
    "type": ""
  },
  ...
}

For these resources, populate exactly one protocol block and delete the others before passing the body to create or replace. Supplying more than one block will result in an error.