Skip to content

Commit eb64d98

Browse files
📖 add public api docs (#1331)
* public api docs Signed-off-by: everettraven <[email protected]> * post rebase fixes Signed-off-by: everettraven <[email protected]> * address nits Signed-off-by: everettraven <[email protected]> * Update docs/api-reference/catalogd-webserver.md Co-authored-by: Joe Lanford <[email protected]> --------- Signed-off-by: everettraven <[email protected]> Co-authored-by: Joe Lanford <[email protected]>
1 parent 7d9f296 commit eb64d98

File tree

3 files changed

+102
-0
lines changed

3 files changed

+102
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Catalogd web server
2+
3+
[Catalogd](https://github.com/operator-framework/catalogd), the OLM v1 component for making catalog contents available on cluster, includes
4+
a web server that serves catalog contents to clients via an HTTP(S) endpoint.
5+
6+
The endpoint to retrieve this information is provided in the `.status.contentURL` of a `ClusterCatalog` resource.
7+
As an example:
8+
9+
```yaml
10+
contentURL: https://catalogd-service.olmv1-system.svc/catalogs/operatorhubio/all.json
11+
```
12+
13+
!!! note
14+
15+
The value of the `.status.contentURL` field in a `ClusterCatalog` resource is an arbitrary string value and can change at any time.
16+
While there are no guarantees on the exact value of this field, it will always be a URL that resolves successfully for clients using
17+
it to make a request from within the cluster.
18+
19+
## Interacting With the Server
20+
21+
### Supported HTTP Methods
22+
23+
The HTTP request methods supported by the catalogd web server are:
24+
25+
- [GET](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET)
26+
- [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD)
27+
28+
### Response Format
29+
30+
Responses are encoded as a [JSON Lines](https://jsonlines.org/) stream of [File-Based Catalog](https://olm.operatorframework.io/docs/reference/file-based-catalogs) (FBC) [Meta](https://olm.operatorframework.io/docs/reference/file-based-catalogs/#schema) objects delimited by newlines.
31+
32+
??? example "Example JSON-encoded FBC snippet"
33+
34+
```json
35+
{
36+
"schema": "olm.package",
37+
"name": "cockroachdb",
38+
"defaultChannel": "stable-v6.x",
39+
}
40+
{
41+
"schema": "olm.channel",
42+
"name": "stable-v6.x",
43+
"package": "cockroachdb",
44+
"entries": [
45+
{
46+
"name": "cockroachdb.v6.0.0",
47+
"skipRange": "<6.0.0"
48+
}
49+
]
50+
}
51+
{
52+
"schema": "olm.bundle",
53+
"name": "cockroachdb.v6.0.0",
54+
"package": "cockroachdb",
55+
"image": "quay.io/openshift-community-operators/cockroachdb@sha256:d3016b1507515fc7712f9c47fd9082baf9ccb070aaab58ed0ef6e5abdedde8ba",
56+
"properties": [
57+
{
58+
"type": "olm.package",
59+
"value": {
60+
"packageName": "cockroachdb",
61+
"version": "6.0.0"
62+
}
63+
},
64+
],
65+
}
66+
```
67+
68+
Corresponding JSON lines response:
69+
```jsonlines
70+
{"schema":"olm.package","name":"cockroachdb","defaultChannel":"stable-v6.x"}
71+
{"schema":"olm.channel","name":"stable-v6.x","package":"cockroachdb","entries":[{"name":"cockroachdb.v6.0.0","skipRange":"<6.0.0"}]}
72+
{"schema":"olm.bundle","name":"cockroachdb.v6.0.0","package":"cockroachdb","image":"quay.io/openshift-community-operators/cockroachdb@sha256:d3016b1507515fc7712f9c47fd9082baf9ccb070aaab58ed0ef6e5abdedde8ba","properties":[{"type":"olm.package","value":{"packageName":"cockroachdb","version":"6.0.0"}}]}
73+
```
74+
75+
### Compression Support
76+
77+
The `catalogd` web server supports gzip compression of responses, which can significantly reduce associated network traffic. In order to signal that the client handles compressed responses, the client must include `Accept-Encoding: gzip` as a header in the HTTP request.
78+
79+
The web server will include a `Content-Encoding: gzip` header in compressed responses.
80+
81+
!!! note
82+
83+
Only catalogs whose uncompressed response body would result in a response size greater than 1400 bytes will be compressed.
84+
85+
### Cache Header Support
86+
87+
For clients interested in caching the information returned from the `catalogd` web server, the `Last-Modified` header is set
88+
on responses and the `If-Modified-Since` header is supported for requests.

docs/project/public-api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Public API
2+
The public API of OLM v1 is as follows:
3+
4+
- Kubernetes APIs. For more information on these APIs, see:
5+
- [operator-controller API reference](./api/operator-controller-api-reference.md)
6+
- [catalogd API reference](./api/catalogd-api-reference.md)
7+
- `Catalogd` web server. For more information on what this includes, see the [catalogd web server documentation](./api/catalogd-webserver.md)
8+
9+
!!! warning
10+
11+
Only what is mentioned in the above documentation references is considered part of the public API
12+
and follows SemVer. Anything not mentioned in the above references is prone to breaking changes.

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ nav:
2525
- Design Decisions: project/olmv1_design_decisions.md
2626
- Limitations: project/olmv1_limitations.md
2727
- Roadmap: project/olmv1_roadmap.md
28+
- Public API: project/public-api.md
2829
- Getting Started: getting-started/olmv1_getting_started.md
2930
- Tutorials:
3031
- Add a Catalog: tutorials/add-catalog.md
@@ -49,6 +50,7 @@ nav:
4950
- API Reference:
5051
- Operator Controller API reference: api-reference/operator-controller-api-reference.md
5152
- CatalogD API reference: api-reference/catalogd-api-reference.md
53+
- CatalogD Web Server reference: api-reference/catalogd-webserver.md
5254
- Contribute:
5355
- Contributing: contribute/contributing.md
5456
- Developing OLM v1: contribute/developer.md

0 commit comments

Comments
 (0)