scaleway-cli icon indicating copy to clipboard operation
scaleway-cli copied to clipboard

Improve help for backend creation in case healthcheck is missing

Open remyleone opened this issue 5 years ago • 0 comments

Description:

$ go run ./cmd/scw/main.go lb backend create lb-id=45a56fd8-841b-425a-a851-1be4ebf2352b forward-protocol=tcp forward-port=80 forward-port-algorithm=roundrobin sticky-sessions=none  -D
running: [/var/folders/sm/h3cw_xsj0279j12fnhv6bzd40000gn/T/go-build360822040/b001/exe/main lb backend create lb-id=45a56fd8-841b-425a-a851-1be4ebf2352b forward-protocol=tcp forward-port=80 forward-port-algorithm=roundrobin sticky-sessions=none -D]
client: using sdk version v1.0.0-beta.6+devclient: using sdk version v1.0.0-beta.6+devcould not validate arg value for 'health-check.mysql-config.user': invalid fieldName: HealthCheck.mysqlConfig.user: case is not handledcould not validate arg value for 'health-check.check-max-retries': invalid fieldName: HealthCheck.checkMaxRetries: case is not handledcould not validate arg value for 'health-check.pgsql-config.user': invalid fieldName: HealthCheck.pgsqlConfig.user: case is not handledcould not validate arg value for 'health-check.http-config.uri': invalid fieldName: HealthCheck.httpConfig.uri: case is not handledcould not validate arg value for 'health-check.http-config.method': invalid fieldName: HealthCheck.httpConfig.method: case is not handledcould not validate arg value for 'health-check.http-config.code': invalid fieldName: HealthCheck.httpConfig.code: case is not handledcould not validate arg value for 'health-check.https-config.uri': invalid fieldName: HealthCheck.httpsConfig.uri: case is not handledcould not validate arg value for 'health-check.https-config.method': invalid fieldName: HealthCheck.httpsConfig.method: case is not handledcould not validate arg value for 'health-check.https-config.code': invalid fieldName: HealthCheck.httpsConfig.code: case is not handledcould not validate arg value for 'health-check.port': invalid fieldName: HealthCheck.port: case is not handledcould not validate arg value for 'health-check.check-timeout': invalid fieldName: HealthCheck.checkTimeout: case is not handledcould not validate arg value for 'health-check.check-delay': invalid fieldName: HealthCheck.checkDelay: case is not handledcreating POST request on https://api.scaleway.com/lb/v1/regions/fr-par/lbs/45a56fd8-841b-425a-a851-1be4ebf2352b/backends
--------------- Scaleway SDK REQUEST 1 : ---------------
POST /lb/v1/regions/fr-par/lbs/45a56fd8-841b-425a-a851-1be4ebf2352b/backends HTTP/1.1
Host: api.scaleway.com
User-Agent: scaleway-sdk-go/v1.0.0-beta.6+dev (go1.15; darwin; amd64) scaleway-cli/2.0.0+dev
Content-Length: 392
Content-Type: application/json
X-Auth-Token: 7cc91c3f-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Accept-Encoding: gzip

{"name":"cli-lbb-sharp-ganguly","forward_protocol":"tcp","forward_port":80,"forward_port_algorithm":"roundrobin","sticky_sessions":"none","sticky_sessions_cookie_name":"","health_check":null,"server_ip":null,"send_proxy_v2":false,"on_marked_down_action":"on_marked_down_action_none","proxy_protocol":"proxy_protocol_unknown","timeout_server":null,"timeout_connect":null,"timeout_tunnel":null}
---------------------------------------------------------
--------------- Scaleway SDK RESPONSE 1 : ---------------
HTTP/2.0 400 Bad Request
Content-Length: 152
Content-Security-Policy: default-src 'none'; frame-ancestors 'none'
Content-Type: application/json
Date: Thu, 03 Sep 2020 16:20:01 GMT
Server: Scaleway API-Gateway
Strict-Transport-Security: max-age=63072000
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Request-Id: c39bf229-a7b2-43b9-9389-560adef02fd2

{"details":[{"field":"health_check","message":"health_check must not be nil","reason":"unknown"}],"message":"Invalid parameters","type":"invalid_field"}
----------------------------------------------------------Invalid parameters
skipping check version
telemetry successfully sent
exit status 1

How to reproduce:

Command attempted

Expected Behavior

Actual Behavior

More info

Version

Version 2.0.0+dev BuildDate unknown GoVersion go1.14.5 GitBranch unknown GitCommit unknown GoArch amd64 GoOS darwin

remyleone avatar Jul 21 '20 17:07 remyleone