Skip to content

Commit

Permalink
added API components for Processes and Jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
lathoub committed Sep 7, 2024
1 parent ad8d21e commit 14021dc
Show file tree
Hide file tree
Showing 12 changed files with 844 additions and 167 deletions.
2 changes: 1 addition & 1 deletion config/demoservice.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: amstelveen
title: OGC API Demo Service
description: OGC APIs are constructed as "building blocks" that can be used to assemble novel APIs for web access to geospatial content
description: OGC APIs are constructed as 'building blocks' that can be used to assemble novel APIs for web access to geospatial content
metadata:
contactName: Jane Doe
contactEmail: [email protected]
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"swagger-ui-express": "^5.0.1",
"url-join": "^5.0.0",
"yaml": "^2.5.0"
},
"devDependencies": {
"@types/dockerode": "^3.3.31"
}
}
1 change: 1 addition & 0 deletions processen/echoService/launch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import random from '@types/dockerode'
import { Docker, Options } from "docker-cli-js";
import http from "axios";

Expand Down
33 changes: 33 additions & 0 deletions src/apiTemplates/jobs/components/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"fJob": {
"name": "f",
"in": "query",
"description": "Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the accept header will be used to determine the format.",
"required": false,
"style": "form",
"explode": false,
"schema": {
"type": "string",
"enum": [
"html",
"json"
]
}
},
"fResults": {
"name": "f",
"in": "query",
"description": "Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the accept header will be used to determine the format.",
"required": false,
"style": "form",
"explode": false,
"schema": {
"type": "string",
"enum": [
"html",
"json"
]
}
}

}
29 changes: 29 additions & 0 deletions src/apiTemplates/jobs/components/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Jobs": {
"type": "object",
"required": [
"id", "links"
],
"properties": {
"itemType": {
"type": "string"
},
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"links": {
"type": "array",
"items": {
"$ref": "#/components/schemas/link"
}
}
}
}

}
159 changes: 159 additions & 0 deletions src/apiTemplates/jobs/paths.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"/jobs":{
"get":{
"description":"Retrieve a list of jobs",
"operationId":"getJobs",
"responses":{
"200": {
"description": "The operation was executed successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Jobs"
}
},
"text/html": {
"schema": {
"$ref": "#/components/schemas/htmlSchema"
}
}
}
},
"404":{
"$ref":"https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/responses/NotFound.yaml"
}
},
"summary":"Retrieve jobs list",
"tags":[
"Jobs"
]
}
},
"/jobs/{jobId}":{
"delete":{
"description":"Cancel / delete job",
"operationId":"deleteJob",
"parameters":[
{
"description":"job identifier",
"in":"path",
"name":"jobId",
"required":true,
"schema":{
"type":"string"
}
}
],
"responses":{
"200": {
"description": "The operation was executed successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Process"
}
},
"text/html": {
"schema": {
"$ref": "#/components/schemas/htmlSchema"
}
}
}
},
"404":{
"$ref":"https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/responses/NotFound.yaml"
}
},
"summary":"Cancel / delete job",
"tags":[
"Jobs"
]
},
"get":{
"description":"Retrieve job details",
"operationId":"getJob",
"parameters":[
{
"description":"job identifier",
"in":"path",
"name":"jobId",
"required":true,
"schema":{
"type":"string"
}
},
{
"$ref":"#/components/parameters/fJob"
}
],
"responses":{
"200": {
"description": "The operation was executed successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Process"
}
},
"text/html": {
"schema": {
"$ref": "#/components/schemas/htmlSchema"
}
}
}
},
"404":{
"$ref":"https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/responses/NotFound.yaml"
}
},
"summary":"Retrieve job details",
"tags":[
"Jobs"
]
}
},
"/jobs/{jobId}/results":{
"get":{
"description":"Retrieve job results",
"operationId":"getJobResults",
"parameters":[
{
"description":"job identifier",
"in":"path",
"name":"jobId",
"required":true,
"schema":{
"type":"string"
}
},
{
"$ref":"#/components/parameters/fResults"
}
],
"responses":{
"200": {
"description": "The operation was executed successfully.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Process"
}
},
"text/html": {
"schema": {
"$ref": "#/components/schemas/htmlSchema"
}
}
}
},
"404":{
"$ref":"https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/responses/NotFound.yaml"
}
},
"summary":"Retrieve job results",
"tags":[
"Jobs"
]
}
}
}
32 changes: 32 additions & 0 deletions src/apiTemplates/processes/components/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"fProcesses": {
"name": "f",
"in": "query",
"description": "Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the accept header will be used to determine the format.",
"required": false,
"style": "form",
"explode": false,
"schema": {
"type": "string",
"enum": [
"html",
"json"
]
}
},
"fProcess": {
"name": "f",
"in": "query",
"description": "Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the accept header will be used to determine the format.",
"required": false,
"style": "form",
"explode": false,
"schema": {
"type": "string",
"enum": [
"html",
"json"
]
}
}
}
76 changes: 76 additions & 0 deletions src/apiTemplates/processes/components/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"Processes": {
"type": "object",
"required": [
"links",
"processes"
],
"properties": {
"processes": {
"type": "array",
"items": {
"allOf": [
{
"$ref": "#/components/schemas/Collection"
},
{
"$ref": "#/components/schemas/Collection-link"
}
]
}
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"links": {
"type": "array",
"items": {
"$ref": "#/components/schemas/link"
}
}
}
},
"process-link": {
"properties": {
"links": {
"items": {
"$ref": "#/components/schemas/link"
},
"type": "array"
}
},
"required": [
"links"
],
"type": "object"
},
"Process": {
"type": "object",
"required": [
"id", "links"
],
"properties": {
"itemType": {
"type": "string"
},
"id": {
"type": "string"
},
"description": {
"type": "string"
},
"title": {
"type": "string"
},
"links": {
"type": "array",
"items": {
"$ref": "#/components/schemas/link"
}
}
}
}
}
Loading

0 comments on commit 14021dc

Please sign in to comment.