Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check http response #470

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/outscale/terraform-provider-outscale
go 1.22.0

require (
github.com/aws/aws-sdk-go v1.55.1
github.com/aws/aws-sdk-go v1.55.5
github.com/davecgh/go-spew v1.1.1
github.com/go-test/deep v1.0.6
github.com/hashicorp/errwrap v1.1.0
Expand Down Expand Up @@ -58,7 +58,7 @@ require (
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJE
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/aws/aws-sdk-go v1.44.103/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.55.1 h1:ZTNPmbRMxaK5RlTJrBullX9r/rF1MPf3yAJOLlwDiT8=
github.com/aws/aws-sdk-go v1.55.1/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
Expand Down Expand Up @@ -197,8 +197,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
16 changes: 10 additions & 6 deletions outscale/resource_outscale_vpn_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,16 @@ func vpnConnectionRefreshFunc(conn *oscgo.APIClient, vpnConnectionID *string) re
}
resp, httpResp, err := conn.VpnConnectionApi.ReadVpnConnections(context.Background()).ReadVpnConnectionsRequest(filter).Execute()
if err != nil {
switch {
case httpResp.StatusCode == http.StatusServiceUnavailable:
return nil, "pending", nil
case httpResp.StatusCode == http.StatusNotFound:
return nil, "deleted", nil
default:
if httpResp != nil {
switch {
case httpResp.StatusCode == http.StatusServiceUnavailable:
return nil, "pending", nil
case httpResp.StatusCode == http.StatusNotFound:
return nil, "deleted", nil
default:
return nil, "failed", fmt.Errorf("Error on vpnConnectionRefresh: %s", err)
}
} else {
return nil, "failed", fmt.Errorf("Error on vpnConnectionRefresh: %s", err)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@
"flexible_gpu_catalog": [
{
"generations": [
"v5",
"v6"
"v7"
],
"max_cpu": 35,
"max_ram": 250,
"model_name": "nvidia-a10",
"v_ram": 24000
"max_cpu": 60,
"max_ram": 384,
"model_name": "nvidia-h100",
"v_ram": 80000
},
{
"generations": [
"v7"
"v6"
],
"max_cpu": 35,
"max_ram": 250,
"model_name": "nvidia-l40",
"v_ram": 48000
"max_ram": 256,
"model_name": "nvidia-a100-80",
"v_ram": 80000
},
{
"generations": [
Expand All @@ -42,18 +41,39 @@
],
"max_cpu": 80,
"max_ram": 512,
"model_name": "nvidia-m60",
"v_ram": 16000
"model_name": "nvidia-k2",
"v_ram": 4096
},
{
"generations": [
"v5"
"v3",
"v4"
],
"max_cpu": 80,
"max_ram": 512,
"model_name": "nvidia-p6",
"model_name": "nvidia-m60",
"v_ram": 16000
},
{
"generations": [
"v5",
"v6"
],
"max_cpu": 35,
"max_ram": 250,
"model_name": "nvidia-a10",
"v_ram": 24000
},
{
"generations": [
"v5",
"v6"
],
"max_cpu": 35,
"max_ram": 250,
"model_name": "nvidia-a100",
"v_ram": 40000
},
{
"generations": [
"v5"
Expand All @@ -65,22 +85,12 @@
},
{
"generations": [
"v3",
"v4"
"v5"
],
"max_cpu": 80,
"max_ram": 512,
"model_name": "nvidia-k2",
"v_ram": 4096
},
{
"generations": [
"v6"
],
"max_cpu": 35,
"max_ram": 256,
"model_name": "nvidia-a100-80",
"v_ram": 80000
"model_name": "nvidia-p6",
"v_ram": 16000
},
{
"generations": [
Expand All @@ -93,13 +103,12 @@
},
{
"generations": [
"v5",
"v6"
"v7"
],
"max_cpu": 35,
"max_ram": 250,
"model_name": "nvidia-a100",
"v_ram": 40000
"model_name": "nvidia-l40",
"v_ram": 48000
}
],
"id": "##id-0##",
Expand Down
Loading