-
Notifications
You must be signed in to change notification settings - Fork 33
registry
The registry tool is a command-line tool for working with API registries based on the Registry API. Unless otherwise noted, all commands are hand-written and intended to provide higher-level and more user-friendly access to registry features than direct calls to the Registry API, which are also possible using the tool. The higher-level commands include opinions about recommended practices for storing and working with information in a registry.
registry help
provides a list of subcommands and general help information.
Configuration of the registry
tool is modeled on the gcloud config
command and its subcommands. This is implemented as registry config
and described in
registry config and
auth/README.md.
The registry
tool includes a handful of commands that are designed to simplify construction and maintenance of an API registry.
Each of these commands accepts a PATTERN
argument that indicates the affected resources. Patterns can be rooted at the top level
(e.g. projects/myprojects/locations/global/apis
) or within a project (apis
) if registry.project
is set (see registry config for details). Patterns can include dashes in place of resource ids anywhere
in the path. For example apis/-/versions/-/specs/openapi
refers to all specs in the currently-configured project with resource id openapi
.
- Get contents of the registry with registry get.
- Export registry contents with registry export.
- Upload and add information with registry apply.
- Delete resources from a registry with registry delete.
For demonstration purposes, several opinionated uploaders are built into the registry
tool.
They "bulk-upload" API descriptions from a variety of sources.
We call them "opinionated" because they rely on assumptions about how the uploaded APIs should be organized
in the registry and are just recommendations; users may prefer other assumptions and patterns.
For details of each, see the following subcommands of registry upload
:
- Upload OpenAPI Descriptions with registry upload openapi.
- Upload Protocol Buffer Descriptions with registry upload protos.
- Upload Google API Discovery Service Descriptions with registry upload discovery.
- Upload lists of OpenAPI descriptions specified in CSV files with registry upload csv.
It is also possible to add information using direct calls to the methods of the Registry API. These can be made using subcommands of registry rpc
(described below) as illustrated in registry rpc.
The registry
tool also includes a few analysis capabilities.
- Evaluate API conformance to style guides with registry compute conformance.
The registry
tool includes a collection of automatically-generated subcommands that provide direct access to all methods of the Registry service. See registry rpc for details and applications.