From 583c1bd18bb584242a0c9de308317b6d39d02cb4 Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Wed, 9 Apr 2025 17:51:50 +0200 Subject: [PATCH 1/2] feat(edge-services): enable v1beta1 --- ...services-backend-stage-create-usage.golden | 2 +- ...ces-backend-stage-list-usage.cassette.yaml | 44 + ...e-services-backend-stage-list-usage.golden | 9 +- ...services-backend-stage-update-usage.golden | 1 + ...ces-cache-stage-create-usage.cassette.yaml | 41 + ...e-services-cache-stage-create-usage.golden | 4 +- ...dge-services-cache-stage-list-usage.golden | 5 +- ...e-services-cache-stage-update-usage.golden | 2 + ...dge-services-dns-stage-create-usage.golden | 2 +- ...-edge-services-dns-stage-list-usage.golden | 7 +- ...edge-services-pipeline-create-usage.golden | 7 +- ...e-edge-services-pipeline-list-usage.golden | 8 +- ...edge-services-pipeline-update-usage.golden | 7 +- ...ices-purge-request-get-usage.cassette.yaml | 41 + ...e-services-purge-request-list-usage.golden | 6 +- ...edge-services-route-rules-add-usage.golden | 24 + ...dge-services-route-rules-list-usage.golden | 18 + ...edge-services-route-rules-set-usage.golden | 22 + ...age-edge-services-route-rules-usage.golden | 22 + ...e-services-route-stage-create-usage.golden | 19 + ...e-services-route-stage-delete-usage.golden | 18 + ...edge-services-route-stage-get-usage.golden | 18 + ...dge-services-route-stage-list-usage.golden | 19 + ...e-services-route-stage-update-usage.golden | 19 + ...age-edge-services-route-stage-usage.golden | 24 + ...dge-services-tls-stage-create-usage.golden | 4 +- ...-edge-services-tls-stage-list-usage.golden | 7 +- ...dge-services-tls-stage-update-usage.golden | 2 + .../test-all-usage-edge-services-usage.golden | 3 + ...dge-services-waf-stage-create-usage.golden | 21 + ...dge-services-waf-stage-delete-usage.golden | 18 + ...e-edge-services-waf-stage-get-usage.golden | 18 + ...-edge-services-waf-stage-list-usage.golden | 19 + ...dge-services-waf-stage-update-usage.golden | 21 + ...usage-edge-services-waf-stage-usage.golden | 24 + commands/commands.go | 2 +- docs/commands/edge-services.md | 355 +++- .../v1alpha1/edge_services_cli.go | 1437 ----------------- .../{v1alpha1 => v1beta1}/custom.go | 0 39 files changed, 820 insertions(+), 1500 deletions(-) create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.cassette.yaml create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.cassette.yaml create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-purge-request-get-usage.cassette.yaml create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-rules-add-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-rules-list-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-rules-set-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-rules-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-stage-create-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-stage-delete-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-stage-get-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-stage-list-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-stage-update-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-route-stage-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-waf-stage-create-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-waf-stage-delete-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-waf-stage-get-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-waf-stage-list-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-waf-stage-update-usage.golden create mode 100644 cmd/scw/testdata/test-all-usage-edge-services-waf-stage-usage.golden delete mode 100644 internal/namespaces/edge_services/v1alpha1/edge_services_cli.go rename internal/namespaces/edge_services/{v1alpha1 => v1beta1}/custom.go (100%) diff --git a/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-create-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-create-usage.golden index 46d68e0ac4..11756d3067 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-create-usage.golden @@ -6,7 +6,6 @@ USAGE: scw edge-services backend-stage create [arg=value ...] ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used [scaleway-s3.bucket-name] Name of the Bucket [scaleway-s3.bucket-region] Region of the Bucket [scaleway-s3.is-website] Defines whether the bucket website feature is enabled @@ -15,6 +14,7 @@ ARGS: [scaleway-lb.lbs.{index}.frontend-id] ID of the frontend linked to the Load Balancer [scaleway-lb.lbs.{index}.is-ssl] Defines whether the Load Balancer's frontend handles SSL connections [scaleway-lb.lbs.{index}.domain-name] Fully Qualified Domain Name (in the format subdomain.example.com) to use in HTTP requests sent towards your Load Balancer + pipeline-id Pipeline ID the Backend stage belongs to FLAGS: -h, --help help for create diff --git a/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.cassette.yaml b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.cassette.yaml new file mode 100644 index 0000000000..c34654068f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.cassette.yaml @@ -0,0 +1,44 @@ +--- +version: 1 +interactions: +- request: + body: '{"access_key":"SCWBDFF054RNNE8204AJ", "secret_key":null, "description":"my-key", + "created_at":"2022-06-10T08:39:27.845066Z", "updated_at":"2022-07-05T15:12:12.987880Z", + "expires_at":null, "default_project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5", + "editable":true, "deletable":true, "managed":false, "creation_ip":"51.159.46.153", + "application_id":"531f5518-a0a5-44c2-b790-a9975505c89d"}' + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.33.0.20250402123125-11d6084394b9 (go1.24.0; darwin; + amd64) cli-e2e-test + url: https://api.scaleway.com/iam/v1alpha1/api-keys/SCWBDFF054RNNE8204AJ + method: GET + response: + body: '{"access_key":"SCWBDFF054RNNE8204AJ", "secret_key":null, "description":"my-key", + "created_at":"2022-06-10T08:39:27.845066Z", "updated_at":"2022-07-05T15:12:12.987880Z", + "expires_at":null, "default_project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5", + "editable":true, "deletable":true, "managed":false, "creation_ip":"51.159.46.153", + "application_id":"531f5518-a0a5-44c2-b790-a9975505c89d"}' + headers: + Content-Length: + - "388" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 08 Apr 2025 12:59:43 GMT + Server: + - Scaleway API Gateway (fr-par-1;edge01) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 129d6879-2522-484a-bcac-e1bb2aeabb78 + status: 200 OK + code: 200 + duration: "" diff --git a/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.golden index 49a0a785f7..59f4a65282 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-list-usage.golden @@ -7,11 +7,10 @@ USAGE: ARGS: [order-by] Sort order of backend stages in the response (created_at_asc | created_at_desc) - [pipeline-id] Pipeline ID to filter for, only backend stages from this pipeline will be returned - [project-id] Project ID to filter for, only backend stages from this Project will be returned - [bucket-name] Bucket name to filter for, only backend stages from this Bucket will be returned - [bucket-region] Bucket region to filter for, only backend stages with buckets in this region will be returned - [lb-id] Load Balancer ID to filter for, only backend stages with this Load Balancer will be returned + pipeline-id Pipeline ID to filter for. Only backend stages from this pipeline will be returned + [bucket-name] Bucket name to filter for. Only backend stages from this Bucket will be returned + [bucket-region] Bucket region to filter for. Only backend stages with buckets in this region will be returned + [lb-id] Load Balancer ID to filter for. Only backend stages with this Load Balancer will be returned FLAGS: -h, --help help for list diff --git a/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-update-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-update-usage.golden index 04b1dffb5d..e69841af8e 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-backend-stage-update-usage.golden @@ -15,6 +15,7 @@ ARGS: [scaleway-lb.lbs.{index}.frontend-id] ID of the frontend linked to the Load Balancer [scaleway-lb.lbs.{index}.is-ssl] Defines whether the Load Balancer's frontend handles SSL connections [scaleway-lb.lbs.{index}.domain-name] Fully Qualified Domain Name (in the format subdomain.example.com) to use in HTTP requests sent towards your Load Balancer + [pipeline-id] Pipeline ID the Backend stage belongs to FLAGS: -h, --help help for update diff --git a/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.cassette.yaml b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.cassette.yaml new file mode 100644 index 0000000000..1a19e644e9 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.cassette.yaml @@ -0,0 +1,41 @@ +--- +version: 1 +interactions: +- request: + body: '{"access_key":"SCWBDFF054RNNE8204AJ", "secret_key":null, "description":"my-key", + "created_at":"2022-06-10T08:39:27.845066Z", "updated_at":"2022-07-05T15:12:12.987880Z", + "expires_at":null, "default_project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5", + "editable":true, "creation_ip":"51.159.46.153", "application_id":"531f5518-a0a5-44c2-b790-a9975505c89d"}' + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.22.2; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/iam/v1alpha1/api-keys/SCWXXXXXXXXXXXXXXXXX + method: GET + response: + body: '{"access_key":"SCWBDFF054RNNE8204AJ", "secret_key":null, "description":"my-key", + "created_at":"2022-06-10T08:39:27.845066Z", "updated_at":"2022-07-05T15:12:12.987880Z", + "expires_at":null, "default_project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5", + "editable":true, "creation_ip":"51.159.46.153", "application_id":"531f5518-a0a5-44c2-b790-a9975505c89d"}' + headers: + Content-Length: + - "353" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 09 Jul 2024 14:44:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 5f4acf0c-34ef-4783-a893-3bcd63f3b1eb + status: 200 OK + code: 200 + duration: "" diff --git a/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.golden index eb756350cd..89f490bad0 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-create-usage.golden @@ -6,9 +6,11 @@ USAGE: scw edge-services cache-stage create [arg=value ...] ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used [fallback-ttl=3600s] Time To Live (TTL) in seconds. Defines how long content is cached [backend-stage-id] Backend stage ID the cache stage will be linked to + pipeline-id Pipeline ID the Cache stage belongs to + [waf-stage-id] + [route-stage-id] FLAGS: -h, --help help for create diff --git a/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-list-usage.golden index d1b8cbc54a..8fd72eb01f 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-list-usage.golden @@ -6,9 +6,8 @@ USAGE: scw edge-services cache-stage list [arg=value ...] ARGS: - [order-by] Sort order of cache stages in the response (created_at_asc | created_at_desc) - [pipeline-id] Pipeline ID to filter for, only cache stages from this pipeline will be returned - [project-id] Project ID to filter for, only cache stages from this Project will be returned + [order-by] Sort order of cache stages in the response (created_at_asc | created_at_desc) + pipeline-id Pipeline ID to filter for. Only cache stages from this pipeline will be returned FLAGS: -h, --help help for list diff --git a/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-update-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-update-usage.golden index 337cee39ff..c6ea33bcba 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-cache-stage-update-usage.golden @@ -9,6 +9,8 @@ ARGS: cache-stage-id ID of the cache stage to update [fallback-ttl] Time To Live (TTL) in seconds. Defines how long content is cached [backend-stage-id] Backend stage ID the cache stage will be linked to + [waf-stage-id] + [route-stage-id] FLAGS: -h, --help help for update diff --git a/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-create-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-create-usage.golden index ea08587f51..f7a4e471da 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-create-usage.golden @@ -6,11 +6,11 @@ USAGE: scw edge-services dns-stage create [arg=value ...] ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used [fqdns.{index}] Fully Qualified Domain Name (in the format subdomain.example.com) to attach to the stage [tls-stage-id] TLS stage ID the DNS stage will be linked to [cache-stage-id] Cache stage ID the DNS stage will be linked to [backend-stage-id] Backend stage ID the DNS stage will be linked to + pipeline-id Pipeline ID the DNS stage belongs to FLAGS: -h, --help help for create diff --git a/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-list-usage.golden index 55bf573c0d..b2969a94d4 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-dns-stage-list-usage.golden @@ -6,10 +6,9 @@ USAGE: scw edge-services dns-stage list [arg=value ...] ARGS: - [order-by] Sort order of DNS stages in the response (created_at_asc | created_at_desc) - [pipeline-id] Pipeline ID to filter for, only DNS stages from this pipeline will be returned - [project-id] Project ID to filter for, only DNS stages from this Project will be returned - [fqdn] Fully Qualified Domain Name to filter for (in the format subdomain.example.com), only DNS stages with this FQDN will be returned + [order-by] Sort order of DNS stages in the response (created_at_asc | created_at_desc) + pipeline-id Pipeline ID to filter for. Only DNS stages from this pipeline will be returned + [fqdn] Fully Qualified Domain Name to filter for (in the format subdomain.example.com). Only DNS stages with this FQDN will be returned FLAGS: -h, --help help for list diff --git a/cmd/scw/testdata/test-all-usage-edge-services-pipeline-create-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-pipeline-create-usage.golden index 32aad5386b..cca3b8de86 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-pipeline-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-pipeline-create-usage.golden @@ -6,10 +6,9 @@ USAGE: scw edge-services pipeline create [arg=value ...] ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used - name Name of the pipeline - description Description of the pipeline - [dns-stage-id] DNS stage ID the pipeline will be attached to + [project-id] Project ID to use. If none is passed the default project ID will be used + name Name of the pipeline + description Description of the pipeline FLAGS: -h, --help help for create diff --git a/cmd/scw/testdata/test-all-usage-edge-services-pipeline-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-pipeline-list-usage.golden index 57c4ea68c4..b9b8310aa6 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-pipeline-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-pipeline-list-usage.golden @@ -7,10 +7,10 @@ USAGE: ARGS: [order-by] Sort order of pipelines in the response (created_at_asc | created_at_desc | name_asc | name_desc) - [name] Pipeline name to filter for, only pipelines with this string within their name will be returned - [project-id] Project ID to filter for, only pipelines from this Project will be returned - [has-backend-stage-lb] Filter on backend stage, only pipelines with a Load Balancer origin will be returned - [organization-id] Organization ID to filter for, only pipelines from this Organization will be returned + [name] Pipeline name to filter for. Only pipelines with this string within their name will be returned + [project-id] Project ID to filter for. Only pipelines from this Project will be returned + [has-backend-stage-lb] Filter on backend stage. Only pipelines with a Load Balancer origin will be returned + [organization-id] Organization ID to filter for. Only pipelines from this Organization will be returned FLAGS: -h, --help help for list diff --git a/cmd/scw/testdata/test-all-usage-edge-services-pipeline-update-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-pipeline-update-usage.golden index 98e0ab1230..b2ab38ee92 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-pipeline-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-pipeline-update-usage.golden @@ -6,10 +6,9 @@ USAGE: scw edge-services pipeline update [arg=value ...] ARGS: - pipeline-id ID of the pipeline to update - [name] Name of the pipeline - [description] Description of the pipeline - [dns-stage-id] DNS stage ID the pipeline will be attached to + pipeline-id ID of the pipeline to update + [name] Name of the pipeline + [description] Description of the pipeline FLAGS: -h, --help help for update diff --git a/cmd/scw/testdata/test-all-usage-edge-services-purge-request-get-usage.cassette.yaml b/cmd/scw/testdata/test-all-usage-edge-services-purge-request-get-usage.cassette.yaml new file mode 100644 index 0000000000..7661ec02be --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-purge-request-get-usage.cassette.yaml @@ -0,0 +1,41 @@ +--- +version: 1 +interactions: +- request: + body: '{"access_key":"SCWBDFF054RNNE8204AJ", "secret_key":null, "description":"my-key", + "created_at":"2022-06-10T08:39:27.845066Z", "updated_at":"2022-07-05T15:12:12.987880Z", + "expires_at":null, "default_project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5", + "editable":true, "creation_ip":"51.159.46.153", "application_id":"531f5518-a0a5-44c2-b790-a9975505c89d"}' + form: {} + headers: + User-Agent: + - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.22.2; darwin; amd64) cli-e2e-test + url: https://api.scaleway.com/iam/v1alpha1/api-keys/SCWXXXXXXXXXXXXXXXXX + method: GET + response: + body: '{"access_key":"SCWBDFF054RNNE8204AJ", "secret_key":null, "description":"my-key", + "created_at":"2022-06-10T08:39:27.845066Z", "updated_at":"2022-07-05T15:12:12.987880Z", + "expires_at":null, "default_project_id":"564aa517-68b0-4fd7-8c8c-d21c4bcdcbd5", + "editable":true, "creation_ip":"51.159.46.153", "application_id":"531f5518-a0a5-44c2-b790-a9975505c89d"}' + headers: + Content-Length: + - "353" + Content-Security-Policy: + - default-src 'none'; frame-ancestors 'none' + Content-Type: + - application/json + Date: + - Tue, 09 Jul 2024 14:44:28 GMT + Server: + - Scaleway API Gateway (fr-par-3;edge02) + Strict-Transport-Security: + - max-age=63072000 + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + X-Request-Id: + - 1ab4042b-f80f-4f44-a25c-fdc41d0173ff + status: 200 OK + code: 200 + duration: "" diff --git a/cmd/scw/testdata/test-all-usage-edge-services-purge-request-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-purge-request-list-usage.golden index d70c6fc6bb..81c29d2ba3 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-purge-request-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-purge-request-list-usage.golden @@ -7,9 +7,9 @@ USAGE: ARGS: [order-by] Sort order of purge requests in the response (created_at_asc | created_at_desc) - [project-id] Project ID to filter for, only purge requests from this Project will be returned - [pipeline-id] Pipeline ID to filter for, only purge requests from this pipeline will be returned - [organization-id] Organization ID to filter for, only purge requests from this Project will be returned + [project-id] Project ID to filter for. Only purge requests from this Project will be returned + [pipeline-id] Pipeline ID to filter for. Only purge requests from this pipeline will be returned + [organization-id] Organization ID to filter for. Only purge requests from this Project will be returned FLAGS: -h, --help help for list diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-rules-add-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-add-usage.golden new file mode 100644 index 0000000000..9680ec8998 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-add-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Add route rules to an existing route stage, specified by its `route_stage_id`. + +USAGE: + scw edge-services route-rules add [arg=value ...] + +ARGS: + route-stage-id ID of the route stage to update + [route-rules.{index}.rule-http-match.method-filters.{index}] HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided (unknown_method_filter | get | post | put | patch | delete | head | options) + [route-rules.{index}.rule-http-match.path-filter.path-filter-type] Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type (unknown_path_filter | regex) + [route-rules.{index}.rule-http-match.path-filter.value] Value to be matched for the HTTP URL path + [route-rules.{index}.backend-stage-id] ID of the backend stage that requests matching the rule should be forwarded to + [after-position] Add rules after the given position + [before-position] Add rules before the given position + +FLAGS: + -h, --help help for add + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-rules-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-list-usage.golden new file mode 100644 index 0000000000..1c5bba6f24 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-list-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all route rules of an existing route stage, specified by its `route_stage_id`. + +USAGE: + scw edge-services route-rules list [arg=value ...] + +ARGS: + route-stage-id Route stage ID to filter for. Only route rules from this route stage will be returned + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-rules-set-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-set-usage.golden new file mode 100644 index 0000000000..0e0f5e48d7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-set-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Set the rules of an existing route stage, specified by its `route_stage_id`. + +USAGE: + scw edge-services route-rules set [arg=value ...] + +ARGS: + route-stage-id ID of the route stage to update + [route-rules.{index}.rule-http-match.method-filters.{index}] HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided (unknown_method_filter | get | post | put | patch | delete | head | options) + [route-rules.{index}.rule-http-match.path-filter.path-filter-type] Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type (unknown_path_filter | regex) + [route-rules.{index}.rule-http-match.path-filter.value] Value to be matched for the HTTP URL path + [route-rules.{index}.backend-stage-id] ID of the backend stage that requests matching the rule should be forwarded to + +FLAGS: + -h, --help help for set + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-rules-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-usage.golden new file mode 100644 index 0000000000..58d8519105 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-rules-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Route-rules management commands. + +USAGE: + scw edge-services route-rules + +AVAILABLE COMMANDS: + add Add route rules + list List route rules + set Set route rules + +FLAGS: + -h, --help help for route-rules + +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 edge-services route-rules [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-stage-create-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-create-usage.golden new file mode 100644 index 0000000000..a6bced5953 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-create-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new route stage. You must specify the `waf_stage_id` field to customize the route. + +USAGE: + scw edge-services route-stage create [arg=value ...] + +ARGS: + pipeline-id Pipeline ID the route stage belongs to + [waf-stage-id] ID of the WAF stage HTTP requests should be forwarded to when no rules are matched + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-stage-delete-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-delete-usage.golden new file mode 100644 index 0000000000..f9f30ab68e --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-delete-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete an existing route stage, specified by its `route_stage_id`. Deleting a route stage is permanent, and cannot be undone. + +USAGE: + scw edge-services route-stage delete [arg=value ...] + +ARGS: + route-stage-id ID of the route stage to delete + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-stage-get-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-get-usage.golden new file mode 100644 index 0000000000..2f5eaa5e97 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-get-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about an existing route stage, specified by its `route_stage_id`. The summary of the route stage (without route rules) is returned in the response object. + +USAGE: + scw edge-services route-stage get [arg=value ...] + +ARGS: + route-stage-id ID of the requested route stage + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-stage-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-list-usage.golden new file mode 100644 index 0000000000..2546060abd --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-list-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all route stages, for a given pipeline. By default, the route stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. + +USAGE: + scw edge-services route-stage list [arg=value ...] + +ARGS: + [order-by] Sort order of route stages in the response (created_at_asc | created_at_desc) + pipeline-id Pipeline ID to filter for. Only route stages from this pipeline will be returned + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-stage-update-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-update-usage.golden new file mode 100644 index 0000000000..7d8a61a8c0 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-update-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update the parameters of an existing route stage, specified by its `route_stage_id`. + +USAGE: + scw edge-services route-stage update [arg=value ...] + +ARGS: + route-stage-id ID of the route stage to update + [waf-stage-id] ID of the WAF stage HTTP requests should be forwarded to when no rules are matched + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-route-stage-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-usage.golden new file mode 100644 index 0000000000..dc9a9713f6 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-route-stage-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Route-stage management commands. + +USAGE: + scw edge-services route-stage + +AVAILABLE COMMANDS: + create Create route stage + delete Delete route stage + get Get route stage + list List route stages + update Update route stage + +FLAGS: + -h, --help help for route-stage + +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 edge-services route-stage [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-create-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-create-usage.golden index 161b963062..50ad2dd1f9 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-create-usage.golden @@ -6,12 +6,14 @@ USAGE: scw edge-services tls-stage create [arg=value ...] ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used [secrets.{index}.secret-id] ID of the Secret [secrets.{index}.region] Region of the Secret [managed-certificate] True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint [cache-stage-id] Cache stage ID the TLS stage will be linked to [backend-stage-id] Backend stage ID the TLS stage will be linked to + pipeline-id Pipeline ID the TLS stage belongs to + [route-stage-id] + [waf-stage-id] FLAGS: -h, --help help for create diff --git a/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-list-usage.golden index a0f326423b..d59b2aeb7c 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-list-usage.golden @@ -7,10 +7,9 @@ USAGE: ARGS: [order-by] Sort order of TLS stages in the response (created_at_asc | created_at_desc) - [pipeline-id] Pipeline ID to filter for, only TLS stages from this pipeline will be returned - [project-id] Project ID to filter for, only TLS stages from this Project will be returned - [secret-id] Secret ID to filter for, only TLS stages with this Secret ID will be returned - [secret-region] Secret region to filter for, only TLS stages with a Secret in this region will be returned + pipeline-id Pipeline ID to filter for. Only TLS stages from this pipeline will be returned + [secret-id] Secret ID to filter for. Only TLS stages with this Secret ID will be returned + [secret-region] Secret region to filter for. Only TLS stages with a Secret in this region will be returned FLAGS: -h, --help help for list diff --git a/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-update-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-update-usage.golden index 44d949f70b..7fc8e31ab1 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-tls-stage-update-usage.golden @@ -12,6 +12,8 @@ ARGS: [managed-certificate] True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint [cache-stage-id] Cache stage ID the TLS stage will be linked to [backend-stage-id] Backend stage ID the TLS stage will be linked to + [route-stage-id] + [waf-stage-id] FLAGS: -h, --help help for update diff --git a/cmd/scw/testdata/test-all-usage-edge-services-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-usage.golden index 8e3be0eba8..f179f445d8 100644 --- a/cmd/scw/testdata/test-all-usage-edge-services-usage.golden +++ b/cmd/scw/testdata/test-all-usage-edge-services-usage.golden @@ -11,7 +11,10 @@ AVAILABLE COMMANDS: dns-stage DNS-stage management commands pipeline Pipeline management commands purge-request Purge-request management commands + route-rules Route-rules management commands + route-stage Route-stage management commands tls-stage TLS-stage management commands + waf-stage WAF-stage management commands FLAGS: -h, --help help for edge-services diff --git a/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-create-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-create-usage.golden new file mode 100644 index 0000000000..ce34e71125 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-create-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new WAF stage. You must specify the `mode` and `paranoia_level` fields to customize the WAF. + +USAGE: + scw edge-services waf-stage create [arg=value ...] + +ARGS: + pipeline-id Pipeline ID the WAF stage belongs to + [mode] Mode defining WAF behavior (`disable`/`log_only`/`enable`) (unknown_mode | disable | log_only | enable) + [paranoia-level] Sensitivity level (`1`,`2`,`3`,`4`) to use when classifying requests as malicious. With a high level, requests are more likely to be classed as malicious, and false positives are expected. With a lower level, requests are more likely to be classed as benign. + [backend-stage-id] ID of the backend stage to forward requests to after the WAF stage + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-delete-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-delete-usage.golden new file mode 100644 index 0000000000..70c23d84de --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-delete-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete an existing WAF stage, specified by its `waf_stage_id`. Deleting a WAF stage is permanent, and cannot be undone. + +USAGE: + scw edge-services waf-stage delete [arg=value ...] + +ARGS: + waf-stage-id ID of the WAF stage to delete + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-get-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-get-usage.golden new file mode 100644 index 0000000000..367f8d4bf4 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-get-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about an existing WAF stage, specified by its `waf_stage_id`. Its full details are returned in the response object. + +USAGE: + scw edge-services waf-stage get [arg=value ...] + +ARGS: + waf-stage-id ID of the requested WAF stage + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-list-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-list-usage.golden new file mode 100644 index 0000000000..6992284718 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-list-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all WAF stages, for a Scaleway Organization or Scaleway Project. By default, the WAF stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. + +USAGE: + scw edge-services waf-stage list [arg=value ...] + +ARGS: + [order-by] Sort order of WAF stages in the response (created_at_asc | created_at_desc) + pipeline-id Pipeline ID to filter for. Only WAF stages from this pipeline will be returned + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-update-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-update-usage.golden new file mode 100644 index 0000000000..2b3324a43f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-update-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update the parameters of an existing WAF stage, specified by its `waf_stage_id`. Both `mode` and `paranoia_level` parameters can be updated. + +USAGE: + scw edge-services waf-stage update [arg=value ...] + +ARGS: + waf-stage-id ID of the WAF stage to update + [mode] Mode defining WAF behavior (`disable`/`log_only`/`enable`) (unknown_mode | disable | log_only | enable) + [paranoia-level] Sensitivity level (`1`,`2`,`3`,`4`) to use when classifying requests as malicious. With a high level, requests are more likely to be classed as malicious, and false positives are expected. With a lower level, requests are more likely to be classed as benign. + [backend-stage-id] ID of the backend stage to forward requests to after the WAF stage + +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 diff --git a/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-usage.golden b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-usage.golden new file mode 100644 index 0000000000..960ab79a99 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-edge-services-waf-stage-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +WAF-stage management commands. + +USAGE: + scw edge-services waf-stage + +AVAILABLE COMMANDS: + create Create WAF stage + delete Delete WAF stage + get Get WAF stage + list List WAF stages + update Update WAF stage + +FLAGS: + -h, --help help for waf-stage + +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 edge-services waf-stage [command] --help" for more information about a command. diff --git a/commands/commands.go b/commands/commands.go index 224f74c006..7296db6db9 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -18,7 +18,7 @@ import ( "github.com/scaleway/scaleway-cli/v2/internal/namespaces/dedibox/v1" documentdb "github.com/scaleway/scaleway-cli/v2/internal/namespaces/documentdb/v1beta1" domain "github.com/scaleway/scaleway-cli/v2/internal/namespaces/domain/v2beta1" - edgeservices "github.com/scaleway/scaleway-cli/v2/internal/namespaces/edge_services/v1alpha1" + edgeservices "github.com/scaleway/scaleway-cli/v2/internal/namespaces/edge_services/v1beta1" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/feedback" flexibleip "github.com/scaleway/scaleway-cli/v2/internal/namespaces/flexibleip/v1alpha1" function "github.com/scaleway/scaleway-cli/v2/internal/namespaces/function/v1beta1" diff --git a/docs/commands/edge-services.md b/docs/commands/edge-services.md index 061f42965a..64405ad645 100644 --- a/docs/commands/edge-services.md +++ b/docs/commands/edge-services.md @@ -30,12 +30,28 @@ Edge Services API - [Create purge request](#create-purge-request) - [Get purge request](#get-purge-request) - [List purge requests](#list-purge-requests) +- [Route-rules management commands](#route-rules-management-commands) + - [Add route rules](#add-route-rules) + - [List route rules](#list-route-rules) + - [Set route rules](#set-route-rules) +- [Route-stage management commands](#route-stage-management-commands) + - [Create route stage](#create-route-stage) + - [Delete route stage](#delete-route-stage) + - [Get route stage](#get-route-stage) + - [List route stages](#list-route-stages) + - [Update route stage](#update-route-stage) - [TLS-stage management commands](#tls-stage-management-commands) - [Create TLS stage](#create-tls-stage) - [Delete TLS stage](#delete-tls-stage) - [Get TLS stage](#get-tls-stage) - [List TLS stages](#list-tls-stages) - [Update TLS stage](#update-tls-stage) +- [WAF-stage management commands](#waf-stage-management-commands) + - [Create WAF stage](#create-waf-stage) + - [Delete WAF stage](#delete-waf-stage) + - [Get WAF stage](#get-waf-stage) + - [List WAF stages](#list-waf-stages) + - [Update WAF stage](#update-waf-stage) ## Backend-stage management commands @@ -58,7 +74,6 @@ scw edge-services backend-stage create [arg=value ...] | Name | | Description | |------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | | scaleway-s3.bucket-name | | Name of the Bucket | | scaleway-s3.bucket-region | | Region of the Bucket | | scaleway-s3.is-website | | Defines whether the bucket website feature is enabled | @@ -67,6 +82,7 @@ scw edge-services backend-stage create [arg=value ...] | scaleway-lb.lbs.{index}.frontend-id | | ID of the frontend linked to the Load Balancer | | scaleway-lb.lbs.{index}.is-ssl | | Defines whether the Load Balancer's frontend handles SSL connections | | scaleway-lb.lbs.{index}.domain-name | | Fully Qualified Domain Name (in the format subdomain.example.com) to use in HTTP requests sent towards your Load Balancer | +| pipeline-id | Required | Pipeline ID the Backend stage belongs to | @@ -124,11 +140,10 @@ scw edge-services backend-stage list [arg=value ...] | Name | | Description | |------|---|-------------| | order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of backend stages in the response | -| pipeline-id | | Pipeline ID to filter for, only backend stages from this pipeline will be returned | -| project-id | | Project ID to filter for, only backend stages from this Project will be returned | -| bucket-name | | Bucket name to filter for, only backend stages from this Bucket will be returned | -| bucket-region | | Bucket region to filter for, only backend stages with buckets in this region will be returned | -| lb-id | | Load Balancer ID to filter for, only backend stages with this Load Balancer will be returned | +| pipeline-id | Required | Pipeline ID to filter for. Only backend stages from this pipeline will be returned | +| bucket-name | | Bucket name to filter for. Only backend stages from this Bucket will be returned | +| bucket-region | | Bucket region to filter for. Only backend stages with buckets in this region will be returned | +| lb-id | | Load Balancer ID to filter for. Only backend stages with this Load Balancer will be returned | @@ -156,6 +171,7 @@ scw edge-services backend-stage update [arg=value ...] | scaleway-lb.lbs.{index}.frontend-id | | ID of the frontend linked to the Load Balancer | | scaleway-lb.lbs.{index}.is-ssl | | Defines whether the Load Balancer's frontend handles SSL connections | | scaleway-lb.lbs.{index}.domain-name | | Fully Qualified Domain Name (in the format subdomain.example.com) to use in HTTP requests sent towards your Load Balancer | +| pipeline-id | | Pipeline ID the Backend stage belongs to | @@ -179,9 +195,11 @@ scw edge-services cache-stage create [arg=value ...] | Name | | Description | |------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | | fallback-ttl | Default: `3600s` | Time To Live (TTL) in seconds. Defines how long content is cached | | backend-stage-id | | Backend stage ID the cache stage will be linked to | +| pipeline-id | Required | Pipeline ID the Cache stage belongs to | +| waf-stage-id | | | +| route-stage-id | | | @@ -239,8 +257,7 @@ scw edge-services cache-stage list [arg=value ...] | Name | | Description | |------|---|-------------| | order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of cache stages in the response | -| pipeline-id | | Pipeline ID to filter for, only cache stages from this pipeline will be returned | -| project-id | | Project ID to filter for, only cache stages from this Project will be returned | +| pipeline-id | Required | Pipeline ID to filter for. Only cache stages from this pipeline will be returned | @@ -262,6 +279,8 @@ scw edge-services cache-stage update [arg=value ...] | cache-stage-id | Required | ID of the cache stage to update | | fallback-ttl | | Time To Live (TTL) in seconds. Defines how long content is cached | | backend-stage-id | | Backend stage ID the cache stage will be linked to | +| waf-stage-id | | | +| route-stage-id | | | @@ -285,11 +304,11 @@ scw edge-services dns-stage create [arg=value ...] | Name | | Description | |------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | | fqdns.{index} | | Fully Qualified Domain Name (in the format subdomain.example.com) to attach to the stage | | tls-stage-id | | TLS stage ID the DNS stage will be linked to | | cache-stage-id | | Cache stage ID the DNS stage will be linked to | | backend-stage-id | | Backend stage ID the DNS stage will be linked to | +| pipeline-id | Required | Pipeline ID the DNS stage belongs to | @@ -347,9 +366,8 @@ scw edge-services dns-stage list [arg=value ...] | Name | | Description | |------|---|-------------| | order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of DNS stages in the response | -| pipeline-id | | Pipeline ID to filter for, only DNS stages from this pipeline will be returned | -| project-id | | Project ID to filter for, only DNS stages from this Project will be returned | -| fqdn | | Fully Qualified Domain Name to filter for (in the format subdomain.example.com), only DNS stages with this FQDN will be returned | +| pipeline-id | Required | Pipeline ID to filter for. Only DNS stages from this pipeline will be returned | +| fqdn | | Fully Qualified Domain Name to filter for (in the format subdomain.example.com). Only DNS stages with this FQDN will be returned | @@ -399,7 +417,6 @@ scw edge-services pipeline create [arg=value ...] | project-id | | Project ID to use. If none is passed the default project ID will be used | | name | Required | Name of the pipeline | | description | Required | Description of the pipeline | -| dns-stage-id | | DNS stage ID the pipeline will be attached to | @@ -457,10 +474,10 @@ scw edge-services pipeline list [arg=value ...] | Name | | Description | |------|---|-------------| | order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Sort order of pipelines in the response | -| name | | Pipeline name to filter for, only pipelines with this string within their name will be returned | -| project-id | | Project ID to filter for, only pipelines from this Project will be returned | -| has-backend-stage-lb | | Filter on backend stage, only pipelines with a Load Balancer origin will be returned | -| organization-id | | Organization ID to filter for, only pipelines from this Organization will be returned | +| name | | Pipeline name to filter for. Only pipelines with this string within their name will be returned | +| project-id | | Project ID to filter for. Only pipelines from this Project will be returned | +| has-backend-stage-lb | | Filter on backend stage. Only pipelines with a Load Balancer origin will be returned | +| organization-id | | Organization ID to filter for. Only pipelines from this Organization will be returned | @@ -482,7 +499,6 @@ scw edge-services pipeline update [arg=value ...] | pipeline-id | Required | ID of the pipeline to update | | name | | Name of the pipeline | | description | | Description of the pipeline | -| dns-stage-id | | DNS stage ID the pipeline will be attached to | @@ -547,9 +563,184 @@ scw edge-services purge-request list [arg=value ...] | Name | | Description | |------|---|-------------| | order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of purge requests in the response | -| project-id | | Project ID to filter for, only purge requests from this Project will be returned | -| pipeline-id | | Pipeline ID to filter for, only purge requests from this pipeline will be returned | -| organization-id | | Organization ID to filter for, only purge requests from this Project will be returned | +| project-id | | Project ID to filter for. Only purge requests from this Project will be returned | +| pipeline-id | | Pipeline ID to filter for. Only purge requests from this pipeline will be returned | +| organization-id | | Organization ID to filter for. Only purge requests from this Project will be returned | + + + +## Route-rules management commands + +Route-rules management commands. + + +### Add route rules + +Add route rules to an existing route stage, specified by its `route_stage_id`. + +**Usage:** + +``` +scw edge-services route-rules add [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| route-stage-id | Required | ID of the route stage to update | +| route-rules.{index}.rule-http-match.method-filters.{index} | One of: `unknown_method_filter`, `get`, `post`, `put`, `patch`, `delete`, `head`, `options` | HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided | +| route-rules.{index}.rule-http-match.path-filter.path-filter-type | One of: `unknown_path_filter`, `regex` | Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type | +| route-rules.{index}.rule-http-match.path-filter.value | | Value to be matched for the HTTP URL path | +| route-rules.{index}.backend-stage-id | | ID of the backend stage that requests matching the rule should be forwarded to | +| after-position | | Add rules after the given position | +| before-position | | Add rules before the given position | + + + +### List route rules + +List all route rules of an existing route stage, specified by its `route_stage_id`. + +**Usage:** + +``` +scw edge-services route-rules list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| route-stage-id | Required | Route stage ID to filter for. Only route rules from this route stage will be returned | + + + +### Set route rules + +Set the rules of an existing route stage, specified by its `route_stage_id`. + +**Usage:** + +``` +scw edge-services route-rules set [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| route-stage-id | Required | ID of the route stage to update | +| route-rules.{index}.rule-http-match.method-filters.{index} | One of: `unknown_method_filter`, `get`, `post`, `put`, `patch`, `delete`, `head`, `options` | HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided | +| route-rules.{index}.rule-http-match.path-filter.path-filter-type | One of: `unknown_path_filter`, `regex` | Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type | +| route-rules.{index}.rule-http-match.path-filter.value | | Value to be matched for the HTTP URL path | +| route-rules.{index}.backend-stage-id | | ID of the backend stage that requests matching the rule should be forwarded to | + + + +## Route-stage management commands + +Route-stage management commands. + + +### Create route stage + +Create a new route stage. You must specify the `waf_stage_id` field to customize the route. + +**Usage:** + +``` +scw edge-services route-stage create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| pipeline-id | Required | Pipeline ID the route stage belongs to | +| waf-stage-id | | ID of the WAF stage HTTP requests should be forwarded to when no rules are matched | + + + +### Delete route stage + +Delete an existing route stage, specified by its `route_stage_id`. Deleting a route stage is permanent, and cannot be undone. + +**Usage:** + +``` +scw edge-services route-stage delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| route-stage-id | Required | ID of the route stage to delete | + + + +### Get route stage + +Retrieve information about an existing route stage, specified by its `route_stage_id`. The summary of the route stage (without route rules) is returned in the response object. + +**Usage:** + +``` +scw edge-services route-stage get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| route-stage-id | Required | ID of the requested route stage | + + + +### List route stages + +List all route stages, for a given pipeline. By default, the route stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. + +**Usage:** + +``` +scw edge-services route-stage list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of route stages in the response | +| pipeline-id | Required | Pipeline ID to filter for. Only route stages from this pipeline will be returned | + + + +### Update route stage + +Update the parameters of an existing route stage, specified by its `route_stage_id`. + +**Usage:** + +``` +scw edge-services route-stage update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| route-stage-id | Required | ID of the route stage to update | +| waf-stage-id | | ID of the WAF stage HTTP requests should be forwarded to when no rules are matched | @@ -573,12 +764,14 @@ scw edge-services tls-stage create [arg=value ...] | Name | | Description | |------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | | secrets.{index}.secret-id | | ID of the Secret | | secrets.{index}.region | | Region of the Secret | | managed-certificate | | True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint | | cache-stage-id | | Cache stage ID the TLS stage will be linked to | | backend-stage-id | | Backend stage ID the TLS stage will be linked to | +| pipeline-id | Required | Pipeline ID the TLS stage belongs to | +| route-stage-id | | | +| waf-stage-id | | | @@ -636,10 +829,9 @@ scw edge-services tls-stage list [arg=value ...] | Name | | Description | |------|---|-------------| | order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of TLS stages in the response | -| pipeline-id | | Pipeline ID to filter for, only TLS stages from this pipeline will be returned | -| project-id | | Project ID to filter for, only TLS stages from this Project will be returned | -| secret-id | | Secret ID to filter for, only TLS stages with this Secret ID will be returned | -| secret-region | | Secret region to filter for, only TLS stages with a Secret in this region will be returned | +| pipeline-id | Required | Pipeline ID to filter for. Only TLS stages from this pipeline will be returned | +| secret-id | | Secret ID to filter for. Only TLS stages with this Secret ID will be returned | +| secret-region | | Secret region to filter for. Only TLS stages with a Secret in this region will be returned | @@ -664,6 +856,115 @@ scw edge-services tls-stage update [arg=value ...] | managed-certificate | | True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint | | cache-stage-id | | Cache stage ID the TLS stage will be linked to | | backend-stage-id | | Backend stage ID the TLS stage will be linked to | +| route-stage-id | | | +| waf-stage-id | | | + + + +## WAF-stage management commands + +WAF-stage management commands. + + +### Create WAF stage + +Create a new WAF stage. You must specify the `mode` and `paranoia_level` fields to customize the WAF. + +**Usage:** + +``` +scw edge-services waf-stage create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| pipeline-id | Required | Pipeline ID the WAF stage belongs to | +| mode | One of: `unknown_mode`, `disable`, `log_only`, `enable` | Mode defining WAF behavior (`disable`/`log_only`/`enable`) | +| paranoia-level | | Sensitivity level (`1`,`2`,`3`,`4`) to use when classifying requests as malicious. With a high level, requests are more likely to be classed as malicious, and false positives are expected. With a lower level, requests are more likely to be classed as benign. | +| backend-stage-id | | ID of the backend stage to forward requests to after the WAF stage | + + + +### Delete WAF stage + +Delete an existing WAF stage, specified by its `waf_stage_id`. Deleting a WAF stage is permanent, and cannot be undone. + +**Usage:** + +``` +scw edge-services waf-stage delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| waf-stage-id | Required | ID of the WAF stage to delete | + + + +### Get WAF stage + +Retrieve information about an existing WAF stage, specified by its `waf_stage_id`. Its full details are returned in the response object. + +**Usage:** + +``` +scw edge-services waf-stage get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| waf-stage-id | Required | ID of the requested WAF stage | + + + +### List WAF stages + +List all WAF stages, for a Scaleway Organization or Scaleway Project. By default, the WAF stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. + +**Usage:** + +``` +scw edge-services waf-stage list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of WAF stages in the response | +| pipeline-id | Required | Pipeline ID to filter for. Only WAF stages from this pipeline will be returned | + + + +### Update WAF stage + +Update the parameters of an existing WAF stage, specified by its `waf_stage_id`. Both `mode` and `paranoia_level` parameters can be updated. + +**Usage:** + +``` +scw edge-services waf-stage update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| waf-stage-id | Required | ID of the WAF stage to update | +| mode | One of: `unknown_mode`, `disable`, `log_only`, `enable` | Mode defining WAF behavior (`disable`/`log_only`/`enable`) | +| paranoia-level | | Sensitivity level (`1`,`2`,`3`,`4`) to use when classifying requests as malicious. With a high level, requests are more likely to be classed as malicious, and false positives are expected. With a lower level, requests are more likely to be classed as benign. | +| backend-stage-id | | ID of the backend stage to forward requests to after the WAF stage | diff --git a/internal/namespaces/edge_services/v1alpha1/edge_services_cli.go b/internal/namespaces/edge_services/v1alpha1/edge_services_cli.go deleted file mode 100644 index e22324e80e..0000000000 --- a/internal/namespaces/edge_services/v1alpha1/edge_services_cli.go +++ /dev/null @@ -1,1437 +0,0 @@ -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -package edge_services - -import ( - "context" - "reflect" - - "github.com/scaleway/scaleway-cli/v2/core" - "github.com/scaleway/scaleway-sdk-go/api/edge_services/v1alpha1" - "github.com/scaleway/scaleway-sdk-go/scw" -) - -// always import dependencies -var ( - _ = scw.RegionFrPar -) - -func GetGeneratedCommands() *core.Commands { - return core.NewCommands( - edgeServicesRoot(), - edgeServicesPipeline(), - edgeServicesDNSStage(), - edgeServicesTLSStage(), - edgeServicesCacheStage(), - edgeServicesBackendStage(), - edgeServicesPurgeRequest(), - edgeServicesPipelineList(), - edgeServicesPipelineCreate(), - edgeServicesPipelineGet(), - edgeServicesPipelineUpdate(), - edgeServicesPipelineDelete(), - edgeServicesDNSStageList(), - edgeServicesDNSStageCreate(), - edgeServicesDNSStageGet(), - edgeServicesDNSStageUpdate(), - edgeServicesDNSStageDelete(), - edgeServicesTLSStageList(), - edgeServicesTLSStageCreate(), - edgeServicesTLSStageGet(), - edgeServicesTLSStageUpdate(), - edgeServicesTLSStageDelete(), - edgeServicesCacheStageList(), - edgeServicesCacheStageCreate(), - edgeServicesCacheStageGet(), - edgeServicesCacheStageUpdate(), - edgeServicesCacheStageDelete(), - edgeServicesBackendStageList(), - edgeServicesBackendStageCreate(), - edgeServicesBackendStageGet(), - edgeServicesBackendStageUpdate(), - edgeServicesBackendStageDelete(), - edgeServicesPurgeRequestList(), - edgeServicesPurgeRequestCreate(), - edgeServicesPurgeRequestGet(), - ) -} -func edgeServicesRoot() *core.Command { - return &core.Command{ - Short: `Edge Services API`, - Long: ``, - Namespace: "edge-services", - } -} - -func edgeServicesPipeline() *core.Command { - return &core.Command{ - Short: `Pipeline management commands`, - Long: `Pipeline management commands.`, - Namespace: "edge-services", - Resource: "pipeline", - } -} - -func edgeServicesDNSStage() *core.Command { - return &core.Command{ - Short: `DNS-stage management commands`, - Long: `DNS-stage management commands.`, - Namespace: "edge-services", - Resource: "dns-stage", - } -} - -func edgeServicesTLSStage() *core.Command { - return &core.Command{ - Short: `TLS-stage management commands`, - Long: `TLS-stage management commands.`, - Namespace: "edge-services", - Resource: "tls-stage", - } -} - -func edgeServicesCacheStage() *core.Command { - return &core.Command{ - Short: `Cache-stage management commands`, - Long: `Cache-stage management commands.`, - Namespace: "edge-services", - Resource: "cache-stage", - } -} - -func edgeServicesBackendStage() *core.Command { - return &core.Command{ - Short: `Backend-stage management commands`, - Long: `Backend-stage management commands.`, - Namespace: "edge-services", - Resource: "backend-stage", - } -} - -func edgeServicesPurgeRequest() *core.Command { - return &core.Command{ - Short: `Purge-request management commands`, - Long: `Purge-request management commands.`, - Namespace: "edge-services", - Resource: "purge-request", - } -} - -func edgeServicesPipelineList() *core.Command { - return &core.Command{ - Short: `List pipelines`, - Long: `List all pipelines, for a Scaleway Organization or Scaleway Project. By default, the pipelines returned in the list are ordered by creation date in ascending order, though this can be modified via the ` + "`" + `order_by` + "`" + ` field.`, - Namespace: "edge-services", - Resource: "pipeline", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.ListPipelinesRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "order-by", - Short: `Sort order of pipelines in the response`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc", "name_asc", "name_desc"}, - }, - { - Name: "name", - Short: `Pipeline name to filter for, only pipelines with this string within their name will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "project-id", - Short: `Project ID to filter for, only pipelines from this Project will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "has-backend-stage-lb", - Short: `Filter on backend stage, only pipelines with a Load Balancer origin will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "organization-id", - Short: `Organization ID to filter for, only pipelines from this Organization will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.ListPipelinesRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - resp, err := api.ListPipelines(request, opts...) - if err != nil { - return nil, err - } - return resp.Pipelines, nil - - }, - } -} - -func edgeServicesPipelineCreate() *core.Command { - return &core.Command{ - Short: `Create pipeline`, - Long: `Create a new pipeline. You must specify a ` + "`" + `dns_stage_id` + "`" + ` to form a stage-chain that goes all the way to the backend stage (origin), so the HTTP request will be processed according to the stages you created.`, - Namespace: "edge-services", - Resource: "pipeline", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.CreatePipelineRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "name", - Short: `Name of the pipeline`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "description", - Short: `Description of the pipeline`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "dns-stage-id", - Short: `DNS stage ID the pipeline will be attached to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.CreatePipelineRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.CreatePipeline(request) - - }, - } -} - -func edgeServicesPipelineGet() *core.Command { - return &core.Command{ - Short: `Get pipeline`, - Long: `Retrieve information about an existing pipeline, specified by its ` + "`" + `pipeline_id` + "`" + `. Its full details, including errors, are returned in the response object.`, - Namespace: "edge-services", - Resource: "pipeline", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.GetPipelineRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "pipeline-id", - Short: `ID of the requested pipeline`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.GetPipelineRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.GetPipeline(request) - - }, - } -} - -func edgeServicesPipelineUpdate() *core.Command { - return &core.Command{ - Short: `Update pipeline`, - Long: `Update the parameters of an existing pipeline, specified by its ` + "`" + `pipeline_id` + "`" + `. Parameters which can be updated include the ` + "`" + `name` + "`" + `, ` + "`" + `description` + "`" + ` and ` + "`" + `dns_stage_id` + "`" + `.`, - Namespace: "edge-services", - Resource: "pipeline", - Verb: "update", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.UpdatePipelineRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "pipeline-id", - Short: `ID of the pipeline to update`, - Required: true, - Deprecated: false, - Positional: true, - }, - { - Name: "name", - Short: `Name of the pipeline`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "description", - Short: `Description of the pipeline`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "dns-stage-id", - Short: `DNS stage ID the pipeline will be attached to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.UpdatePipelineRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.UpdatePipeline(request) - - }, - } -} - -func edgeServicesPipelineDelete() *core.Command { - return &core.Command{ - Short: `Delete pipeline`, - Long: `Delete an existing pipeline, specified by its ` + "`" + `pipeline_id` + "`" + `. Deleting a pipeline is permanent, and cannot be undone. Note that all stages linked to the pipeline are also deleted.`, - Namespace: "edge-services", - Resource: "pipeline", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.DeletePipelineRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "pipeline-id", - Short: `ID of the pipeline to delete`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.DeletePipelineRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - e = api.DeletePipeline(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "pipeline", - Verb: "delete", - }, nil - }, - } -} - -func edgeServicesDNSStageList() *core.Command { - return &core.Command{ - Short: `List DNS stages`, - Long: `List all DNS stages, for a Scaleway Organization or Scaleway Project. By default, the DNS stages returned in the list are ordered by creation date in ascending order, though this can be modified via the ` + "`" + `order_by` + "`" + ` field.`, - Namespace: "edge-services", - Resource: "dns-stage", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.ListDNSStagesRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "order-by", - Short: `Sort order of DNS stages in the response`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - { - Name: "pipeline-id", - Short: `Pipeline ID to filter for, only DNS stages from this pipeline will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "project-id", - Short: `Project ID to filter for, only DNS stages from this Project will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "fqdn", - Short: `Fully Qualified Domain Name to filter for (in the format subdomain.example.com), only DNS stages with this FQDN will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.ListDNSStagesRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - resp, err := api.ListDNSStages(request, opts...) - if err != nil { - return nil, err - } - return resp.Stages, nil - - }, - } -} - -func edgeServicesDNSStageCreate() *core.Command { - return &core.Command{ - Short: `Create DNS stage`, - Long: `Create a new DNS stage. You must specify the ` + "`" + `fqdns` + "`" + ` field to customize the domain endpoint, using a domain you already own.`, - Namespace: "edge-services", - Resource: "dns-stage", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.CreateDNSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "fqdns.{index}", - Short: `Fully Qualified Domain Name (in the format subdomain.example.com) to attach to the stage`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "tls-stage-id", - Short: `TLS stage ID the DNS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "cache-stage-id", - Short: `Cache stage ID the DNS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "backend-stage-id", - Short: `Backend stage ID the DNS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.CreateDNSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.CreateDNSStage(request) - - }, - } -} - -func edgeServicesDNSStageGet() *core.Command { - return &core.Command{ - Short: `Get DNS stage`, - Long: `Retrieve information about an existing DNS stage, specified by its ` + "`" + `dns_stage_id` + "`" + `. Its full details, including FQDNs, are returned in the response object.`, - Namespace: "edge-services", - Resource: "dns-stage", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.GetDNSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "dns-stage-id", - Short: `ID of the requested DNS stage`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.GetDNSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.GetDNSStage(request) - - }, - } -} - -func edgeServicesDNSStageUpdate() *core.Command { - return &core.Command{ - Short: `Update DNS stage`, - Long: `Update the parameters of an existing DNS stage, specified by its ` + "`" + `dns_stage_id` + "`" + `.`, - Namespace: "edge-services", - Resource: "dns-stage", - Verb: "update", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.UpdateDNSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "dns-stage-id", - Short: `ID of the DNS stage to update`, - Required: true, - Deprecated: false, - Positional: true, - }, - { - Name: "fqdns.{index}", - Short: `Fully Qualified Domain Name (in the format subdomain.example.com) attached to the stage`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "tls-stage-id", - Short: `TLS stage ID the DNS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "cache-stage-id", - Short: `Cache stage ID the DNS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "backend-stage-id", - Short: `Backend stage ID the DNS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.UpdateDNSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.UpdateDNSStage(request) - - }, - } -} - -func edgeServicesDNSStageDelete() *core.Command { - return &core.Command{ - Short: `Delete DNS stage`, - Long: `Delete an existing DNS stage, specified by its ` + "`" + `dns_stage_id` + "`" + `. Deleting a DNS stage is permanent, and cannot be undone.`, - Namespace: "edge-services", - Resource: "dns-stage", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.DeleteDNSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "dns-stage-id", - Short: `ID of the DNS stage to delete`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.DeleteDNSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - e = api.DeleteDNSStage(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "dns-stage", - Verb: "delete", - }, nil - }, - } -} - -func edgeServicesTLSStageList() *core.Command { - return &core.Command{ - Short: `List TLS stages`, - Long: `List all TLS stages, for a Scaleway Organization or Scaleway Project. By default, the TLS stages returned in the list are ordered by creation date in ascending order, though this can be modified via the ` + "`" + `order_by` + "`" + ` field.`, - Namespace: "edge-services", - Resource: "tls-stage", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.ListTLSStagesRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "order-by", - Short: `Sort order of TLS stages in the response`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - { - Name: "pipeline-id", - Short: `Pipeline ID to filter for, only TLS stages from this pipeline will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "project-id", - Short: `Project ID to filter for, only TLS stages from this Project will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "secret-id", - Short: `Secret ID to filter for, only TLS stages with this Secret ID will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "secret-region", - Short: `Secret region to filter for, only TLS stages with a Secret in this region will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.ListTLSStagesRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - resp, err := api.ListTLSStages(request, opts...) - if err != nil { - return nil, err - } - return resp.Stages, nil - - }, - } -} - -func edgeServicesTLSStageCreate() *core.Command { - return &core.Command{ - Short: `Create TLS stage`, - Long: `Create a new TLS stage. You must specify either the ` + "`" + `secrets` + "`" + ` or ` + "`" + `managed_certificate` + "`" + ` fields to customize the SSL/TLS certificate of your endpoint. Choose ` + "`" + `secrets` + "`" + ` if you are using a pre-existing certificate held in Scaleway Secret Manager, or ` + "`" + `managed_certificate` + "`" + ` to let Scaleway generate and manage a Let's Encrypt certificate for your customized endpoint.`, - Namespace: "edge-services", - Resource: "tls-stage", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.CreateTLSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "secrets.{index}.secret-id", - Short: `ID of the Secret`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "secrets.{index}.region", - Short: `Region of the Secret`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "managed-certificate", - Short: `True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "cache-stage-id", - Short: `Cache stage ID the TLS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "backend-stage-id", - Short: `Backend stage ID the TLS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.CreateTLSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.CreateTLSStage(request) - - }, - } -} - -func edgeServicesTLSStageGet() *core.Command { - return &core.Command{ - Short: `Get TLS stage`, - Long: `Retrieve information about an existing TLS stage, specified by its ` + "`" + `tls_stage_id` + "`" + `. Its full details, including secrets and certificate expiration date are returned in the response object.`, - Namespace: "edge-services", - Resource: "tls-stage", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.GetTLSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "tls-stage-id", - Short: `ID of the requested TLS stage`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.GetTLSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.GetTLSStage(request) - - }, - } -} - -func edgeServicesTLSStageUpdate() *core.Command { - return &core.Command{ - Short: `Update TLS stage`, - Long: `Update the parameters of an existing TLS stage, specified by its ` + "`" + `tls_stage_id` + "`" + `. Both ` + "`" + `tls_secrets_config` + "`" + ` and ` + "`" + `managed_certificate` + "`" + ` parameters can be updated.`, - Namespace: "edge-services", - Resource: "tls-stage", - Verb: "update", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.UpdateTLSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "tls-stage-id", - Short: `ID of the TLS stage to update`, - Required: true, - Deprecated: false, - Positional: true, - }, - { - Name: "tls-secrets-config.tls-secrets.{index}.secret-id", - Short: `ID of the Secret`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "tls-secrets-config.tls-secrets.{index}.region", - Short: `Region of the Secret`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "managed-certificate", - Short: `True when Scaleway generates and manages a Let's Encrypt certificate for the TLS stage/custom endpoint`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "cache-stage-id", - Short: `Cache stage ID the TLS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "backend-stage-id", - Short: `Backend stage ID the TLS stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.UpdateTLSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.UpdateTLSStage(request) - - }, - } -} - -func edgeServicesTLSStageDelete() *core.Command { - return &core.Command{ - Short: `Delete TLS stage`, - Long: `Delete an existing TLS stage, specified by its ` + "`" + `tls_stage_id` + "`" + `. Deleting a TLS stage is permanent, and cannot be undone.`, - Namespace: "edge-services", - Resource: "tls-stage", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.DeleteTLSStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "tls-stage-id", - Short: `ID of the TLS stage to delete`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.DeleteTLSStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - e = api.DeleteTLSStage(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "tls-stage", - Verb: "delete", - }, nil - }, - } -} - -func edgeServicesCacheStageList() *core.Command { - return &core.Command{ - Short: `List cache stages`, - Long: `List all cache stages, for a Scaleway Organization or Scaleway Project. By default, the cache stages returned in the list are ordered by creation date in ascending order, though this can be modified via the ` + "`" + `order_by` + "`" + ` field.`, - Namespace: "edge-services", - Resource: "cache-stage", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.ListCacheStagesRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "order-by", - Short: `Sort order of cache stages in the response`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - { - Name: "pipeline-id", - Short: `Pipeline ID to filter for, only cache stages from this pipeline will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "project-id", - Short: `Project ID to filter for, only cache stages from this Project will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.ListCacheStagesRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - resp, err := api.ListCacheStages(request, opts...) - if err != nil { - return nil, err - } - return resp.Stages, nil - - }, - } -} - -func edgeServicesCacheStageCreate() *core.Command { - return &core.Command{ - Short: `Create cache stage`, - Long: `Create a new cache stage. You must specify the ` + "`" + `fallback_ttl` + "`" + ` field to customize the TTL of the cache.`, - Namespace: "edge-services", - Resource: "cache-stage", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.CreateCacheStageRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "fallback-ttl", - Short: `Time To Live (TTL) in seconds. Defines how long content is cached`, - Required: false, - Deprecated: false, - Positional: false, - Default: core.DefaultValueSetter("3600s"), - }, - { - Name: "backend-stage-id", - Short: `Backend stage ID the cache stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.CreateCacheStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.CreateCacheStage(request) - - }, - } -} - -func edgeServicesCacheStageGet() *core.Command { - return &core.Command{ - Short: `Get cache stage`, - Long: `Retrieve information about an existing cache stage, specified by its ` + "`" + `cache_stage_id` + "`" + `. Its full details, including Time To Live (TTL), are returned in the response object.`, - Namespace: "edge-services", - Resource: "cache-stage", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.GetCacheStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "cache-stage-id", - Short: `ID of the requested cache stage`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.GetCacheStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.GetCacheStage(request) - - }, - } -} - -func edgeServicesCacheStageUpdate() *core.Command { - return &core.Command{ - Short: `Update cache stage`, - Long: `Update the parameters of an existing cache stage, specified by its ` + "`" + `cache_stage_id` + "`" + `. Parameters which can be updated include the ` + "`" + `fallback_ttl` + "`" + ` and ` + "`" + `backend_stage_id` + "`" + `.`, - Namespace: "edge-services", - Resource: "cache-stage", - Verb: "update", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.UpdateCacheStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "cache-stage-id", - Short: `ID of the cache stage to update`, - Required: true, - Deprecated: false, - Positional: true, - }, - { - Name: "fallback-ttl", - Short: `Time To Live (TTL) in seconds. Defines how long content is cached`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "backend-stage-id", - Short: `Backend stage ID the cache stage will be linked to`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.UpdateCacheStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.UpdateCacheStage(request) - - }, - } -} - -func edgeServicesCacheStageDelete() *core.Command { - return &core.Command{ - Short: `Delete cache stage`, - Long: `Delete an existing cache stage, specified by its ` + "`" + `cache_stage_id` + "`" + `. Deleting a cache stage is permanent, and cannot be undone.`, - Namespace: "edge-services", - Resource: "cache-stage", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.DeleteCacheStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "cache-stage-id", - Short: `ID of the cache stage to delete`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.DeleteCacheStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - e = api.DeleteCacheStage(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "cache-stage", - Verb: "delete", - }, nil - }, - } -} - -func edgeServicesBackendStageList() *core.Command { - return &core.Command{ - Short: `List backend stages`, - Long: `List all backend stages, for a Scaleway Organization or Scaleway Project. By default, the backend stages returned in the list are ordered by creation date in ascending order, though this can be modified via the ` + "`" + `order_by` + "`" + ` field.`, - Namespace: "edge-services", - Resource: "backend-stage", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.ListBackendStagesRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "order-by", - Short: `Sort order of backend stages in the response`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - { - Name: "pipeline-id", - Short: `Pipeline ID to filter for, only backend stages from this pipeline will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "project-id", - Short: `Project ID to filter for, only backend stages from this Project will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "bucket-name", - Short: `Bucket name to filter for, only backend stages from this Bucket will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "bucket-region", - Short: `Bucket region to filter for, only backend stages with buckets in this region will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "lb-id", - Short: `Load Balancer ID to filter for, only backend stages with this Load Balancer will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.ListBackendStagesRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - resp, err := api.ListBackendStages(request, opts...) - if err != nil { - return nil, err - } - return resp.Stages, nil - - }, - } -} - -func edgeServicesBackendStageCreate() *core.Command { - return &core.Command{ - Short: `Create backend stage`, - Long: `Create a new backend stage. You must specify either a ` + "`" + `scaleway_s3` + "`" + ` (for a Scaleway Object Storage bucket) or ` + "`" + `scaleway_lb` + "`" + ` (for a Scaleway Load Balancer) field to configure the origin.`, - Namespace: "edge-services", - Resource: "backend-stage", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.CreateBackendStageRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "scaleway-s3.bucket-name", - Short: `Name of the Bucket`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-s3.bucket-region", - Short: `Region of the Bucket`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-s3.is-website", - Short: `Defines whether the bucket website feature is enabled`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.id", - Short: `ID of the Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.zone", - Short: `Zone of the Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.frontend-id", - Short: `ID of the frontend linked to the Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.is-ssl", - Short: `Defines whether the Load Balancer's frontend handles SSL connections`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.domain-name", - Short: `Fully Qualified Domain Name (in the format subdomain.example.com) to use in HTTP requests sent towards your Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.CreateBackendStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.CreateBackendStage(request) - - }, - } -} - -func edgeServicesBackendStageGet() *core.Command { - return &core.Command{ - Short: `Get backend stage`, - Long: `Retrieve information about an existing backend stage, specified by its ` + "`" + `backend_stage_id` + "`" + `. Its full details, including ` + "`" + `scaleway_s3` + "`" + ` or ` + "`" + `scaleway_lb` + "`" + `, are returned in the response object.`, - Namespace: "edge-services", - Resource: "backend-stage", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.GetBackendStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "backend-stage-id", - Short: `ID of the requested backend stage`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.GetBackendStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.GetBackendStage(request) - - }, - } -} - -func edgeServicesBackendStageUpdate() *core.Command { - return &core.Command{ - Short: `Update backend stage`, - Long: `Update the parameters of an existing backend stage, specified by its ` + "`" + `backend_stage_id` + "`" + `.`, - Namespace: "edge-services", - Resource: "backend-stage", - Verb: "update", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.UpdateBackendStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "backend-stage-id", - Short: `ID of the backend stage to update`, - Required: true, - Deprecated: false, - Positional: true, - }, - { - Name: "scaleway-s3.bucket-name", - Short: `Name of the Bucket`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-s3.bucket-region", - Short: `Region of the Bucket`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-s3.is-website", - Short: `Defines whether the bucket website feature is enabled`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.id", - Short: `ID of the Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.zone", - Short: `Zone of the Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.frontend-id", - Short: `ID of the frontend linked to the Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.is-ssl", - Short: `Defines whether the Load Balancer's frontend handles SSL connections`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "scaleway-lb.lbs.{index}.domain-name", - Short: `Fully Qualified Domain Name (in the format subdomain.example.com) to use in HTTP requests sent towards your Load Balancer`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.UpdateBackendStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.UpdateBackendStage(request) - - }, - } -} - -func edgeServicesBackendStageDelete() *core.Command { - return &core.Command{ - Short: `Delete backend stage`, - Long: `Delete an existing backend stage, specified by its ` + "`" + `backend_stage_id` + "`" + `. Deleting a backend stage is permanent, and cannot be undone.`, - Namespace: "edge-services", - Resource: "backend-stage", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.DeleteBackendStageRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "backend-stage-id", - Short: `ID of the backend stage to delete`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.DeleteBackendStageRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - e = api.DeleteBackendStage(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "backend-stage", - Verb: "delete", - }, nil - }, - } -} - -func edgeServicesPurgeRequestList() *core.Command { - return &core.Command{ - Short: `List purge requests`, - Long: `List all purge requests, for a Scaleway Organization or Scaleway Project. This enables you to retrieve a history of all previously-made purge requests. By default, the purge requests returned in the list are ordered by creation date in ascending order, though this can be modified via the ` + "`" + `order_by` + "`" + ` field.`, - Namespace: "edge-services", - Resource: "purge-request", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.ListPurgeRequestsRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "order-by", - Short: `Sort order of purge requests in the response`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - { - Name: "project-id", - Short: `Project ID to filter for, only purge requests from this Project will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "pipeline-id", - Short: `Pipeline ID to filter for, only purge requests from this pipeline will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "organization-id", - Short: `Organization ID to filter for, only purge requests from this Project will be returned`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.ListPurgeRequestsRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - resp, err := api.ListPurgeRequests(request, opts...) - if err != nil { - return nil, err - } - return resp.PurgeRequests, nil - - }, - } -} - -func edgeServicesPurgeRequestCreate() *core.Command { - return &core.Command{ - Short: `Create purge request`, - Long: `Create a new purge request. You must specify either the ` + "`" + `all` + "`" + ` field (to purge all content) or a list of ` + "`" + `assets` + "`" + ` (to define the precise assets to purge).`, - Namespace: "edge-services", - Resource: "purge-request", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.CreatePurgeRequestRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "pipeline-id", - Short: `Pipeline ID in which the purge request will be created`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "assets.{index}", - Short: `List of asserts to purge`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "all", - Short: `Defines whether to purge all content`, - Required: false, - Deprecated: false, - Positional: false, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.CreatePurgeRequestRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.CreatePurgeRequest(request) - - }, - } -} - -func edgeServicesPurgeRequestGet() *core.Command { - return &core.Command{ - Short: `Get purge request`, - Long: `Retrieve information about a purge request, specified by its ` + "`" + `purge_request_id` + "`" + `. Its full details, including ` + "`" + `status` + "`" + ` and ` + "`" + `target` + "`" + `, are returned in the response object.`, - Namespace: "edge-services", - Resource: "purge-request", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(edge_services.GetPurgeRequestRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "purge-request-id", - Short: `ID of the requested purge request`, - Required: true, - Deprecated: false, - Positional: true, - }, - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*edge_services.GetPurgeRequestRequest) - - client := core.ExtractClient(ctx) - api := edge_services.NewAPI(client) - return api.GetPurgeRequest(request) - - }, - } -} diff --git a/internal/namespaces/edge_services/v1alpha1/custom.go b/internal/namespaces/edge_services/v1beta1/custom.go similarity index 100% rename from internal/namespaces/edge_services/v1alpha1/custom.go rename to internal/namespaces/edge_services/v1beta1/custom.go From 2893b358f5695015274db72b9899278fd4b469b0 Mon Sep 17 00:00:00 2001 From: Yacine FODIL Date: Thu, 10 Apr 2025 11:56:04 +0200 Subject: [PATCH 2/2] nolint staticcheck --- internal/namespaces/vpc/v2/custom_private_network.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/namespaces/vpc/v2/custom_private_network.go b/internal/namespaces/vpc/v2/custom_private_network.go index 116106fd64..886e0a29a0 100644 --- a/internal/namespaces/vpc/v2/custom_private_network.go +++ b/internal/namespaces/vpc/v2/custom_private_network.go @@ -412,6 +412,7 @@ func listCustomGateways(client *scw.Client, pn *vpc.PrivateNetwork) ([]customGat var customGateways []customGateway for _, zone := range zones { + //nolint: staticcheck listGateways, err := vpcgwAPI.ListGateways(&vpcgw.ListGatewaysRequest{ Zone: zone, }, scw.WithAllPages())