Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haikoschol/ort-operator-api
API for the ORT k8s operator
https://github.com/haikoschol/ort-operator-api
compliance kubernetes oss-review-toolkit
Last synced: about 2 months ago
JSON representation
API for the ORT k8s operator
- Host: GitHub
- URL: https://github.com/haikoschol/ort-operator-api
- Owner: haikoschol
- License: gpl-3.0
- Created: 2023-04-24T15:01:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-18T09:32:12.000Z (over 1 year ago)
- Last Synced: 2024-06-20T22:46:02.673Z (7 months ago)
- Topics: compliance, kubernetes, oss-review-toolkit
- Language: Go
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ORT Operator API
This repository contains a HTTP/JSON API, a Matrix chatbot and a (currently broken) Slack chatbot for the
[ORT Kubernetes Operator](https://github.com/haikoschol/ort-operator). The bots should probably live in separate repos.## HTTP Endpoints
### `GET /runs` - Returns a list of all OrtRun resources
Response:
```json
{
"runs": [
{
"name": "",
"repoUrl": "",
"status": {
"analyzer": "[Pending|Running|Succeeded|Failed|Aborted]",
"scanner": "[Pending|Running|Succeeded|Failed|Aborted]",
"reporter": "[Pending|Running|Succeeded|Failed|Aborted]"
}
}
]
}
```### `GET /runs/` - Return the OrtRun resources with the given name
Response:
```json
{
"name": "",
"repoUrl": "",
"status": {
"analyzer": "[Pending|Running|Succeeded|Failed|Aborted]",
"scanner": "[Pending|Running|Succeeded|Failed|Aborted]",
"reporter": "[Pending|Running|Succeeded|Failed|Aborted]"
},
"kubernetesResource": ""
}
```### `POST /runs` - Create a new OrtRun resources
Payload:
```json
{
"repoUrl": "https://github.com/haikoschol/cats-of-asia.git"
}
```Response:
```json
{
"name": "",
"repoUrl": "",
"status": {
"analyzer": "[Pending|Running|Succeeded|Failed|Aborted]",
"scanner": "[Pending|Running|Succeeded|Failed|Aborted]",
"reporter": "[Pending|Running|Succeeded|Failed|Aborted]"
},
"kubernetesResource": ""
}
```### `GET /logs//[analyzer|scanner|reporter]` - Fetch the logs from the analyzer, scanner or reporter of an ORT run
Response:
```json
{
"name": "",
"stage": "[analyzer|scanner|reporter]",
"podLogs": [
{
"podName": "",
"podLogs": ""
}
]
}
```## Configuration
To talk to Kubernetes, the API process first tries [InClusterConfig](https://pkg.go.dev/k8s.io/client-go/rest#InClusterConfig)
and if that fails looks for a kubeconfig in `$HOME/.kube/config`.if `MATRIX_SERVER` is set, `MATRIX_USER` and `MATRIX_ACCESS_TOKEN` are assumed to be set as well and an instance of the
Matrix bot is created and run.