431 lines
13 KiB
Go
431 lines
13 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package restapi
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
var (
|
|
// SwaggerJSON embedded version of the swagger document used at generation time
|
|
SwaggerJSON json.RawMessage
|
|
// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
|
|
FlatSwaggerJSON json.RawMessage
|
|
)
|
|
|
|
func init() {
|
|
SwaggerJSON = json.RawMessage([]byte(`{
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"schemes": [
|
|
"http"
|
|
],
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "Transform json input to xlsx spreadsheet",
|
|
"title": "export-xlsx",
|
|
"version": "1.0",
|
|
"x-direktiv-meta": {
|
|
"categories": [
|
|
"unknown"
|
|
],
|
|
"container": "registry.coadcorp.com/export-xlsx:1.0",
|
|
"issues": "https://git.coadcorp.com/nathan/export-xlsx/issues",
|
|
"license": "[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)",
|
|
"long-description": "Transform json input to excel spreadsheet via json2excel command",
|
|
"maintainer": "[nathan.coad@dell.com](nathan.coad@dell.com)",
|
|
"url": "https://git.coadcorp.com/nathan/export-xls"
|
|
}
|
|
},
|
|
"paths": {
|
|
"/": {
|
|
"post": {
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"default": "development",
|
|
"description": "direktiv action id is an UUID. \nFor development it can be set to 'development'\n",
|
|
"name": "Direktiv-ActionID",
|
|
"in": "header"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"default": "/tmp",
|
|
"description": "direktiv temp dir is the working directory for that request\nFor development it can be set to e.g. '/tmp'\n",
|
|
"name": "Direktiv-TempDir",
|
|
"in": "header"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"worksheet-name",
|
|
"out-filename"
|
|
],
|
|
"properties": {
|
|
"files": {
|
|
"description": "File to create before running commands.",
|
|
"type": "array",
|
|
"default": null,
|
|
"items": {
|
|
"$ref": "#/definitions/direktivFile"
|
|
}
|
|
},
|
|
"in-data": {
|
|
"description": "json input to convert to spreadsheet",
|
|
"type": "object"
|
|
},
|
|
"infile": {
|
|
"description": "Name of the json input file to utilise",
|
|
"type": "string"
|
|
},
|
|
"out-filename": {
|
|
"description": "the filename of the output spreadsheet",
|
|
"type": "string",
|
|
"default": "output.xlsx"
|
|
},
|
|
"worksheet-name": {
|
|
"description": "Label for the worksheet created in the spreadsheet",
|
|
"type": "string",
|
|
"default": "Sheet1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of executed commands.",
|
|
"schema": {
|
|
"type": "object",
|
|
"properties": {
|
|
"export-excel": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false
|
|
},
|
|
"examples": {
|
|
"export-excel": "{\"export-excel\": \"JVBERi0xLjUKJdDUxdgKNSAwIG9iago8PAov==\"}"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "generic error response",
|
|
"schema": {
|
|
"$ref": "#/definitions/error"
|
|
},
|
|
"headers": {
|
|
"Direktiv-ErrorCode": {
|
|
"type": "string"
|
|
},
|
|
"Direktiv-ErrorMessage": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-direktiv": {
|
|
"cmds": [
|
|
{
|
|
"action": "exec",
|
|
"exec": "/bin/json2excel -inputJson {{- if eq (deref .Infile) \"\" }} \"input.json\" {{- else }} {{ .Infile }} {{- end }} -worksheetName \"{{ .WorksheetName }}\" -outputFilename '{{ .OutFilename }}'",
|
|
"print": true,
|
|
"silent": false
|
|
},
|
|
{
|
|
"action": "exec",
|
|
"exec": "base64 -w 0 {{ .OutFilename }}"
|
|
}
|
|
],
|
|
"output": "{\n \"export-excel\": {{ (index . 1).result | toJson }}\n}\n"
|
|
},
|
|
"x-direktiv-errors": {
|
|
"io.direktiv.command.error": "Command execution failed",
|
|
"io.direktiv.output.error": "Template error for output generation of the service",
|
|
"io.direktiv.ri.error": "Can not create information object from request"
|
|
},
|
|
"x-direktiv-examples": [
|
|
{
|
|
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n files:\n - name: input.json\n data: |\n jq(.input) \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx",
|
|
"title": "Rely on Direktiv to create input file"
|
|
},
|
|
{
|
|
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx\n in-data: jq(.array | tostring) ",
|
|
"title": "Use function to create input file"
|
|
}
|
|
],
|
|
"x-direktiv-function": "functions:\n- id: export-xlsx\n image: registry.coadcorp.com/export-xlsx:1.0\n type: knative-workflow",
|
|
"x-direktiv-secrets": [
|
|
{
|
|
"description": "This is a secret value",
|
|
"name": "export-xlsxSecret"
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "On cancel Direktiv sends a DELETE request to\nthe action with id in the header\n",
|
|
"name": "Direktiv-ActionID",
|
|
"in": "header"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"x-direktiv": {
|
|
"cancel": "echo 'cancel {{ .DirektivActionID }}'"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"direktivFile": {
|
|
"type": "object",
|
|
"x-go-type": {
|
|
"import": {
|
|
"package": "github.com/direktiv/apps/go/pkg/apps"
|
|
},
|
|
"type": "DirektivFile"
|
|
}
|
|
},
|
|
"error": {
|
|
"type": "object",
|
|
"required": [
|
|
"errorCode",
|
|
"errorMessage"
|
|
],
|
|
"properties": {
|
|
"errorCode": {
|
|
"type": "string"
|
|
},
|
|
"errorMessage": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`))
|
|
FlatSwaggerJSON = json.RawMessage([]byte(`{
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"schemes": [
|
|
"http"
|
|
],
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "Transform json input to xlsx spreadsheet",
|
|
"title": "export-xlsx",
|
|
"version": "1.0",
|
|
"x-direktiv-meta": {
|
|
"categories": [
|
|
"unknown"
|
|
],
|
|
"container": "registry.coadcorp.com/export-xlsx:1.0",
|
|
"issues": "https://git.coadcorp.com/nathan/export-xlsx/issues",
|
|
"license": "[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)",
|
|
"long-description": "Transform json input to excel spreadsheet via json2excel command",
|
|
"maintainer": "[nathan.coad@dell.com](nathan.coad@dell.com)",
|
|
"url": "https://git.coadcorp.com/nathan/export-xls"
|
|
}
|
|
},
|
|
"paths": {
|
|
"/": {
|
|
"post": {
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"default": "development",
|
|
"description": "direktiv action id is an UUID. \nFor development it can be set to 'development'\n",
|
|
"name": "Direktiv-ActionID",
|
|
"in": "header"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"default": "/tmp",
|
|
"description": "direktiv temp dir is the working directory for that request\nFor development it can be set to e.g. '/tmp'\n",
|
|
"name": "Direktiv-TempDir",
|
|
"in": "header"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/postParamsBody"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "List of executed commands.",
|
|
"schema": {
|
|
"$ref": "#/definitions/postOKBody"
|
|
},
|
|
"examples": {
|
|
"export-excel": "{\"export-excel\": \"JVBERi0xLjUKJdDUxdgKNSAwIG9iago8PAov==\"}"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "generic error response",
|
|
"schema": {
|
|
"$ref": "#/definitions/error"
|
|
},
|
|
"headers": {
|
|
"Direktiv-ErrorCode": {
|
|
"type": "string"
|
|
},
|
|
"Direktiv-ErrorMessage": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"x-direktiv": {
|
|
"cmds": [
|
|
{
|
|
"action": "exec",
|
|
"exec": "/bin/json2excel -inputJson {{- if eq (deref .Infile) \"\" }} \"input.json\" {{- else }} {{ .Infile }} {{- end }} -worksheetName \"{{ .WorksheetName }}\" -outputFilename '{{ .OutFilename }}'",
|
|
"print": true,
|
|
"silent": false
|
|
},
|
|
{
|
|
"action": "exec",
|
|
"exec": "base64 -w 0 {{ .OutFilename }}"
|
|
}
|
|
],
|
|
"output": "{\n \"export-excel\": {{ (index . 1).result | toJson }}\n}\n"
|
|
},
|
|
"x-direktiv-errors": {
|
|
"io.direktiv.command.error": "Command execution failed",
|
|
"io.direktiv.output.error": "Template error for output generation of the service",
|
|
"io.direktiv.ri.error": "Can not create information object from request"
|
|
},
|
|
"x-direktiv-examples": [
|
|
{
|
|
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n files:\n - name: input.json\n data: |\n jq(.input) \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx",
|
|
"title": "Rely on Direktiv to create input file"
|
|
},
|
|
{
|
|
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx\n in-data: jq(.array | tostring) ",
|
|
"title": "Use function to create input file"
|
|
}
|
|
],
|
|
"x-direktiv-function": "functions:\n- id: export-xlsx\n image: registry.coadcorp.com/export-xlsx:1.0\n type: knative-workflow",
|
|
"x-direktiv-secrets": [
|
|
{
|
|
"description": "This is a secret value",
|
|
"name": "export-xlsxSecret"
|
|
}
|
|
]
|
|
},
|
|
"delete": {
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "On cancel Direktiv sends a DELETE request to\nthe action with id in the header\n",
|
|
"name": "Direktiv-ActionID",
|
|
"in": "header"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
},
|
|
"x-direktiv": {
|
|
"cancel": "echo 'cancel {{ .DirektivActionID }}'"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"direktivFile": {
|
|
"type": "object",
|
|
"x-go-type": {
|
|
"import": {
|
|
"package": "github.com/direktiv/apps/go/pkg/apps"
|
|
},
|
|
"type": "DirektivFile"
|
|
}
|
|
},
|
|
"error": {
|
|
"type": "object",
|
|
"required": [
|
|
"errorCode",
|
|
"errorMessage"
|
|
],
|
|
"properties": {
|
|
"errorCode": {
|
|
"type": "string"
|
|
},
|
|
"errorMessage": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"postOKBody": {
|
|
"type": "object",
|
|
"properties": {
|
|
"export-excel": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"x-go-gen-location": "operations"
|
|
},
|
|
"postParamsBody": {
|
|
"type": "object",
|
|
"required": [
|
|
"worksheet-name",
|
|
"out-filename"
|
|
],
|
|
"properties": {
|
|
"files": {
|
|
"description": "File to create before running commands.",
|
|
"type": "array",
|
|
"default": [],
|
|
"items": {
|
|
"$ref": "#/definitions/direktivFile"
|
|
}
|
|
},
|
|
"in-data": {
|
|
"description": "json input to convert to spreadsheet",
|
|
"type": "object"
|
|
},
|
|
"infile": {
|
|
"description": "Name of the json input file to utilise",
|
|
"type": "string"
|
|
},
|
|
"out-filename": {
|
|
"description": "the filename of the output spreadsheet",
|
|
"type": "string",
|
|
"default": "output.xlsx"
|
|
},
|
|
"worksheet-name": {
|
|
"description": "Label for the worksheet created in the spreadsheet",
|
|
"type": "string",
|
|
"default": "Sheet1"
|
|
}
|
|
},
|
|
"x-go-gen-location": "operations"
|
|
}
|
|
}
|
|
}`))
|
|
}
|