Proto: api_doc.proto

Package: apimanagement.gloo.solo.io

The ApiDoc resource represents the schema of an API served by a Destination (Service, ExternalService). ApiDocs are typically created by Gloo Platform discovery running on the agent in registered workload clusters, but you can also manually create an ApiDoc CR. The ApiDoc type is used to represent different types of API schema specification languages:

  • OpenAPI
  • gRPC

ApiDocReport

The report shows the resources that the ApiDoc selects after the it is successfully applied.

FieldDescription
workspaces(repeated ApiDocReport.WorkspacesEntry)

A list of workspaces in which the ApiDoc can be applied.
ownerWorkspace(string)

The name of the workspace that owns the Graqphql API schema.
servingDestinations(repeated common.gloo.solo.io.DestinationReference)

A list of destinations serving the API.

ApiDocReport.WorkspacesEntry

FieldDescription
key(string)

value(common.gloo.solo.io.Report)

ApiDocSpec

Specifications for the ApiDoc.

FieldDescription
openapi(ApiDocSpec.OpenAPISchema)

The OpenAPI schema specification language. Specify only one schema type.
grpc(ApiDocSpec.GrpcSchema)

The gRPC schema specification language. Specify only one schema type.
graphql(ApiDocSpec.GraphQLSchema)

Unsupported: The GraphQL integration is no longer supported.
The graphQL schema specification language. Specify only one schema type.
servedBy(repeated ServedBy)

The destinations that serve this API, if any.

ApiDocSpec.GraphQLSchema

Unsupported: The GraphQL integration is no longer supported.

Provide a schema definition in GraphQL SDL format. The GraphQL schema also has logging options for logging sensitive request-related information, and schema extension configuration such as custom type definitions. For more information about the different schema features, see the GraphQL documentation.

FieldDescription
schemaDefinition(string)

Required: The GraphQL schema definition. Root-level query and mutation types are supported, and you must define at least a query type.

ApiDocSpec.GrpcSchema

Unsupported: The GraphQL integration is no longer supported.

A complete gRPC schema describing the API.

FieldDescription
descriptors(bytes)

Protobuf descriptors that represent the gRPC services provided by your API, encoded in base64. For more information, see the protobuf reference for FileDescriptorSet.

ApiDocSpec.OpenAPISchema

The YAML- or JSON-formatted OpenAPI v2 or v3 schema string to use for your API.

Example: For detailed information about the settings in this example, see Create your APIs in the Gloo Portal documentation.

  apiVersion: apimanagement.gloo.solo.io/v2
kind: ApiDoc
metadata:
  annotations:
    cluster.solo.io/cluster: ""
  name: customers-api-schema
  namespace: default
spec:
  openapi:
    inlineString: '{ "info": { "title": "Gloo Platform Portal API", "version": "1.0.0", "description": "Review the following reference documentation for the Gloo Platform portal APIs. Use these endpoints to manage user access to both the developer portal and the API resources exposed by the portal." }, "openapi": "3.0.0", "servers": [ { "url": "https://api.gloo-platform-portal.com/v1" } ], "paths": { "/login": { "get": { "description": "Logs user into the developer portal. This is the path that should be used as the callbackPath in the ExtAuthPolicy's OIDC configuration.", "operationId": "login", "security": [ { "identityToken": [ ] } ], "responses": { "200": { "description": "Successfully logged in" } }, "summary": "Logs user into the developer portal", "tags": [ "User" ] } }'
  servedBy:
  - destinationSelector:
      port:
        number: 8080
      selector:
        cluster: $CLUSTER_NAME
        name: app
        namespace: app
  
FieldDescription
inlineString(string)

The inline, YAML- or JSON-formatted, OpenAPI v2 or v3 schema.

ApiDocStatus

The status of the ApiDoc after it is applied to your Gloo environment.

Gloo reports the status of Gloo custom resources in several places, such as in logs, when describing the object in kubectl, or when viewing the object in the Gloo UI. Unlike other Gloo custom resources, ApiDocs can be both an input and output object. For example, you can manually create an ApiDoc (input), or Gloo can automatically create an ApiDoc during discovery or translation processes (output). As such, status for ApiDocs is disabled. Because the status is disabled, you cannot review statuses for ApiDocs in kubectl. Also, you might notice ApiDocs reported as unhealthy in the Gloo UI even though the ApiDocs work. To verify that your ApiDocs are healthy, you can follow the steps in the ApiDoc guide.

FieldDescription
common(common.gloo.solo.io.Status)

The state and workspace conditions of the applied resource.
ownerWorkspace(string)

The name of workspace that owns the APIDoc.
selectedServingDestinations(uint32)

Count of the destinations serving the API.

ServedBy

The destinations that serve this API, if any.

FieldDescription
destinationSelector(common.gloo.solo.io.DestinationSelector)

Specify the backing destination for your app, by label or by name. This destination matches the destinations that you later route to. Supported destinations are Kubernetes services, Gloo virtual destinations, and Gloo external services. This field is required when you manually create an ApiDoc for a service that serves an OpenAPI or gRPC schema.