-
Notifications
You must be signed in to change notification settings - Fork 33
registry check and rules
registry check
applies a set of rules to the registry to ensure the stored data is well-formed and appropriately populated. Rules can be grouped into sets and enabled or disabled. Configs can be read from yaml or json files. Rules are documented below.
List all rules.
registry check --list-rules --enable all
Run default and apihub checks on a specific api.
registry check --enable apihub apis/my-awesome-api
These rules ensure proper API Registry data.
Api availability
:
- [info] should be a single word
Api recommended_version:
- [ERROR] must be a valid ApiVersion name
- [ERROR] must be a child of this Api
- [ERROR] must exist in the registry
Api recommended_deployment:
- [ERROR] must be a valid ApiDeployment name
- [ERROR] must be a child of this Api
- [ERROR] must exist in the registry
ApiVersion state:
- [info] should be a single word
ApiVersion primary_spec:
- [ERROR] must be a valid ApiSpec name
- [ERROR] must be an API sibling of this Version
- [ERROR] must exist in the registry
ApiSpec source_uri:
- [ERROR] must be an absolute URI
ApiDeployment api_spec_revision:
- [ERROR] must be a valid ApiSpecRevision name
- [ERROR] must include the revision ID
- [ERROR] must be an API sibling of this Deployment
- [ERROR] must exist in the registry
ApiDeployment endpoint_uri:
- [ERROR] must be an absolute URI
ApiDeployment external_channel_uri:
- [ERROR] must be an absolute URI
All display_name fields:
- [ERROR] must contain only UTF-8 characters
- [ERROR] must have a max length of 64 characters
All description fields:
- [ERROR] must contain only UTF-8 characters
- [ERROR] must have a max length of 5000 characters
All mime_type fields:
- [ERROR] must not be empty
- [ERROR] must be a valid media type
- [WARN] should match detected type for contents
Label set:
- [ERROR] must have a maximum of 64 labels
Label keys:
- [ERROR] must start with a lowercase unicode letter
- [ERROR] all characters must be a lowercase unicode letter, number, underscore, or dash
- [ERROR] must have a max length of 63 characters
Label values:
- [ERROR] all characters must be a lowercase unicode letter, number, underscore, or dash
- [ERROR] must have a max length of 63 characters
Annotation set:
- [ERROR] must have a max total size of 256k
Annotation keys:
- [ERROR] must start with a lowercase unicode letter
- [ERROR] all characters must be a lowercase unicode letter, number, underscore, or dash
- [ERROR] must have a max length of 63 characters
These rules ensure proper API Hub operation.
[ERROR] Required Project Artifacts:
- apihub-lifecycle
- apihub-taxonomies
[ERROR] Required Taxonomies:
- apihub-target-users
- apihub-style
- apihub-team
- apihub-business-unit
- apihub-gateway
All entities: [ERROR] If entity contains a label key that matches a Taxonomy name, the value must match one of the Taxonomy Element's ID
All mime_type fields:
- [ERROR] internal types ("google.cloud.apigeeregistry." or "gnostic.metrics.") must map to a registered proto type
- [ERROR] contents must load into associated proto type
APIVersion state:
- [ERROR] must not be empty
- [ERROR] must match an entry in apihub-lifecycle project artifact