Skip to content

Commit

Permalink
feat(functions): generate openapi for triggers endpoints (#3104)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot committed May 5, 2023
1 parent 9982c14 commit cfab8f1
Show file tree
Hide file tree
Showing 9 changed files with 564 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create function resources.

USAGE:
scw function trigger create [arg=value ...]

ARGS:
[name]
[description]
[function-id]
[scw-sqs-config.mnq-namespace-id]
[scw-sqs-config.queue]
[scw-sqs-config.mnq-project-id]
[scw-sqs-config.mnq-region]
[sqs-config.endpoint]
[sqs-config.queue-url]
[sqs-config.access-key]
[sqs-config.secret-key]
[scw-nats-config.mnq-namespace-id]
[scw-nats-config.subject]
[scw-nats-config.mnq-project-id]
[scw-nats-config.mnq-region]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for create

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete function resources.

USAGE:
scw function trigger delete [arg=value ...]

ARGS:
trigger-id
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for delete

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-function-trigger-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get function resources.

USAGE:
scw function trigger get [arg=value ...]

ARGS:
trigger-id
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for get

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
22 changes: 22 additions & 0 deletions cmd/scw/testdata/test-all-usage-function-trigger-list-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List function resources.

USAGE:
scw function trigger list [arg=value ...]

ARGS:
[order-by] (created_at_asc | created_at_desc)
[function-id]
[namespace-id]
[project-id] Project ID to use. If none is passed the default project ID will be used
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update function resources.

USAGE:
scw function trigger update [arg=value ...]

ARGS:
trigger-id
[name]
[description]
[sqs-config.access-key]
[sqs-config.secret-key]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for update

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
24 changes: 24 additions & 0 deletions cmd/scw/testdata/test-all-usage-function-trigger-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Trigger management commands.

USAGE:
scw function trigger <command>

AVAILABLE COMMANDS:
create Create function resources
delete Delete function resources
get Get function resources
list List function resources
update Update function resources

FLAGS:
-h, --help help for trigger

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw function trigger [command] --help" for more information about a command.
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-all-usage-function-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ AVAILABLE COMMANDS:
namespace Function namespace management commands
runtime Runtime management commands
token Token management commands
trigger Trigger management commands

WORKFLOW COMMANDS:
deploy Deploy a function
Expand Down
132 changes: 132 additions & 0 deletions docs/commands/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Serverless Functions API.
- [Delete a token](#delete-a-token)
- [Get a token](#get-a-token)
- [List all tokens](#list-all-tokens)
- [Trigger management commands](#trigger-management-commands)
- [Create function resources](#create-function-resources)
- [Delete function resources](#delete-function-resources)
- [Get function resources](#get-function-resources)
- [List function resources](#list-function-resources)
- [Update function resources](#update-function-resources)


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



## Trigger management commands

Trigger management commands.


### Create function resources

Create function resources.

**Usage:**

```
scw function trigger create [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| name | | |
| description | | |
| function-id | | |
| scw-sqs-config.mnq-namespace-id | | |
| scw-sqs-config.queue | | |
| scw-sqs-config.mnq-project-id | | |
| scw-sqs-config.mnq-region | | |
| sqs-config.endpoint | | |
| sqs-config.queue-url | | |
| sqs-config.access-key | | |
| sqs-config.secret-key | | |
| scw-nats-config.mnq-namespace-id | | |
| scw-nats-config.subject | | |
| scw-nats-config.mnq-project-id | | |
| scw-nats-config.mnq-region | | |
| 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 |



### Delete function resources

Delete function resources.

**Usage:**

```
scw function trigger delete [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| trigger-id | Required | |
| 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 |



### Get function resources

Get function resources.

**Usage:**

```
scw function trigger get [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| trigger-id | Required | |
| 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 |



### List function resources

List function resources.

**Usage:**

```
scw function trigger list [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| order-by | One of: `created_at_asc`, `created_at_desc` | |
| function-id | | |
| namespace-id | | |
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| 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 |



### Update function resources

Update function resources.

**Usage:**

```
scw function trigger update [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| trigger-id | Required | |
| name | | |
| description | | |
| sqs-config.access-key | | |
| sqs-config.secret-key | | |
| 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 |



0 comments on commit cfab8f1

Please sign in to comment.