diff --git a/api/default/error-501.json b/api/default/error-501.json new file mode 100644 index 0000000..49c0d59 --- /dev/null +++ b/api/default/error-501.json @@ -0,0 +1,28 @@ +{ + "name": "error-501", + "guide": "{{.SelfFolder}}/error-501.md", + "description": "503 error response", + "templates": [ + { + "engine": "", + "folder": "{{.SelfFolder}}/{{.TemplateName}", + "file_name": "error-nnn.tmpl", + "output_folder": "", + "output_name": "", + "section": "", + "model": { + "activity": { + "category": "OTHER" + } + } + } + ], + "variables": [ + {"label": "OpenAPI","source" :"","default":"","name":"openapi.type","type":"string","value":"path-responses"}, + {"label": "OpenAPI","source" :"","default":"","name":"name","type":"string","value":"^/.*$"}, + {"label": "OpenAPI","source" :"","default":"","name":"method","type":"string","value":"GET, POST, DELETE, PUT, PATCH"}, + {"label": "OpenAPI","source" :"","default":"","name":"httpCode","type":"string","value":"501"}, + {"label": "OpenAPI","source" :"","default":"","name":"ref","type":"string","value":""}, + {"label": "OpenAPI","source" :"","default":"","name":"value","type":"string","value":"*CONTENT"} + ] +} diff --git a/api/default/error-501.md b/api/default/error-501.md new file mode 100644 index 0000000..bd18613 --- /dev/null +++ b/api/default/error-501.md @@ -0,0 +1,6 @@ +# 501 Not Implemented + +The HTTP code 501 indicates that the server has not implemented this service at +this path and for this method. + +For more information see [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/501](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/501) diff --git a/api/default/error-501/error-nnn.tmpl b/api/default/error-501/error-nnn.tmpl new file mode 100644 index 0000000..ddb131a --- /dev/null +++ b/api/default/error-501/error-nnn.tmpl @@ -0,0 +1,10 @@ +{ + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error-model" + } + } + }, + "description": "The service is not implemented" +} \ No newline at end of file diff --git a/api/default/error-503.json b/api/default/error-503.json new file mode 100644 index 0000000..d4c9510 --- /dev/null +++ b/api/default/error-503.json @@ -0,0 +1,28 @@ +{ + "name": "error-503", + "guide": "{{.SelfFolder}}/error-503.md", + "description": "503 error response", + "templates": [ + { + "engine": "", + "folder": "{{.SelfFolder}}/{{.TemplateName}", + "file_name": "error-nnn.tmpl", + "output_folder": "", + "output_name": "", + "section": "", + "model": { + "activity": { + "category": "OTHER" + } + } + } + ], + "variables": [ + {"label": "OpenAPI","source" :"","default":"","name":"openapi.type","type":"string","value":"path-responses"}, + {"label": "OpenAPI","source" :"","default":"","name":"name","type":"string","value":"^/.*$"}, + {"label": "OpenAPI","source" :"","default":"","name":"method","type":"string","value":"GET, POST, DELETE, PUT, PATCH"}, + {"label": "OpenAPI","source" :"","default":"","name":"httpCode","type":"string","value":"503"}, + {"label": "OpenAPI","source" :"","default":"","name":"ref","type":"string","value":""}, + {"label": "OpenAPI","source" :"","default":"","name":"value","type":"string","value":"*CONTENT"} + ] +} diff --git a/api/default/error-503.md b/api/default/error-503.md new file mode 100644 index 0000000..f05f49b --- /dev/null +++ b/api/default/error-503.md @@ -0,0 +1,6 @@ +# 503 Service Unavailable + +The HTTP code 503 indicates that the server is not ready to handle the request. This could be a temporary +or longer term issue. + +For more information see [https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/503) diff --git a/api/default/error-503/error-nnn.tmpl b/api/default/error-503/error-nnn.tmpl new file mode 100644 index 0000000..7788426 --- /dev/null +++ b/api/default/error-503/error-nnn.tmpl @@ -0,0 +1,10 @@ +{ + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error-model" + } + } + }, + "description": "The service is unavailable" +} \ No newline at end of file diff --git a/api/default/error-path.json b/api/default/error-path.json index 84226f3..9a36d25 100644 --- a/api/default/error-path.json +++ b/api/default/error-path.json @@ -18,7 +18,7 @@ } ], "variables": [ - {"label": "OpenAPI","source" :"","default":"","name":"openapi.type","type":"string","value":"path"}, + {"label": "OpenAPI","source" :"","default":"","name":"openapi.type","type":"string","value":"path-responses"}, {"label": "OpenAPI","source" :"","default":"","name":"name","type":"string","value":"^/.*$"}, {"label": "OpenAPI","source" :"","default":"","name":"method","type":"string","value":"GET, POST, DELETE, PUT, PATCH"}, {"label": "OpenAPI","source" :"","default":"","name":"httpCode","type":"string","value":"500,503"}, diff --git a/api/default/health-patch.json b/api/default/health-patch.json new file mode 100644 index 0000000..03607ec --- /dev/null +++ b/api/default/health-patch.json @@ -0,0 +1,27 @@ +{ + "name": "health-patch", + "guide": "{{.SelfFolder}}/health-patch.md", + "description": "Health service patch", + "templates": [ + { + "engine": "", + "folder": "{{.SelfFolder}}/{{.TemplateName}}", + "file_name": "health-patch.json", + "output_folder": "", + "output_name": "", + "section": "", + "model": { + "activity": { + "category": "OTHER" + } + } + } + ], + "variables": [ + {"label": "OpenAPI","source" :"","default":"","name":"openapi.type","type":"string","value":"path-method"}, + {"label": "OpenAPI","source" :"","default":"","name":"name","type":"string","value":"^/health.*$"}, + {"label": "OpenAPI","source" :"","default":"","name":"method","type":"string","value":"PATCH"}, + {"label": "OpenAPI","source" :"","default":"","name":"value","type":"string","value":"*CONTENT"}, + {"label": "OpenAPI","source" :"","default":"","name":"tag","type":"string","value":"ManageService"} + ] +} diff --git a/api/default/health-patch/health-patch.json b/api/default/health-patch/health-patch.json new file mode 100644 index 0000000..f147dc6 --- /dev/null +++ b/api/default/health-patch/health-patch.json @@ -0,0 +1,143 @@ +{ + "tags": [ + "Draft", + "ManageService" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/health-model" + }, + "examples": { + "Simple-health": { + "value": { + "status": "PASS", + "version": "some text", + "notes": [ + "some text", + "some text" + ], + "output": "some text", + "description": "some text", + "checks": {}, + "release_id": "some text", + "service_id": "some text", + "links": [ + { + "href": "some text", + "rel": "some text", + "operation": "PUT", + "caption": "some text", + "media_type": "some text" + }, + { + "href": "some text", + "rel": "some text", + "operation": "POST", + "caption": "some text", + "media_type": "some text" + } + ] + } + } + } + } + }, + "description": "The service is healthy" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error-model" + } + } + }, + "description": "Request is not valid" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error-model" + } + } + }, + "description": "Unauthorised request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error-model" + }, + "examples": { + "health500error": { + "value": { + "status": "some text", + "message": "some text", + "resolution": "some text", + "technical": "some text" + } + } + } + } + }, + "description": "Internal error with service, with minimal\ninformation available" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/health-model" + }, + "examples": { + "ealth503error": { + "value": { + "status": "FAIL", + "version": "some text", + "notes": [ + "some text", + "some text" + ], + "output": "some text", + "description": "some text", + "checks": {}, + "release_id": "some text", + "service_id": "some text", + "links": [ + { + "href": "some text", + "rel": "some text", + "operation": "GET", + "caption": "some text", + "media_type": "some text" + }, + { + "href": "some text", + "rel": "some text", + "operation": "DELETE", + "caption": "some text", + "media_type": "some text" + } + ] + } + } + } + } + }, + "description": "The service is unavailable" + } + }, + "security": [ + { + "oauth": [], + "apikey": [] + } + ], + "operationId": "gethealth", + "summary": "Patches the health of the service", + "description": "Simple patch for the service" +} \ No newline at end of file