Skip to content

Commit cfab8f1

Browse files
authored
feat(functions): generate openapi for triggers endpoints (#3104)
1 parent 9982c14 commit cfab8f1

9 files changed

+564
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create function resources.
4+
5+
USAGE:
6+
scw function trigger create [arg=value ...]
7+
8+
ARGS:
9+
[name]
10+
[description]
11+
[function-id]
12+
[scw-sqs-config.mnq-namespace-id]
13+
[scw-sqs-config.queue]
14+
[scw-sqs-config.mnq-project-id]
15+
[scw-sqs-config.mnq-region]
16+
[sqs-config.endpoint]
17+
[sqs-config.queue-url]
18+
[sqs-config.access-key]
19+
[sqs-config.secret-key]
20+
[scw-nats-config.mnq-namespace-id]
21+
[scw-nats-config.subject]
22+
[scw-nats-config.mnq-project-id]
23+
[scw-nats-config.mnq-region]
24+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
25+
26+
FLAGS:
27+
-h, --help help for create
28+
29+
GLOBAL FLAGS:
30+
-c, --config string The path to the config file
31+
-D, --debug Enable debug mode
32+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
33+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete function resources.
4+
5+
USAGE:
6+
scw function trigger delete [arg=value ...]
7+
8+
ARGS:
9+
trigger-id
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Get function resources.
4+
5+
USAGE:
6+
scw function trigger get [arg=value ...]
7+
8+
ARGS:
9+
trigger-id
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
11+
12+
FLAGS:
13+
-h, --help help for get
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List function resources.
4+
5+
USAGE:
6+
scw function trigger list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] (created_at_asc | created_at_desc)
10+
[function-id]
11+
[namespace-id]
12+
[project-id] Project ID to use. If none is passed the default project ID will be used
13+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
14+
15+
FLAGS:
16+
-h, --help help for list
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Update function resources.
4+
5+
USAGE:
6+
scw function trigger update [arg=value ...]
7+
8+
ARGS:
9+
trigger-id
10+
[name]
11+
[description]
12+
[sqs-config.access-key]
13+
[sqs-config.secret-key]
14+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
15+
16+
FLAGS:
17+
-h, --help help for update
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Trigger management commands.
4+
5+
USAGE:
6+
scw function trigger <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Create function resources
10+
delete Delete function resources
11+
get Get function resources
12+
list List function resources
13+
update Update function resources
14+
15+
FLAGS:
16+
-h, --help help for trigger
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
23+
24+
Use "scw function trigger [command] --help" for more information about a command.

cmd/scw/testdata/test-all-usage-function-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ AVAILABLE COMMANDS:
1212
namespace Function namespace management commands
1313
runtime Runtime management commands
1414
token Token management commands
15+
trigger Trigger management commands
1516

1617
WORKFLOW COMMANDS:
1718
deploy Deploy a function

docs/commands/function.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Serverless Functions API.
3737
- [Delete a token](#delete-a-token)
3838
- [Get a token](#get-a-token)
3939
- [List all tokens](#list-all-tokens)
40+
- [Trigger management commands](#trigger-management-commands)
41+
- [Create function resources](#create-function-resources)
42+
- [Delete function resources](#delete-function-resources)
43+
- [Get function resources](#get-function-resources)
44+
- [List function resources](#list-function-resources)
45+
- [Update function resources](#update-function-resources)
4046

4147

4248
## Cron management commands
@@ -714,3 +720,129 @@ scw function token list [arg=value ...]
714720

715721

716722

723+
## Trigger management commands
724+
725+
Trigger management commands.
726+
727+
728+
### Create function resources
729+
730+
Create function resources.
731+
732+
**Usage:**
733+
734+
```
735+
scw function trigger create [arg=value ...]
736+
```
737+
738+
739+
**Args:**
740+
741+
| Name | | Description |
742+
|------|---|-------------|
743+
| name | | |
744+
| description | | |
745+
| function-id | | |
746+
| scw-sqs-config.mnq-namespace-id | | |
747+
| scw-sqs-config.queue | | |
748+
| scw-sqs-config.mnq-project-id | | |
749+
| scw-sqs-config.mnq-region | | |
750+
| sqs-config.endpoint | | |
751+
| sqs-config.queue-url | | |
752+
| sqs-config.access-key | | |
753+
| sqs-config.secret-key | | |
754+
| scw-nats-config.mnq-namespace-id | | |
755+
| scw-nats-config.subject | | |
756+
| scw-nats-config.mnq-project-id | | |
757+
| scw-nats-config.mnq-region | | |
758+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
759+
760+
761+
762+
### Delete function resources
763+
764+
Delete function resources.
765+
766+
**Usage:**
767+
768+
```
769+
scw function trigger delete [arg=value ...]
770+
```
771+
772+
773+
**Args:**
774+
775+
| Name | | Description |
776+
|------|---|-------------|
777+
| trigger-id | Required | |
778+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
779+
780+
781+
782+
### Get function resources
783+
784+
Get function resources.
785+
786+
**Usage:**
787+
788+
```
789+
scw function trigger get [arg=value ...]
790+
```
791+
792+
793+
**Args:**
794+
795+
| Name | | Description |
796+
|------|---|-------------|
797+
| trigger-id | Required | |
798+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
799+
800+
801+
802+
### List function resources
803+
804+
List function resources.
805+
806+
**Usage:**
807+
808+
```
809+
scw function trigger list [arg=value ...]
810+
```
811+
812+
813+
**Args:**
814+
815+
| Name | | Description |
816+
|------|---|-------------|
817+
| order-by | One of: `created_at_asc`, `created_at_desc` | |
818+
| function-id | | |
819+
| namespace-id | | |
820+
| project-id | | Project ID to use. If none is passed the default project ID will be used |
821+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
822+
823+
824+
825+
### Update function resources
826+
827+
Update function resources.
828+
829+
**Usage:**
830+
831+
```
832+
scw function trigger update [arg=value ...]
833+
```
834+
835+
836+
**Args:**
837+
838+
| Name | | Description |
839+
|------|---|-------------|
840+
| trigger-id | Required | |
841+
| name | | |
842+
| description | | |
843+
| sqs-config.access-key | | |
844+
| sqs-config.secret-key | | |
845+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
846+
847+
848+

0 commit comments

Comments
 (0)