Skip to main content

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 CLI requires client credentials, which can be obtained from the platforms-api-producer-support Slack channel.

All users should also have individual credentials. proxygen-cli needs to know about them. You can setup the credentials in proxygen-cli using:

proxygen credentials set

This command prompts you to enter your client_id, client_secret, username, and password. To update credentials 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxygen_cli-2.1.10.tar.gz (28.4 kB view details)

Uploaded Source

Built Distribution

proxygen_cli-2.1.10-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file proxygen_cli-2.1.10.tar.gz.

File metadata

  • Download URL: proxygen_cli-2.1.10.tar.gz
  • Upload date:
  • Size: 28.4 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

Hashes for proxygen_cli-2.1.10.tar.gz
Algorithm Hash digest
SHA256 54b36a5efa59747929cf731481619e7647f3c0531c34f02bc8a781ee0d712d73
MD5 b11153a842d5a9ffac125006816897c6
BLAKE2b-256 b7831c9d9e82045c52a16f6dd225713967e3c3ce8b9590fa0b2c25c0ae24d3d2

See more details on using hashes here.

Provenance

File details

Details for the file proxygen_cli-2.1.10-py3-none-any.whl.

File metadata

  • Download URL: proxygen_cli-2.1.10-py3-none-any.whl
  • Upload date:
  • Size: 37.9 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

Hashes for proxygen_cli-2.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 2186288e86836f1109d0799c8db0ded6fc01037a838e5ec16ef2462744902eab
MD5 982e91a45e54f28a39279fba4dbcaa01
BLAKE2b-256 b38eef743845d333385b131b676b8eb9c7c2f15958cddd229b6f1e699c8e13ed

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page