Skip to content

Add API key management commands #82

@piekstra

Description

@piekstra

Summary

Add commands for managing New Relic API keys as convenient aliases to the underlying NerdGraph apiAccess* mutations. Currently key operations require hand-crafting GraphQL via nrq nerdgraph query, which is error-prone and hard to remember.

Proposed Commands

nrq keys list

List all API keys for the account (USER + INGEST).

nrq keys list [--type user|ingest] [--account <id>]

Wraps apiAccess.keySearch.

nrq keys get <id>

Get details for a specific key.

nrq keys get <key-id>

Wraps apiAccess.key.

nrq keys create

Create a new API key.

nrq keys create --type user --name "my-key" [--notes "description"] [--account <id>]
nrq keys create --type ingest --ingest-type license --name "my-key" [--account <id>]

Wraps apiAccessCreateKeys.

nrq keys delete <id>

Delete one or more keys.

nrq keys delete <key-id> [<key-id>...]

Wraps apiAccessDeleteKeys.

nrq keys update <id>

Update key name or notes.

nrq keys update <key-id> --name "new-name" [--notes "new notes"]

Wraps apiAccessUpdateKeys.

Context

During annual key rotations we frequently need to list, create, and delete keys. Having first-class CLI commands would make this much more ergonomic and scriptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions