CLI for interacting with NHSD APIM's proxygen service
Project description
proxygen-cli
Installation
Installation is straightforward using pip:
pip install proxygen-cli
After installation, the proxygen
executable is available. Typing proxygen
displays a list of available commands.
Configuration
Credentials
The Proxygen CLI client credentials client_id
, client_secret
are setup as part of proxygen CLI package.
All users should have individual credentials. proxygen-cli
needs to know about them. You can setup your user credentials in proxygen-cli using:
proxygen credentials set
This command prompts you to enter your username
, and password
.
To update any credentials client_id
/ client_secret
/ username
/ password
in the future, use:
proxygen credentials set <KEY> <VALUE>
Settings
To specify the API you are developing for, use:
proxygen settings set api <API-NAME>
Your user must have the appropriate permissions for managing instances, secrets, and specifications related to the specified API. If permissions are insufficient, commands will fail. Reach out to the platforms-api-producer-support
channel for assistance with permissions.
Commands
Commands are documented inside the CLI itself.
Type proxygen
to see a full list of available commands.
For a full user guide for proxygen-cli
see this confluence page.
Deploying an API instance
To deploy an instance of an API you will need an OAS specification file. The OAS specification file can be deployed to an environment using the following command:
proxygen instance deploy <env> <base-path> path/to/specification.yaml
To manage your instances type proxygen instance --help
for a list of available commands.
Publishing an API sepcification
To publish your API specification, first deploy it on the UAT version of Bloomreach, then on production. Publishing to UAT allows you to preview the API documentation's appearance and catch any errors in the code before going live.
Use the following command to publish an API specification:
# Production
proxygen spec publish <path_to_spec>
# UAT
proxygen spec publish <path_to_spec> --uat
To manage your instances type proxygen spec --help
for a list of available commands.
Deploying a secret
The API key, considered sensitive information, is securely stored within the API platform as a 'secret'. Before configuring any instances reliant on this key, it's necessary to deploy it.
Use the following command to deploy a secret:
proxygen secret put <env> <apikey> --apikey --secret-file path/to/secret.txt
To manage your instances type proxygen secret --help
for a list of available commands.
Interacting with your docker repository
To enable the push and pull of images from the API Management ECR repository, you will need to acquire authentication details.
Use the following command to obtain a docker token:
$(proxygen docker get-login)
Retrieving a token to use with the pytest-nhsd-apim python testing package
When testing using the pytest-nhsd-apim python testing package, an apigee management api token is needed. This endpoint provides this token for use in automated tests.
Use the following command to obtain the pytest-nhsd-apim token:
$(proxygen pytest_nhsd_apim get_token)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file proxygen_cli-2.1.9.tar.gz
.
File metadata
- Download URL: proxygen_cli-2.1.9.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.8.18 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be6bcddc392fb1c73f38d5335c6049c30742a2d6c5f86f4348198f8b6a2e2731 |
|
MD5 | c32932f70d21071e4229feab9ca70cd2 |
|
BLAKE2b-256 | 441e6fc940a834bb033a97f9471fc2d426140e3ab7709580615c2673037652bf |
Provenance
File details
Details for the file proxygen_cli-2.1.9-py3-none-any.whl
.
File metadata
- Download URL: proxygen_cli-2.1.9-py3-none-any.whl
- Upload date:
- Size: 38.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.8.18 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bfcb05e5fb3f6a84fae0b67dc3788712127ec67a89131b651c211905b754458 |
|
MD5 | 43d7ec62c65141e2aceb229b55e36d83 |
|
BLAKE2b-256 | bd04e00e8299955bc7f706f193ea11150ca138f193d6c26b265d0974ac636d01 |