Skip to content

registry apply

Tim Burks edited this page Mar 2, 2023 · 10 revisions

registry apply uploads information to the registry from Registry YAML. It follows the style of kubectl apply, and new feature requests that correspond to existing kubectl apply features will be prioritized.

Examples

// Import a single resource file.
registry apply -f FILE --parent PARENT

// Import a directory of resource files.
registry apply -f DIRECTORY --parent PARENT

// Import a directory of resource files including files in all subdirectories.
registry apply -f DIRECTORY -R --parent PARENT

Notes

  • The best way to import a large collection of resources is to use registry apply -f DIRECTORY -R.

  • Currently a specified <parent> must be of the form projects/PROJECTID/locations/global.

  • The --parent option can be omitted if a project is configured with registry config set registry project PROJECTID.

  • Unless a file is specified by name, only files with .yaml and .yml suffixes will be applied.

  • Resource files must be valid Registry YAML. Note that this means that the apiVersion field must be present and set to apigeeregistry/v1. All other YAML files will be silently ignored. This allows Registry YAML files to be stored alongside other YAML files, such as YAML-format OpenAPI descriptions. If no valid Registry YAML files are found, registry apply will return an error.

  • API specifications are imported from separate files alongside their Registry YAML descriptions. The filename field should be the name of the API specification file, and that should be in the same directory where the Registry YAML file is stored.

  • If API specifications consist of multiple files (e.g. Protocol Buffer specs), these files can be stored in a Zip archive alongside the Registry YAML file or, if no Zip archive is present, registry apply will create a Zip archive of all other files in the same directory as the Registry YAML file (except for the Registry YAML file) and upload that as the API spec. Note that this also requires that the MIME type of the spec include +zip. For an example, see the protos directory in the registry tests.