ARAPY(1)

NAME
arapy - dynamic CLI for HPE Aruba ClearPass Policy Manager

SYNOPSIS
arapy [GLOBAL-OPTIONS] MODULE SERVICE ACTION [KEY=VALUE ...]
arapy cache clear
arapy cache update
arapy [--help|?]
arapy --version

DESCRIPTION
arapy is a command-line client for HPE Aruba ClearPass Policy Manager. It discovers available API modules, services, actions, and request metadata dynamically from the ClearPass API documentation endpoints. Because of this, the exact command surface depends on the connected ClearPass server. This manual describes the stable, static parts of arapy: authentication, global options, cache behavior, output behavior, and common usage. For endpoint-specific help, use the built-in dynamic help:

    arapy <module> <service> ?
    arapy <module> <service> <action> ?

COMMAND MODEL
The general command form is:

    arapy <module> <service> <action> [--key=value ...]
Supported action names commonly include:

list
    List collection resources. Equivalent to get --all for many endpoints.

get Retrieve one resource or, with --all, a collection.

add Create a resource.

update
    Patch an existing resource.

replace
    Replace an existing resource.

delete
    Delete a resource. The available modules, services, and actions are determined dynamically from ClearPass and may vary by version and enabled API surface.

CACHE COMMANDS

arapy cache update
    Refresh the local API catalog from ClearPass.

arapy cache clear
    Remove the local API catalog cache.

AUTHENTICATION
arapy supports the following authentication methods:

OAuth client credentials
    Configured with environment variables such as:

        ARAPY_SERVER
        ARAPY_CLIENT_ID
        ARAPY_CLIENT_SECRET

Direct bearer token
    Configured with:

        ARAPY_API_TOKEN

Token file
    Configured with:

        ARAPY_API_TOKEN_FILE
The token file may contain either a raw token string or JSON such as:

    {"access_token":"..."}
Command-line token overrides may also be used:

    arapy identities endpoint list --api-token=TOKEN
    arapy identities endpoint list --token-file=./token.json

GLOBAL OPTIONS

--log-level=LEVEL
    Set log level. Typical values: debug, info, warning, error, critical.

--console
    Also print response output to the terminal.

--out=FILE
    Write output to a specific file.

--data-format=FORMAT
    Set output format. Supported values: json, csv, raw.

--csv-fieldnames=FIELDS
    Comma-separated field list for CSV output ordering.

--file=FILE
    Load request payload from JSON or CSV for bulk/write actions.

--api-token=TOKEN
    Use an existing bearer token instead of logging in.

--token-file=FILE
    Load bearer token from file.

--limit=N
    Set list page size when supported by the endpoint.

--offset=N
    Set list offset when supported by the endpoint.

--sort=FIELD
    Set server-side sort when supported by the endpoint.

--filter=JSON
    Set server-side filter expression when supported by the endpoint.

--calculate-count=true|false
    Request total count when supported by the endpoint.

--encrypt=enable|disable
    Control masking of secret values in saved/logged output.

--decrypt
    Disable secret masking in output.

--help, ?
    Show help.

--version
    Show version.

OUTPUT
By default, arapy writes responses to files under its state and output directories. Supported output formats are:

json
    Pretty-printed JSON output.

csv CSV output for list-style data.

raw Raw text or binary output, used especially for export and download style endpoints. For binary responses, arapy may automatically choose raw output and use the filename provided by the server.

ENVIRONMENT

ARAPY_SERVER
    ClearPass server hostname or host:port.

ARAPY_CLIENT_ID
    OAuth client ID.

ARAPY_CLIENT_SECRET
    OAuth client secret.

ARAPY_API_TOKEN
    Direct bearer token.

ARAPY_API_TOKEN_FILE
    Path to token file.

ARAPY_VERIFY_SSL
    Enable or disable TLS certificate verification.

ARAPY_TIMEOUT
    HTTP timeout in seconds.

ARAPY_LOG_LEVEL
    Default log level.

ARAPY_DATA_FORMAT
    Default output format.

ARAPY_CONSOLE
    Enable console output by default.

ARAPY_ENCRYPT_SECRETS
    Mask secret values by default.

ARAPY_CACHE_DIR
    Override cache directory.

ARAPY_STATE_DIR
    Override state directory.

ARAPY_OUT_DIR
    Override response output directory.

ARAPY_APP_LOG_DIR
    Override application log directory.

FILES

~/.cache/arapy/
    Default cache directory on Linux when XDG defaults are used.

~/.local/state/arapy/
    Default state directory on Linux when XDG defaults are used.

~/.local/state/arapy/responses/
    Default response output directory.

~/.local/state/arapy/logs/
    Default log directory.

EXAMPLES
Refresh API discovery cache:

    arapy cache update
List endpoints:

    arapy identities endpoint list --limit=10
Get one network device by id:

    arapy policyelements network-device get --id=1001
Update one network device:

    arapy policyelements network-device update --id=1001 --description="Core switch"
Use dynamic help for a discovered action:

    arapy policyelements network-device add ?

NOTES
This manual is intentionally static and does not attempt to list the full dynamic API surface discovered from ClearPass. Use built-in help for live endpoint metadata:

    arapy <module> <service> ?
    arapy <module> <service> <action> ?

EXIT STATUS

0   Success.

non-zero
    Failure, invalid arguments, authentication failure, network failure, or API error.

SEE ALSO
python(1), curl(1) ClearPass API documentation as exposed by the target server via /api-docs.