This commit is contained in:
@@ -19,6 +19,9 @@ import (
|
|||||||
// swagger:model postParamsBody
|
// swagger:model postParamsBody
|
||||||
type PostParamsBody struct {
|
type PostParamsBody struct {
|
||||||
|
|
||||||
|
// json input to convert to spreadsheet
|
||||||
|
InData interface{} `json:"in-data,omitempty"`
|
||||||
|
|
||||||
// Name of the json input file to utilise
|
// Name of the json input file to utilise
|
||||||
Infile string `json:"infile,omitempty"`
|
Infile string `json:"infile,omitempty"`
|
||||||
|
|
||||||
|
@@ -72,6 +72,10 @@ func init() {
|
|||||||
"out-filename"
|
"out-filename"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"in-data": {
|
||||||
|
"description": "json input to convert to spreadsheet",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"infile": {
|
"infile": {
|
||||||
"description": "Name of the json input file to utilise",
|
"description": "Name of the json input file to utilise",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -137,7 +141,7 @@ func init() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"action": "exec",
|
"action": "exec",
|
||||||
"exec": "ls -la /tmp",
|
"exec": "/bin/bash -c \"echo '{{ .InData | toJson }}' \u003e /tmp/input.json\"",
|
||||||
"print": true,
|
"print": true,
|
||||||
"silent": false
|
"silent": false
|
||||||
},
|
},
|
||||||
@@ -320,7 +324,7 @@ func init() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"action": "exec",
|
"action": "exec",
|
||||||
"exec": "ls -la /tmp",
|
"exec": "/bin/bash -c \"echo '{{ .InData | toJson }}' \u003e /tmp/input.json\"",
|
||||||
"print": true,
|
"print": true,
|
||||||
"silent": false
|
"silent": false
|
||||||
},
|
},
|
||||||
@@ -424,6 +428,10 @@ func init() {
|
|||||||
"out-filename"
|
"out-filename"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"in-data": {
|
||||||
|
"description": "json input to convert to spreadsheet",
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"infile": {
|
"infile": {
|
||||||
"description": "Name of the json input file to utilise",
|
"description": "Name of the json input file to utilise",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@@ -366,7 +366,7 @@ func runCommand2(ctx context.Context,
|
|||||||
params.DirektivDir,
|
params.DirektivDir,
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd, err := templateString(`ls -la /tmp`, at)
|
cmd, err := templateString(`/bin/bash -c "echo '{{ .InData | toJson }}' > /tmp/input.json"`, at)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ri.Logger().Infof("error executing command: %v", err)
|
ri.Logger().Infof("error executing command: %v", err)
|
||||||
ir[resultKey] = err.Error()
|
ir[resultKey] = err.Error()
|
||||||
|
@@ -101,6 +101,7 @@ functions:
|
|||||||
|
|
||||||
| Name | Type | Go type | Required | Default | Description | Example |
|
| Name | Type | Go type | Required | Default | Description | Example |
|
||||||
|------|------|---------|:--------:| ------- |-------------|---------|
|
|------|------|---------|:--------:| ------- |-------------|---------|
|
||||||
|
| in-data | [interface{}](#interface)| `interface{}` | | | json input to convert to spreadsheet | |
|
||||||
| infile | string| `string` | | | Name of the json input file to utilise | |
|
| infile | string| `string` | | | Name of the json input file to utilise | |
|
||||||
| out-filename | string| `string` | ✓ | `"output.xlsx"`| the filename of the output spreadsheet | |
|
| out-filename | string| `string` | ✓ | `"output.xlsx"`| the filename of the output spreadsheet | |
|
||||||
| worksheet-name | string| `string` | ✓ | `"Sheet1"`| Label for the worksheet created in the spreadsheet | |
|
| worksheet-name | string| `string` | ✓ | `"Sheet1"`| Label for the worksheet created in the spreadsheet | |
|
||||||
|
Reference in New Issue
Block a user