init oc-catalog

This commit is contained in:
mr
2024-07-26 13:07:25 +02:00
commit 053c1ddf31
36 changed files with 2952 additions and 0 deletions

BIN
swagger/favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

BIN
swagger/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

60
swagger/index.html Normal file
View File

@@ -0,0 +1,60 @@
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after
{
box-sizing: inherit;
}
body
{
margin:0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "swagger.json",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
});
// End Swagger UI call region
window.ui = ui;
};
</script>
</body>
</html>

View File

@@ -0,0 +1,79 @@
<!doctype html>
<html lang="en-US">
<head>
<title>Swagger UI: OAuth2 Redirect</title>
</head>
<body>
<script>
'use strict';
function run () {
var oauth2 = window.opener.swaggerUIRedirectOauth2;
var sentState = oauth2.state;
var redirectUrl = oauth2.redirectUrl;
var isValid, qp, arr;
if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
} else {
qp = location.search.substring(1);
}
arr = qp.split("&");
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
qp = qp ? JSON.parse('{' + arr.join() + '}',
function (key, value) {
return key === "" ? value : decodeURIComponent(value);
}
) : {};
isValid = qp.state === sentState;
if ((
oauth2.auth.schema.get("flow") === "accessCode" ||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
oauth2.auth.schema.get("flow") === "authorization_code"
) && !oauth2.auth.code) {
if (!isValid) {
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
});
}
if (qp.code) {
delete oauth2.state;
oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else {
let oauthErrorMsg;
if (qp.error) {
oauthErrorMsg = "["+qp.error+"]: " +
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
(qp.error_uri ? "More info: "+qp.error_uri : "");
}
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
});
}
} else {
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
}
window.close();
}
if (document.readyState !== 'loading') {
run();
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
swagger/swagger-ui.css Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
swagger/swagger-ui.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

640
swagger/swagger.json Normal file
View File

@@ -0,0 +1,640 @@
{
"swagger": "2.0",
"info": {
"title": "beego Test API",
"description": "beego has a very cool tools to autogenerate documents for your API\n",
"version": "1.0.0",
"termsOfService": "http://beego.me/",
"contact": {
"email": "astaxie@gmail.com"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"basePath": "/oc/",
"paths": {
"/data/": {
"get": {
"tags": [
"data"
],
"description": "find data by id\n\u003cbr\u003e",
"operationId": "DataController.GetAll",
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"post": {
"tags": [
"data"
],
"description": "create data\n\u003cbr\u003e",
"operationId": "DataController.Create",
"parameters": [
{
"in": "body",
"name": "data",
"description": "body for data content (Json format)",
"required": true,
"schema": {
"$ref": "#/definitions/json"
}
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
}
},
"/data/{id}": {
"get": {
"tags": [
"data"
],
"description": "find workflow by id\n\u003cbr\u003e",
"operationId": "DataController.Get",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the id you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"put": {
"tags": [
"data"
],
"description": "create datas\n\u003cbr\u003e",
"operationId": "DataController.Update",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the data id you want to get",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The data content",
"required": true,
"schema": {
"$ref": "#/definitions/models.data"
}
}
],
"responses": {
"200": {
"description": "{data} models.data"
}
}
},
"delete": {
"tags": [
"data"
],
"description": "delete the data\n\u003cbr\u003e",
"operationId": "DataController.Delete",
"parameters": [
{
"in": "path",
"name": "id",
"description": "The id you want to delete",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{data} delete success!"
}
}
}
},
"/datacenter/": {
"get": {
"tags": [
"datacenter"
],
"description": "find datacenter by id\n\u003cbr\u003e",
"operationId": "DatacenterController.GetAll",
"responses": {
"200": {
"description": "{datacenter} models.datacenter"
}
}
},
"post": {
"tags": [
"datacenter"
],
"description": "create datacenter\n\u003cbr\u003e",
"operationId": "DatacenterController.Create",
"parameters": [
{
"in": "body",
"name": "datacenter",
"description": "body for datacenter content (Json format)",
"required": true,
"schema": {
"$ref": "#/definitions/json"
}
}
],
"responses": {
"200": {
"description": "{datacenter} models.datacenter"
}
}
}
},
"/datacenter/{id}": {
"get": {
"tags": [
"datacenter"
],
"description": "find datacenter by id\n\u003cbr\u003e",
"operationId": "DatacenterController.Get",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the id you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{datacenter} models.datacenter"
}
}
},
"put": {
"tags": [
"datacenter"
],
"description": "create datacenters\n\u003cbr\u003e",
"operationId": "DatacenterController.Update",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the datacenter id you want to get",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The datacenter content",
"required": true,
"schema": {
"$ref": "#/definitions/models.datacenter"
}
}
],
"responses": {
"200": {
"description": "{datacenter} models.datacenter"
}
}
},
"delete": {
"tags": [
"datacenter"
],
"description": "delete the datacenter\n\u003cbr\u003e",
"operationId": "DatacenterController.Delete",
"parameters": [
{
"in": "path",
"name": "id",
"description": "The id you want to delete",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{datacenter} delete success!"
}
}
}
},
"/processing/": {
"get": {
"tags": [
"processing"
],
"description": "find processing by id\n\u003cbr\u003e",
"operationId": "ProcessingController.GetAll",
"responses": {
"200": {
"description": "{processing} models.processing"
}
}
},
"post": {
"tags": [
"processing"
],
"description": "create processing\n\u003cbr\u003e",
"operationId": "ProcessingController.Create",
"parameters": [
{
"in": "body",
"name": "processing",
"description": "body for processing content (Json format)",
"required": true,
"schema": {
"$ref": "#/definitions/json"
}
}
],
"responses": {
"200": {
"description": "{processing} models.processing"
}
}
}
},
"/processing/{id}": {
"get": {
"tags": [
"processing"
],
"description": "find processing by id\n\u003cbr\u003e",
"operationId": "ProcessingController.Get",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the id you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{processing} models.processing"
}
}
},
"put": {
"tags": [
"processing"
],
"description": "create processings\n\u003cbr\u003e",
"operationId": "ProcessingController.Update",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the processing id you want to get",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The processing content",
"required": true,
"schema": {
"$ref": "#/definitions/models.processing"
}
}
],
"responses": {
"200": {
"description": "{processing} models.processing"
}
}
},
"delete": {
"tags": [
"processing"
],
"description": "delete the processing\n\u003cbr\u003e",
"operationId": "ProcessingController.Delete",
"parameters": [
{
"in": "path",
"name": "id",
"description": "The id you want to delete",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{processing} delete success!"
}
}
}
},
"/storage/": {
"get": {
"tags": [
"storage"
],
"description": "find storage by id\n\u003cbr\u003e",
"operationId": "StorageController.GetAll",
"responses": {
"200": {
"description": "{storage} models.storage"
}
}
},
"post": {
"tags": [
"storage"
],
"description": "create storage\n\u003cbr\u003e",
"operationId": "StorageController.Create",
"parameters": [
{
"in": "body",
"name": "storage",
"description": "body for storage content (Json format)",
"required": true,
"schema": {
"$ref": "#/definitions/json"
}
}
],
"responses": {
"200": {
"description": "{storage} models.storage"
}
}
}
},
"/storage/{id}": {
"get": {
"tags": [
"storage"
],
"description": "find storage by id\n\u003cbr\u003e",
"operationId": "StorageController.Get",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the id you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{storage} models.storage"
}
}
},
"put": {
"tags": [
"storage"
],
"description": "create storages\n\u003cbr\u003e",
"operationId": "StorageController.Update",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the storage id you want to get",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The storage content",
"required": true,
"schema": {
"$ref": "#/definitions/models.storage"
}
}
],
"responses": {
"200": {
"description": "{storage} models.storage"
}
}
},
"delete": {
"tags": [
"storage"
],
"description": "delete the storage\n\u003cbr\u003e",
"operationId": "StorageController.Delete",
"parameters": [
{
"in": "path",
"name": "id",
"description": "The id you want to delete",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{storage} delete success!"
}
}
}
},
"/version/": {
"get": {
"tags": [
"version"
],
"description": "get version\n\u003cbr\u003e",
"operationId": "VersionController.GetAll",
"responses": {
"200": {
"description": ""
}
}
}
},
"/workflow/": {
"get": {
"tags": [
"workflow"
],
"description": "find workflow by id\n\u003cbr\u003e",
"operationId": "WorkflowController.GetAll",
"responses": {
"200": {
"description": "{workflow} models.workflow"
}
}
},
"post": {
"tags": [
"workflow"
],
"description": "create workflow\n\u003cbr\u003e",
"operationId": "WorkflowController.Create",
"parameters": [
{
"in": "body",
"name": "workflow",
"description": "body for workflow content (Json format)",
"required": true,
"schema": {
"$ref": "#/definitions/json"
}
}
],
"responses": {
"200": {
"description": "{workflow} models.workflow"
}
}
}
},
"/workflow/{id}": {
"get": {
"tags": [
"workflow"
],
"description": "find workflow by id\n\u003cbr\u003e",
"operationId": "WorkflowController.Get",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the id you want to get",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{workflow} models.workflow"
}
}
},
"put": {
"tags": [
"workflow"
],
"description": "create workflows\n\u003cbr\u003e",
"operationId": "WorkflowController.Update",
"parameters": [
{
"in": "path",
"name": "id",
"description": "the workflow id you want to get",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"description": "The workflow content",
"required": true,
"schema": {
"$ref": "#/definitions/models.workflow"
}
}
],
"responses": {
"200": {
"description": "{workflow} models.workflow"
}
}
},
"delete": {
"tags": [
"workflow"
],
"description": "delete the workflow\n\u003cbr\u003e",
"operationId": "WorkflowController.Delete",
"parameters": [
{
"in": "path",
"name": "id",
"description": "The id you want to delete",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "{workflow} delete success!"
}
}
}
}
},
"definitions": {
"json": {
"title": "json",
"type": "object"
},
"models.data": {
"title": "data",
"type": "object"
},
"models.datacenter": {
"title": "datacenter",
"type": "object"
},
"models.processing": {
"title": "processing",
"type": "object"
},
"models.storage": {
"title": "storage",
"type": "object"
},
"models.workflow": {
"title": "workflow",
"type": "object"
}
},
"tags": [
{
"name": "data",
"description": "Operations about data\n"
},
{
"name": "datacenter",
"description": "Operations about data\n"
},
{
"name": "storage",
"description": "Operations about data\n"
},
{
"name": "processing",
"description": "Operations about data\n"
},
{
"name": "workflow",
"description": "Operations about data\n"
},
{
"name": "version",
"description": "VersionController operations for Version\n"
}
]
}

478
swagger/swagger.yml Normal file
View File

@@ -0,0 +1,478 @@
swagger: "2.0"
info:
title: beego Test API
description: |
beego has a very cool tools to autogenerate documents for your API
version: 1.0.0
termsOfService: http://beego.me/
contact:
email: astaxie@gmail.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
basePath: /oc/
paths:
/data/:
get:
tags:
- data
description: |-
find data by id
<br>
operationId: DataController.GetAll
responses:
"200":
description: '{data} models.data'
post:
tags:
- data
description: |-
create data
<br>
operationId: DataController.Create
parameters:
- in: body
name: data
description: body for data content (Json format)
required: true
schema:
$ref: '#/definitions/json'
responses:
"200":
description: '{data} models.data'
/data/{id}:
get:
tags:
- data
description: |-
find workflow by id
<br>
operationId: DataController.Get
parameters:
- in: path
name: id
description: the id you want to get
required: true
type: string
responses:
"200":
description: '{data} models.data'
put:
tags:
- data
description: |-
create datas
<br>
operationId: DataController.Update
parameters:
- in: path
name: id
description: the data id you want to get
required: true
type: string
- in: body
name: body
description: The data content
required: true
schema:
$ref: '#/definitions/models.data'
responses:
"200":
description: '{data} models.data'
delete:
tags:
- data
description: |-
delete the data
<br>
operationId: DataController.Delete
parameters:
- in: path
name: id
description: The id you want to delete
required: true
type: string
responses:
"200":
description: '{data} delete success!'
/datacenter/:
get:
tags:
- datacenter
description: |-
find datacenter by id
<br>
operationId: DatacenterController.GetAll
responses:
"200":
description: '{datacenter} models.datacenter'
post:
tags:
- datacenter
description: |-
create datacenter
<br>
operationId: DatacenterController.Create
parameters:
- in: body
name: datacenter
description: body for datacenter content (Json format)
required: true
schema:
$ref: '#/definitions/json'
responses:
"200":
description: '{datacenter} models.datacenter'
/datacenter/{id}:
get:
tags:
- datacenter
description: |-
find datacenter by id
<br>
operationId: DatacenterController.Get
parameters:
- in: path
name: id
description: the id you want to get
required: true
type: string
responses:
"200":
description: '{datacenter} models.datacenter'
put:
tags:
- datacenter
description: |-
create datacenters
<br>
operationId: DatacenterController.Update
parameters:
- in: path
name: id
description: the datacenter id you want to get
required: true
type: string
- in: body
name: body
description: The datacenter content
required: true
schema:
$ref: '#/definitions/models.datacenter'
responses:
"200":
description: '{datacenter} models.datacenter'
delete:
tags:
- datacenter
description: |-
delete the datacenter
<br>
operationId: DatacenterController.Delete
parameters:
- in: path
name: id
description: The id you want to delete
required: true
type: string
responses:
"200":
description: '{datacenter} delete success!'
/processing/:
get:
tags:
- processing
description: |-
find processing by id
<br>
operationId: ProcessingController.GetAll
responses:
"200":
description: '{processing} models.processing'
post:
tags:
- processing
description: |-
create processing
<br>
operationId: ProcessingController.Create
parameters:
- in: body
name: processing
description: body for processing content (Json format)
required: true
schema:
$ref: '#/definitions/json'
responses:
"200":
description: '{processing} models.processing'
/processing/{id}:
get:
tags:
- processing
description: |-
find processing by id
<br>
operationId: ProcessingController.Get
parameters:
- in: path
name: id
description: the id you want to get
required: true
type: string
responses:
"200":
description: '{processing} models.processing'
put:
tags:
- processing
description: |-
create processings
<br>
operationId: ProcessingController.Update
parameters:
- in: path
name: id
description: the processing id you want to get
required: true
type: string
- in: body
name: body
description: The processing content
required: true
schema:
$ref: '#/definitions/models.processing'
responses:
"200":
description: '{processing} models.processing'
delete:
tags:
- processing
description: |-
delete the processing
<br>
operationId: ProcessingController.Delete
parameters:
- in: path
name: id
description: The id you want to delete
required: true
type: string
responses:
"200":
description: '{processing} delete success!'
/storage/:
get:
tags:
- storage
description: |-
find storage by id
<br>
operationId: StorageController.GetAll
responses:
"200":
description: '{storage} models.storage'
post:
tags:
- storage
description: |-
create storage
<br>
operationId: StorageController.Create
parameters:
- in: body
name: storage
description: body for storage content (Json format)
required: true
schema:
$ref: '#/definitions/json'
responses:
"200":
description: '{storage} models.storage'
/storage/{id}:
get:
tags:
- storage
description: |-
find storage by id
<br>
operationId: StorageController.Get
parameters:
- in: path
name: id
description: the id you want to get
required: true
type: string
responses:
"200":
description: '{storage} models.storage'
put:
tags:
- storage
description: |-
create storages
<br>
operationId: StorageController.Update
parameters:
- in: path
name: id
description: the storage id you want to get
required: true
type: string
- in: body
name: body
description: The storage content
required: true
schema:
$ref: '#/definitions/models.storage'
responses:
"200":
description: '{storage} models.storage'
delete:
tags:
- storage
description: |-
delete the storage
<br>
operationId: StorageController.Delete
parameters:
- in: path
name: id
description: The id you want to delete
required: true
type: string
responses:
"200":
description: '{storage} delete success!'
/version/:
get:
tags:
- version
description: |-
get version
<br>
operationId: VersionController.GetAll
responses:
"200":
description: ""
/workflow/:
get:
tags:
- workflow
description: |-
find workflow by id
<br>
operationId: WorkflowController.GetAll
responses:
"200":
description: '{workflow} models.workflow'
post:
tags:
- workflow
description: |-
create workflow
<br>
operationId: WorkflowController.Create
parameters:
- in: body
name: workflow
description: body for workflow content (Json format)
required: true
schema:
$ref: '#/definitions/json'
responses:
"200":
description: '{workflow} models.workflow'
/workflow/{id}:
get:
tags:
- workflow
description: |-
find workflow by id
<br>
operationId: WorkflowController.Get
parameters:
- in: path
name: id
description: the id you want to get
required: true
type: string
responses:
"200":
description: '{workflow} models.workflow'
put:
tags:
- workflow
description: |-
create workflows
<br>
operationId: WorkflowController.Update
parameters:
- in: path
name: id
description: the workflow id you want to get
required: true
type: string
- in: body
name: body
description: The workflow content
required: true
schema:
$ref: '#/definitions/models.workflow'
responses:
"200":
description: '{workflow} models.workflow'
delete:
tags:
- workflow
description: |-
delete the workflow
<br>
operationId: WorkflowController.Delete
parameters:
- in: path
name: id
description: The id you want to delete
required: true
type: string
responses:
"200":
description: '{workflow} delete success!'
definitions:
json:
title: json
type: object
models.data:
title: data
type: object
models.datacenter:
title: datacenter
type: object
models.processing:
title: processing
type: object
models.storage:
title: storage
type: object
models.workflow:
title: workflow
type: object
tags:
- name: data
description: |
Operations about data
- name: datacenter
description: |
Operations about data
- name: storage
description: |
Operations about data
- name: processing
description: |
Operations about data
- name: workflow
description: |
Operations about data
- name: version
description: |
VersionController operations for Version