ApiSchemaDiscovery
ApiSchemaDiscovery API reference.
Proto: api_schema_discovery.proto
Package: apimanagement.gloo.solo.io
The ApiSchemaDiscovery custom resource discovers an API schema at a URL for a target destination, such as a Kubernetes Service or Gloo VirtualDestination, in the same cluster. After discovering the API schema, the Gloo agent automatically generates an ApiDoc resource.
The ApiDoc can be part of a stitched schema of your API products that you share with end users, such as through the Gloo developer portal.
Gloo Mesh Gateway can discover the following API schemas:
- OpenAPI
ApiSchemaDiscoveryReport
The report shows the resources that the ApiSchemaDiscovery selects after it is successfully applied.
Field | Description |
---|---|
ownerWorkspace | (string )The name of the workspace that owns the ApiSchemaDiscovery schema. |
ApiSchemaDiscoverySpec
Example configuration file:
apiVersion: apimanagement.gloo.solo.io/v2
kind: ApiSchemaDiscovery
metadata: {}
spec:
openapi:
fetchEndpoint:
url: "https://example.com/tracks-schema.json"
retryDelay: 10s
pullAttempts: 10
servedBy:
- destinationSelector:
kind: SERVICE
selector:
cluster: cluster-1
name: tracks-rest-api
namespace: tracks
Field | Description |
---|---|
openapi | (ApiSchemaDiscoverySpec.OpenAPI )The details for fetching the API schema. |
servedBy | (repeated ServedBy )The destinations that serve the fetched API schema. The destinations must be in the same cluster as the ApiSchemaDiscovery resource. |
ApiSchemaDiscoverySpec.FetchEndpoint
The URL endpoint to fetch the API schema manually. The Gloo agent must be able to reach this endpoint.
Field | Description |
---|---|
url | (string )Required: The URL endpoint to fetch the API schema from. Supported API schema paths are JSON or YAML files. For https , make sure that the URL is included in the certificate that validates the HTTPS traffic. Formatted as: <protocol-scheme>://<host-domain>:<port>/<filepath> |
retryDelay | (google.protobuf.Duration )The retry delay when fetching the schema. If omitted, the default is 5s. You can also configure this setting for all resources by configuring the Gloo Platform agent during installation or upgrading with the --api-discovery-polling-retry-delay flag. |
pullAttempts | (uint32 )The number of attempts to fetch the schema. If omitted, the default is 3. You can also configure this setting for all resources by configuring the Gloo Platform agent during installation or upgrading with the --api-discovery-polling-pull-attempts flag. |
useBackoff | (bool )Whether to use exponential backoff when retrying to fetch the schema. If omitted, the default is true. You can also configure this setting for all resources by configuring the Gloo Platform agent during installation or upgrading with the --api-discovery-polling-use-backoff flag. |
ApiSchemaDiscoverySpec.OpenAPI
The details for the OpenAPI endpoint.
Field | Description |
---|---|
fetchEndpoint | (ApiSchemaDiscoverySpec.FetchEndpoint )The URL endpoint to fetch the API schema manually. The Gloo agent must be able to reach this endpoint. |
ApiSchemaDiscoveryStatus
ApiSchemaDiscoveryStatus shows the status of the ApiSchemaDiscovery.
If the Gloo agent was not able to fetch the API schema, the status is reflected in common
.
Field | Description |
---|---|
common | (common.gloo.solo.io.Status ) |
ownerWorkspace | (string )The name of workspace that owns the ApiSchemaDiscovery schema. |