registry

command
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

registry

registry is a command-line tool for working with the Registry API that provides a mixture of high-level capabilities and automatically-generated subcommands that call methods of the Registry API.

Usage

Run registry help for general information and registry help [subcommand] for details on any subcommand.

Configuration

registry is configured with environment variables that are set by authorization scripts in the auth directory of this project. This includes the address of the Registry API server and authentication tokens.

Release builds

Release builds of the registry tool are available on GitHub and can be found in github.com/apigee/registry/releases.

MacOS note: To run the registry tool on MacOS, you may need to unquarantine it by running the following on the command line:

xattr -d com.apple.quarantine registry

Running with Apigee API hub

To use the registry tool with a hosted instance associated with Apigee API hub, please do the following:

  1. Make sure you have gcloud command installed.
  2. Set the PROJECT_ID environment variable to your API hub project name.
  3. Configure gcloud to use your project:
gcloud config set project $PROJECT_ID
  1. Run the following script to get an authorization token and set it in your environment as $APG_REGISTRY_TOKEN (on Windows, please use auth/HOSTED.bat):
. auth/HOSTED.sh
  1. To list all the APIs in your API hub instance run the following:
registry list projects/$PROJECT_ID/locations/global/apis/-
  1. To see other supported commands, run the following:
registry help

Importing API information with the Registry tool

The registry tool currently includes several demonstration subcommands that upload API descriptions into a registry and one subcommmand (registry apply) that is likely to become a recommended way to populate an API registry.

  • registry upload bulk openapi reads OpenAPI descriptions from a directory that follows the style of the APIs-guru/openapi-directory repository. To try it, clone the openapi-directory repo, change your directory to the repo, and run the registry upload bulk openapi command as follows:

    git clone https://github.com/apis-guru/openapi-directory
    cd openapi-directory
    registry upload bulk openapi APIs --project-id $PROJECT_ID
    

    Here APIs is a directory in the repo and $PROJECT_ID should be set to your registry project id.

  • registry upload bulk protos reads Protocol Buffer API descriptions from a directory that follows the style of the googleapis/googleapis repository. To try it, clone the googleapis repo, change your directory to the root of the repo, and run the registry upload bulk protos command as follows:

    git clone https://github.com/googleapis/googleapis
    cd googleapis
    registry upload bulk protos . --project-id $PROJECT_ID
    

    As above, $PROJECT_ID should be set to your registry project id.

  • registry upload bulk discovery reads API descriptions from the Google API Discovery Service. This reads from an online service, so you can try it by simply running the following:

    registry upload bulk discovery --project-id $PROJECT_ID
    

    As above, $PROJECT_ID should be set to your registry project id.

  • registry apply reads API information from YAML files using a mechanism similar to kubectl apply. For details, see this GitHub issue. To try it, run the following from the root of the registry repo:

    registry apply -f cmd/registry/cmd/apply/testdata/registry.yaml --parent projects/$PROJECT_ID/locations/global
    

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL