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

IF-10733 Support MSS v3 #112

Merged
merged 9 commits into from
Jun 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions ecl/clientconfig/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package clientconfig

import (
"fmt"
"github.com/nttcom/eclcloud/v2"
"github.com/nttcom/eclcloud/v2/ecl"
"github.com/nttcom/eclcloud/v3"
"github.com/nttcom/eclcloud/v3/ecl"
"os"
"reflect"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion ecl/clientconfig/testing/fixtures.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package testing

import (
"github.com/nttcom/eclcloud/v2"
"github.com/nttcom/eclcloud/v3"
"github.com/nttcom/terraform-provider-ecl/ecl/clientconfig"
)

Expand Down
4 changes: 2 additions & 2 deletions ecl/clientconfig/testing/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"os"
"testing"

"github.com/nttcom/eclcloud/v2"
"github.com/nttcom/eclcloud/v3"
"github.com/nttcom/terraform-provider-ecl/ecl/clientconfig"

th "github.com/nttcom/eclcloud/v2/testhelper"
th "github.com/nttcom/eclcloud/v3/testhelper"
)

func TestGetCloudFromYAML(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions ecl/compute_instance_v2_networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2"
"github.com/nttcom/eclcloud/v2/ecl/compute/v2/servers"
"github.com/nttcom/eclcloud/v2/ecl/network/v2/networks"
"github.com/nttcom/eclcloud/v2/ecl/network/v2/ports"
"github.com/nttcom/eclcloud/v3"
"github.com/nttcom/eclcloud/v3/ecl/compute/v2/servers"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/networks"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/ports"
)

// InstanceNIC is a structured representation of a Eclcloud servers.Server
Expand Down
12 changes: 6 additions & 6 deletions ecl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"crypto/x509"
"fmt"

"github.com/nttcom/eclcloud/v2"
"github.com/nttcom/eclcloud/v2/ecl"
"github.com/nttcom/eclcloud/v3"
"github.com/nttcom/eclcloud/v3/ecl"

"github.com/nttcom/terraform-provider-ecl/ecl/clientconfig"

Expand Down Expand Up @@ -268,15 +268,15 @@ func (c *Config) networkV2Client(region string) (*eclcloud.ServiceClient, error)
})
}

func (c *Config) securityOrderV2Client(region string) (*eclcloud.ServiceClient, error) {
return ecl.NewSecurityOrderV2(c.OsClient, eclcloud.EndpointOpts{
func (c *Config) securityOrderV3Client(region string) (*eclcloud.ServiceClient, error) {
return ecl.NewSecurityOrderV3(c.OsClient, eclcloud.EndpointOpts{
Region: c.determineRegion(region),
Availability: c.getEndpointType(),
})
}

func (c *Config) securityPortalV2Client(region string) (*eclcloud.ServiceClient, error) {
return ecl.NewSecurityPortalV2(c.OsClient, eclcloud.EndpointOpts{
func (c *Config) securityPortalV3Client(region string) (*eclcloud.ServiceClient, error) {
return ecl.NewSecurityPortalV3(c.OsClient, eclcloud.EndpointOpts{
Region: c.determineRegion(region),
Availability: c.getEndpointType(),
})
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_baremetal_availability_zone_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/nttcom/eclcloud/v2/ecl/baremetal/v2/availabilityzones"
"github.com/nttcom/eclcloud/v3/ecl/baremetal/v2/availabilityzones"

"github.com/hashicorp/terraform/helper/schema"
)
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_baremetal_flavor_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/nttcom/eclcloud/v2/ecl/baremetal/v2/flavors"
"github.com/nttcom/eclcloud/v3/ecl/baremetal/v2/flavors"

"github.com/hashicorp/terraform/helper/schema"
)
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_baremetal_keypair_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"

"github.com/hashicorp/terraform/helper/schema"
"github.com/nttcom/eclcloud/v2/ecl/baremetal/v2/keypairs"
"github.com/nttcom/eclcloud/v3/ecl/baremetal/v2/keypairs"
)

func dataSourceBaremetalKeypairV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_compute_flavor_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"log"

"github.com/nttcom/eclcloud/v2/ecl/compute/v2/flavors"
"github.com/nttcom/eclcloud/v3/ecl/compute/v2/flavors"

"github.com/hashicorp/terraform/helper/schema"
)
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_compute_keypair_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/hashicorp/terraform/helper/schema"
"github.com/nttcom/eclcloud/v2/ecl/compute/v2/extensions/keypairs"
"github.com/nttcom/eclcloud/v3/ecl/compute/v2/extensions/keypairs"
)

func dataSourceComputeKeypairV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_dns_zone_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/hashicorp/terraform/helper/schema"
"github.com/nttcom/eclcloud/v2/ecl/dns/v2/zones"
"github.com/nttcom/eclcloud/v3/ecl/dns/v2/zones"
)

func dataSourceDNSZoneV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_imagestorages_image_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"
"sort"

"github.com/nttcom/eclcloud/v2/ecl/imagestorage/v2/images"
"github.com/nttcom/eclcloud/v3/ecl/imagestorage/v2/images"

"github.com/hashicorp/terraform/helper/schema"
)
Expand Down
1 change: 1 addition & 0 deletions ecl/data_source_ecl_imagestorages_image_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ resource "ecl_imagestorages_image_v2" "image_1" {
foo = "bar"
bar = "foo"
}
visibility = "private"
}

`, localFileForDataSourceTest)
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_certificate_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/certificates"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/certificates"
)

func certificateFileSchemaForDataSource() *schema.Schema {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_health_monitor_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/health_monitors"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/health_monitors"
)

func dataSourceMLBHealthMonitorV1() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_listener_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/listeners"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/listeners"
)

func dataSourceMLBListenerV1() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_load_balancer_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/load_balancers"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/load_balancers"
)

func reservedFixedIPsSchemaForDataSource() *schema.Schema {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_operation_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/operations"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/operations"
)

func dataSourceMLBOperationV1() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_plan_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/plans"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/plans"
)

func dataSourceMLBPlanV1() *schema.Resource {
Expand Down
12 changes: 11 additions & 1 deletion ecl/data_source_ecl_mlb_policy_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/policies"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/policies"
)

func dataSourceMLBPolicyV1() *schema.Resource {
Expand Down Expand Up @@ -63,6 +63,11 @@ func dataSourceMLBPolicyV1() *schema.Resource {
Optional: true,
Computed: true,
},
"idle_timeout": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Computed: true,
},
"sorry_page_url": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -136,6 +141,10 @@ func dataSourceMLBPolicyV1Read(d *schema.ResourceData, meta interface{}) error {
listOpts.Persistence = v.(string)
}

if v, ok := d.GetOk("idle_timeout"); ok {
listOpts.IdleTimeout = v.(int)
}

if v, ok := d.GetOk("sorry_page_url"); ok {
listOpts.SorryPageUrl = v.(string)
}
Expand Down Expand Up @@ -212,6 +221,7 @@ func dataSourceMLBPolicyV1Read(d *schema.ResourceData, meta interface{}) error {
d.Set("tenant_id", policy.TenantID)
d.Set("algorithm", policy.Algorithm)
d.Set("persistence", policy.Persistence)
d.Set("idle_timeout", policy.IdleTimeout)
d.Set("sorry_page_url", policy.SorryPageUrl)
d.Set("source_nat", policy.SourceNat)
d.Set("certificate_id", policy.CertificateID)
Expand Down
2 changes: 2 additions & 0 deletions ecl/data_source_ecl_mlb_policy_v1_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func TestMockedAccMLBV1PolicyDataSource(t *testing.T) {
resource.TestCheckResourceAttr("data.ecl_mlb_policy_v1.policy_1", "tenant_id", "34f5c98ef430457ba81292637d0c6fd0"),
resource.TestCheckResourceAttr("data.ecl_mlb_policy_v1.policy_1", "algorithm", "round-robin"),
resource.TestCheckResourceAttr("data.ecl_mlb_policy_v1.policy_1", "persistence", "cookie"),
resource.TestCheckResourceAttr("data.ecl_mlb_policy_v1.policy_1", "idle_timeout", "600"),
resource.TestCheckResourceAttr("data.ecl_mlb_policy_v1.policy_1", "sorry_page_url", "https://example.com/sorry"),
resource.TestCheckResourceAttr("data.ecl_mlb_policy_v1.policy_1", "source_nat", "enable"),
resource.TestCheckResourceAttr("data.ecl_mlb_policy_v1.policy_1", "certificate_id", "f57a98fe-d63e-4048-93a0-51fe163f30d7"),
Expand Down Expand Up @@ -83,6 +84,7 @@ response:
"tenant_id": "34f5c98ef430457ba81292637d0c6fd0",
"algorithm": "round-robin",
"persistence": "cookie",
"idle_timeout": 600,
"sorry_page_url": "https://example.com/sorry",
"source_nat": "enable",
"certificate_id": "f57a98fe-d63e-4048-93a0-51fe163f30d7",
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_route_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/routes"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/routes"
)

func dataSourceMLBRouteV1() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_rule_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/rules"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/rules"
)

func conditionsSchemaForDataSource() *schema.Schema {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_system_update_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/system_updates"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/system_updates"
)

func dataSourceMLBSystemUpdateV1() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_target_group_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/target_groups"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/target_groups"
)

func membersSchemaForDataSource() *schema.Schema {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_mlb_tls_policy_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/managed_load_balancer/v1/tls_policies"
"github.com/nttcom/eclcloud/v3/ecl/managed_load_balancer/v1/tls_policies"
)

func dataSourceMLBTLSPolicyV1() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_network_common_function_gateway_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/network/v2/common_function_gateways"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/common_function_gateways"
)

func dataSourceNetworkCommonFunctionGatewayV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_network_common_function_pool_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"

"github.com/hashicorp/terraform/helper/schema"
"github.com/nttcom/eclcloud/v2/ecl/network/v2/common_function_pool"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/common_function_pool"
)

func dataSourceNetworkCommonFunctionPoolV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_network_fic_gateway_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"

"github.com/hashicorp/terraform/helper/schema"
"github.com/nttcom/eclcloud/v2/ecl/network/v2/fic_gateways"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/fic_gateways"
)

func dataSourceNetworkFICGatewayV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_network_gateway_interface_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/network/v2/gateway_interfaces"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/gateway_interfaces"
)

func dataSourceNetworkGatewayInterfaceV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_network_internet_gateway_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/network/v2/internet_gateways"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/internet_gateways"
)

func dataSourceNetworkInternetGatewayV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_network_internet_service_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2/ecl/network/v2/internet_services"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/internet_services"
)

func dataSourceNetworkInternetServiceV2() *schema.Resource {
Expand Down
4 changes: 2 additions & 2 deletions ecl/data_source_ecl_network_load_balancer_plan_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"log"

"github.com/nttcom/eclcloud/v2"
"github.com/nttcom/eclcloud/v2/ecl/network/v2/load_balancer_plans"
"github.com/nttcom/eclcloud/v3"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/load_balancer_plans"

"github.com/hashicorp/terraform/helper/schema"
)
Expand Down
6 changes: 3 additions & 3 deletions ecl/data_source_ecl_network_network_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/hashicorp/terraform/helper/schema"

"github.com/nttcom/eclcloud/v2"
"github.com/nttcom/eclcloud/v2/ecl/network/v2/networks"
"github.com/nttcom/eclcloud/v2/ecl/network/v2/subnets"
"github.com/nttcom/eclcloud/v3"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/networks"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/subnets"
)

func dataSourceNetworkNetworkV2() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion ecl/data_source_ecl_network_network_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"

"github.com/nttcom/eclcloud/v2/ecl/network/v2/ports"
"github.com/nttcom/eclcloud/v3/ecl/network/v2/ports"
)

func TestAccNetworkV2NetworkDataSource_queries(t *testing.T) {
Expand Down
Loading
Loading