Skip to content

PE: Classifier API examples are wrong #1164

Open
@bastelfreak

Description

@bastelfreak

Describe the Bug

Hi, I checked https://www.puppet.com/docs/pe/2023.7/groups_endpoint#get_v1_groups-get-v1-groups-response-format

It contains the following example:

auth_header="X-Authentication: $(puppet-access show)"
uri="https://$(puppet config print server):4433/classifier-api/v1/groups"
curl --silent --header "$auth_header" "$uri" | jq -M -r '.[] | "\(.name) \(.id)"'

But that misses the TLS certificates for authentication. Correct is:

cert="$(puppet config print hostcert)"
cacert="$(puppet config print localcacert)"
key="$(puppet config print hostprivkey)"
uri="https://$(puppet config print server):4433/classifier-api/v1/groups"
curl --silent --header "$type_header" --cert "$cert" --cacert "$cacert" --key "$key" "$uri" | jq -M -r '.[] | "\(.name) \(.id)"'

Expected Behavior

Working copy & paste example to list all groups and their IDs.

Steps to Reproduce

Environment

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    triagedThis ticket has been accepted to our backlog and migrated internally

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions