139 lines
3.2 KiB
Markdown
139 lines
3.2 KiB
Markdown
|
|
# export-xlsx 1.0
|
|
|
|
Transform json input to xlsx spreadsheet
|
|
|
|
---
|
|
- #### Categories: unknown
|
|
- #### Image: registry.coadcorp.com/export-xlsx:1.0
|
|
- #### License: [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
- #### Issue Tracking: https://git.coadcorp.com/nathan/export-xlsx/issues
|
|
- #### URL: https://git.coadcorp.com/nathan/export-xls
|
|
- #### Maintainer: [nathan.coad@dell.com](nathan.coad@dell.com)
|
|
---
|
|
|
|
## About export-xlsx
|
|
|
|
Transform json input to excel spreadsheet via json2excel command
|
|
|
|
### Example(s)
|
|
#### Function Configuration
|
|
```yaml
|
|
functions:
|
|
- id: export-xlsx
|
|
image: registry.coadcorp.com/export-xlsx:1.0
|
|
type: knative-workflow
|
|
```
|
|
#### Basic
|
|
```yaml
|
|
- id: export-xlsx
|
|
type: action
|
|
action:
|
|
function: export-xlsx
|
|
input:
|
|
out-filename: example.xlsx
|
|
sheets:
|
|
- name: "TestSpreadsheet"
|
|
input-file:
|
|
- name: input.json
|
|
data: |
|
|
jq(.input)
|
|
```
|
|
#### Use jq to add a parent key 'input' containing array of objects
|
|
```yaml
|
|
- id: export-xlsx
|
|
type: action
|
|
action:
|
|
function: export-xlsx
|
|
input:
|
|
out-filename: example.xlsx
|
|
sheets:
|
|
- name: "TestSpreadsheet"
|
|
input-file:
|
|
- name: input.json
|
|
data: |
|
|
jq(.array | {input: . } | tostring )
|
|
```
|
|
|
|
### Secrets
|
|
|
|
|
|
- **export-xlsxSecret**: This is a secret value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Request
|
|
|
|
|
|
|
|
#### Request Attributes
|
|
[PostParamsBody](#post-params-body)
|
|
|
|
### Response
|
|
List of executed commands.
|
|
#### Reponse Types
|
|
|
|
|
|
|
|
[PostOKBody](#post-o-k-body)
|
|
#### Example Reponses
|
|
|
|
```json
|
|
"{\"export-excel\": \"JVBERi0xLjUKJdDUxdgKNSAwIG9iago8PAov==\"}"
|
|
```
|
|
|
|
### Errors
|
|
| Type | Description
|
|
|------|---------|
|
|
| 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 |
|
|
|
|
|
|
### Types
|
|
#### <span id="post-o-k-body"></span> postOKBody
|
|
|
|
|
|
|
|
|
|
|
|
**Properties**
|
|
|
|
| Name | Type | Go type | Required | Default | Description | Example |
|
|
|------|------|---------|:--------:| ------- |-------------|---------|
|
|
| export-excel | string| `string` | | | | |
|
|
|
|
|
|
#### <span id="post-params-body"></span> postParamsBody
|
|
|
|
|
|
|
|
|
|
|
|
**Properties**
|
|
|
|
| Name | Type | Go type | Required | Default | Description | Example |
|
|
|------|------|---------|:--------:| ------- |-------------|---------|
|
|
| out-filename | string| `string` | | `"output.xlsx"`| the filename of the output spreadsheet | |
|
|
| sheets | [][PostParamsBodySheetsItems](#post-params-body-sheets-items)| `[]*PostParamsBodySheetsItems` | | | Array of worksheets to create in spreadsheet | |
|
|
|
|
|
|
#### <span id="post-params-body-sheets-items"></span> postParamsBodySheetsItems
|
|
|
|
|
|
|
|
|
|
|
|
**Properties**
|
|
|
|
| Name | Type | Go type | Required | Default | Description | Example |
|
|
|------|------|---------|:--------:| ------- |-------------|---------|
|
|
| infile | string| `string` | | | Name of the json input file to utilise | |
|
|
| input-file | [][DirektivFile](#direktiv-file)| `[]apps.DirektivFile` | | | File to create before running commands | |
|
|
| name | string| `string` | | `"Sheet1"`| Label for the worksheet created in the spreadsheet | |
|
|
|
|
|