diff --git a/outscale/data_source_outscale_api_access_policy_test.go b/outscale/data_source_outscale_api_access_policy_test.go index 2df13984d..6033fe31f 100644 --- a/outscale/data_source_outscale_api_access_policy_test.go +++ b/outscale/data_source_outscale_api_access_policy_test.go @@ -7,7 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccDataSourceOutscaleOAPIApiAccessPolicy_basic(t *testing.T) { +func TestAccDataSourceOutscaleApiAccessPolicy_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { @@ -16,13 +16,13 @@ func TestAccDataSourceOutscaleOAPIApiAccessPolicy_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIApiAccessPolicyConfig(), + Config: testAccDataSourceOutscaleApiAccessPolicyConfig(), }, }, }) } -func testAccDataSourceOutscaleOAPIApiAccessPolicyConfig() string { +func testAccDataSourceOutscaleApiAccessPolicyConfig() string { return fmt.Sprintf(` data "outscale_api_access_policy" "api_access_policy" {} `) diff --git a/outscale/data_source_outscale_api_access_rule_test.go b/outscale/data_source_outscale_api_access_rule_test.go index cf747ac79..dadfb3c66 100644 --- a/outscale/data_source_outscale_api_access_rule_test.go +++ b/outscale/data_source_outscale_api_access_rule_test.go @@ -13,7 +13,7 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func TestAccOthers_DataOutscaleOAPIApiAccessRule_basic(t *testing.T) { +func TestAccOthers_DataOutscaleApiAccessRule_basic(t *testing.T) { t.Parallel() resourceName := "outscale_api_access_rule.rule_data" ca_path := os.Getenv("CA_PATH") @@ -24,7 +24,7 @@ func TestAccOthers_DataOutscaleOAPIApiAccessRule_basic(t *testing.T) { CheckDestroy: testAccDataCheckOutscaleApiAccessRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccDataOutscaleOAPIApiAccessRuleConfig(ca_path), + Config: testAccDataOutscaleApiAccessRuleConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleApiAccessRuleExists(resourceName), ), @@ -71,7 +71,7 @@ func testAccDataCheckOutscaleApiAccessRuleDestroy(s *terraform.State) error { return nil } -func testAccDataOutscaleOAPIApiAccessRuleConfig(path string) string { +func testAccDataOutscaleApiAccessRuleConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_rule" { ca_pem = file(%q) diff --git a/outscale/data_source_outscale_api_access_rules_test.go b/outscale/data_source_outscale_api_access_rules_test.go index b29670e5f..d81c56f95 100644 --- a/outscale/data_source_outscale_api_access_rules_test.go +++ b/outscale/data_source_outscale_api_access_rules_test.go @@ -12,7 +12,7 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func TestAccDataOutscaleOAPIApiAccessRules_basic(t *testing.T) { +func TestAccDataOutscaleApiAccessRules_basic(t *testing.T) { t.Parallel() resourceName := "outscale_api_access_rule.rule_data" resource.Test(t, resource.TestCase{ @@ -21,7 +21,7 @@ func TestAccDataOutscaleOAPIApiAccessRules_basic(t *testing.T) { CheckDestroy: testAccDataCheckOutscaleApiAccessRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccDataOutscaleOAPIApiAccessRulesConfig(), + Config: testAccDataOutscaleApiAccessRulesConfig(), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleApiAccessRuleExists(resourceName), ), @@ -68,7 +68,7 @@ func testAccDataCheckOutscaleApiAccessRulesDestroy(s *terraform.State) error { return nil } -func testAccDataOutscaleOAPIApiAccessRulesConfig() string { +func testAccDataOutscaleApiAccessRulesConfig() string { return fmt.Sprintf(` resource "outscale_ca" "ca_rule" { ca_pem = file("./test-cert.pem") diff --git a/outscale/data_source_outscale_ca.go b/outscale/data_source_outscale_ca.go index 6f5da8872..79a5ef531 100644 --- a/outscale/data_source_outscale_ca.go +++ b/outscale/data_source_outscale_ca.go @@ -51,7 +51,7 @@ func DataSourceOutscaleCaRead(d *schema.ResourceData, meta interface{}) error { params := oscgo.ReadCasRequest{} if filtersOk { - params.Filters = buildOutscaleOAPIDataSourceCaFilters(filters.(*schema.Set)) + params.Filters = buildOutscaleDataSourceCaFilters(filters.(*schema.Set)) } var resp oscgo.ReadCasResponse var err error @@ -93,7 +93,7 @@ func DataSourceOutscaleCaRead(d *schema.ResourceData, meta interface{}) error { return nil } -func buildOutscaleOAPIDataSourceCaFilters(set *schema.Set) *oscgo.FiltersCa { +func buildOutscaleDataSourceCaFilters(set *schema.Set) *oscgo.FiltersCa { var filters oscgo.FiltersCa for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_ca_test.go b/outscale/data_source_outscale_ca_test.go index 65c53d625..8a2fadb72 100644 --- a/outscale/data_source_outscale_ca_test.go +++ b/outscale/data_source_outscale_ca_test.go @@ -23,7 +23,7 @@ func TestAccOthers_DataOutscaleCa_basic(t *testing.T) { CheckDestroy: testAccDataCheckOutscaleCaDestroy, Steps: []resource.TestStep{ { - Config: testAccDataOutscaleOAPICaConfig(ca_path), + Config: testAccDataOutscaleCaConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resourceName), ), @@ -72,7 +72,7 @@ func testAccDataCheckOutscaleCaDestroy(s *terraform.State) error { return nil } -func testAccDataOutscaleOAPICaConfig(path string) string { +func testAccDataOutscaleCaConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { ca_pem = file(%q) diff --git a/outscale/data_source_outscale_cas.go b/outscale/data_source_outscale_cas.go index 95d9d7fd4..f14ef4020 100644 --- a/outscale/data_source_outscale_cas.go +++ b/outscale/data_source_outscale_cas.go @@ -51,7 +51,7 @@ func DataSourceOutscaleCasRead(d *schema.ResourceData, meta interface{}) error { params := oscgo.ReadCasRequest{} if filtersOk { - params.Filters = buildOutscaleOAPIDataSourceCaFilters(filters.(*schema.Set)) + params.Filters = buildOutscaleDataSourceCaFilters(filters.(*schema.Set)) } var resp oscgo.ReadCasResponse var err error diff --git a/outscale/data_source_outscale_cas_test.go b/outscale/data_source_outscale_cas_test.go index 2c3a89dd4..b8d74598a 100644 --- a/outscale/data_source_outscale_cas_test.go +++ b/outscale/data_source_outscale_cas_test.go @@ -23,7 +23,7 @@ func TestAccOthers_DataOutscaleCas_basic(t *testing.T) { CheckDestroy: testAccDataCheckOutscaleCasDestroy, Steps: []resource.TestStep{ { - Config: testAccDataOutscaleOAPICasConfig(ca_path), + Config: testAccDataOutscaleCasConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resName), ), @@ -72,7 +72,7 @@ func testAccDataCheckOutscaleCasDestroy(s *terraform.State) error { return nil } -func testAccDataOutscaleOAPICasConfig(path string) string { +func testAccDataOutscaleCasConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { ca_pem = file(%[1]q) diff --git a/outscale/data_source_outscale_flexible_gpu.go b/outscale/data_source_outscale_flexible_gpu.go index bb178514a..448391e82 100644 --- a/outscale/data_source_outscale_flexible_gpu.go +++ b/outscale/data_source_outscale_flexible_gpu.go @@ -72,7 +72,7 @@ func DataSourceOutscaleFlexibleGpuRead(d *schema.ResourceData, meta interface{}) FlexibleGpuIds: &[]string{flexID.(string)}, } - req.SetFilters(buildOutscaleOAPIDataSourceFlexibleGpuFilters(filters.(*schema.Set))) + req.SetFilters(buildOutscaleDataSourceFlexibleGpuFilters(filters.(*schema.Set))) var resp oscgo.ReadFlexibleGpusResponse var err error @@ -122,7 +122,7 @@ func DataSourceOutscaleFlexibleGpuRead(d *schema.ResourceData, meta interface{}) return nil } -func buildOutscaleOAPIDataSourceFlexibleGpuFilters(set *schema.Set) oscgo.FiltersFlexibleGpu { +func buildOutscaleDataSourceFlexibleGpuFilters(set *schema.Set) oscgo.FiltersFlexibleGpu { var filters oscgo.FiltersFlexibleGpu for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_flexible_gpu_catalog_test.go b/outscale/data_source_outscale_flexible_gpu_catalog_test.go index a6940e901..61ddfe8f4 100644 --- a/outscale/data_source_outscale_flexible_gpu_catalog_test.go +++ b/outscale/data_source_outscale_flexible_gpu_catalog_test.go @@ -16,13 +16,13 @@ func TestAccOthers_DataSourceFlexibleGpuCatalog_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIFlexibleGpuCatalogConfig(), + Config: testAccDataSourceOutscaleFlexibleGpuCatalogConfig(), }, }, }) } -func testAccDataSourceOutscaleOAPIFlexibleGpuCatalogConfig() string { +func testAccDataSourceOutscaleFlexibleGpuCatalogConfig() string { return fmt.Sprintf(` data "outscale_flexible_gpu_catalog" "catalog-fGPU" { } `) diff --git a/outscale/data_source_outscale_flexible_gpu_test.go b/outscale/data_source_outscale_flexible_gpu_test.go index 5227373ba..bcf1b4151 100644 --- a/outscale/data_source_outscale_flexible_gpu_test.go +++ b/outscale/data_source_outscale_flexible_gpu_test.go @@ -17,13 +17,13 @@ func TestAccOthers_DataSourceFlexibleGpu_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIFlexibleGpuConfig(utils.GetRegion()), + Config: testAccDataSourceOutscaleFlexibleGpuConfig(utils.GetRegion()), }, }, }) } -func testAccDataSourceOutscaleOAPIFlexibleGpuConfig(region string) string { +func testAccDataSourceOutscaleFlexibleGpuConfig(region string) string { return fmt.Sprintf(` resource "outscale_flexible_gpu" "dataGPU" { model_name = "nvidia-p6" diff --git a/outscale/data_source_outscale_flexible_gpus.go b/outscale/data_source_outscale_flexible_gpus.go index c4b13c53c..659bb12b1 100644 --- a/outscale/data_source_outscale_flexible_gpus.go +++ b/outscale/data_source_outscale_flexible_gpus.go @@ -73,7 +73,7 @@ func DataSourceOutscaleFlexibleGpusRead(d *schema.ResourceData, meta interface{} } req := oscgo.ReadFlexibleGpusRequest{} - req.SetFilters(buildOutscaleOAPIDataSourceFlexibleGpuFilters(filters.(*schema.Set))) + req.SetFilters(buildOutscaleDataSourceFlexibleGpuFilters(filters.(*schema.Set))) var resp oscgo.ReadFlexibleGpusResponse var err error diff --git a/outscale/data_source_outscale_flexible_gpus_test.go b/outscale/data_source_outscale_flexible_gpus_test.go index 543b3f0f9..fddbb3a5a 100644 --- a/outscale/data_source_outscale_flexible_gpus_test.go +++ b/outscale/data_source_outscale_flexible_gpus_test.go @@ -17,13 +17,13 @@ func TestAccOthers_DataSourceFlexibleGpus_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIFlexibleGpusConfig(utils.GetRegion()), + Config: testAccDataSourceOutscaleFlexibleGpusConfig(utils.GetRegion()), }, }, }) } -func testAccDataSourceOutscaleOAPIFlexibleGpusConfig(region string) string { +func testAccDataSourceOutscaleFlexibleGpusConfig(region string) string { return fmt.Sprintf(` resource "outscale_flexible_gpu" "fGPUS-1" { model_name = "nvidia-p6" diff --git a/outscale/data_source_outscale_image.go b/outscale/data_source_outscale_image.go index 72c64304a..096eee809 100644 --- a/outscale/data_source_outscale_image.go +++ b/outscale/data_source_outscale_image.go @@ -207,7 +207,7 @@ func DataSourceOutscaleImageRead(d *schema.ResourceData, meta interface{}) error filtersReq := &oscgo.FiltersImage{} if filtersOk { - filtersReq = buildOutscaleOAPIDataSourceImagesFilters(filters.(*schema.Set)) + filtersReq = buildOutscaleDataSourceImagesFilters(filters.(*schema.Set)) } if imageIDOk { filtersReq.SetImageIds([]string{imageID.(string)}) diff --git a/outscale/data_source_outscale_image_export_task_test.go b/outscale/data_source_outscale_image_export_task_test.go index e4cb18514..862cd7cdc 100644 --- a/outscale/data_source_outscale_image_export_task_test.go +++ b/outscale/data_source_outscale_image_export_task_test.go @@ -25,7 +25,7 @@ func TestAccVM_withImageExportTaskDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIImageExportTaskDataSourceConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), + Config: testAccOutscaleImageExportTaskDataSourceConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleImageExportTaskDataSourceID("data.outscale_image_export_task.test"), ), @@ -52,7 +52,7 @@ func testAccCheckOutscaleImageExportTaskDataSourceID(n string) resource.TestChec } } -func testAccOutscaleOAPIImageExportTaskDataSourceConfig(omi, vmType, region, imageName string) string { +func testAccOutscaleImageExportTaskDataSourceConfig(omi, vmType, region, imageName string) string { return fmt.Sprintf(` resource "outscale_vm" "basicExport" { image_id = "%s" diff --git a/outscale/data_source_outscale_image_export_tasks_test.go b/outscale/data_source_outscale_image_export_tasks_test.go index 2bb984e50..e1da2f085 100644 --- a/outscale/data_source_outscale_image_export_tasks_test.go +++ b/outscale/data_source_outscale_image_export_tasks_test.go @@ -24,7 +24,7 @@ func TestAccVM_withImageExportTasksDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIImageExportTasksDataSourceConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), + Config: testAccOutscaleImageExportTasksDataSourceConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleImageExportTaskDataSourceID("outscale_image_export_task.outscale_image_export_task"), ), @@ -36,7 +36,7 @@ func TestAccVM_withImageExportTasksDataSource_basic(t *testing.T) { } } -func testAccOutscaleOAPIImageExportTasksDataSourceConfig(omi, vmType, region, imageName string) string { +func testAccOutscaleImageExportTasksDataSourceConfig(omi, vmType, region, imageName string) string { return fmt.Sprintf(` resource "outscale_vm" "basic" { image_id = "%s" diff --git a/outscale/data_source_outscale_image_test.go b/outscale/data_source_outscale_image_test.go index dafded625..902180699 100644 --- a/outscale/data_source_outscale_image_test.go +++ b/outscale/data_source_outscale_image_test.go @@ -23,16 +23,16 @@ func TestAccVM_WithImageDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIImageDataSourceBasicConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), + Config: testAccCheckOutscaleImageDataSourceBasicConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIImageDataSourceID("data.outscale_image.omi"), + testAccCheckOutscaleImageDataSourceID("data.outscale_image.omi"), ), }, }, }) } -func testAccCheckOutscaleOAPIImageDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleImageDataSourceID(n string) resource.TestCheckFunc { // Wait for IAM role return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -47,7 +47,7 @@ func testAccCheckOutscaleOAPIImageDataSourceID(n string) resource.TestCheckFunc } } -func testAccCheckOutscaleOAPIImageDataSourceBasicConfig(omi, vmType, region, imageName string) string { +func testAccCheckOutscaleImageDataSourceBasicConfig(omi, vmType, region, imageName string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_img_data" { security_group_name = "sg_imgData" diff --git a/outscale/data_source_outscale_images.go b/outscale/data_source_outscale_images.go index 2ceda23c3..7fb8c71b7 100644 --- a/outscale/data_source_outscale_images.go +++ b/outscale/data_source_outscale_images.go @@ -223,7 +223,7 @@ func DataSourceOutscaleImagesRead(d *schema.ResourceData, meta interface{}) erro filtersReq := &oscgo.FiltersImage{} if filtersOk { - filtersReq = buildOutscaleOAPIDataSourceImagesFilters(filters.(*schema.Set)) + filtersReq = buildOutscaleDataSourceImagesFilters(filters.(*schema.Set)) } if ownersOk { filtersReq.SetAccountIds([]string{aids.(string)}) @@ -281,7 +281,7 @@ func DataSourceOutscaleImagesRead(d *schema.ResourceData, meta interface{}) erro }) } -func buildOutscaleOAPIDataSourceImagesFilters(set *schema.Set) *oscgo.FiltersImage { +func buildOutscaleDataSourceImagesFilters(set *schema.Set) *oscgo.FiltersImage { filters := &oscgo.FiltersImage{} for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_images_test.go b/outscale/data_source_outscale_images_test.go index ed54ff69b..aa11ad6a5 100644 --- a/outscale/data_source_outscale_images_test.go +++ b/outscale/data_source_outscale_images_test.go @@ -23,16 +23,16 @@ func TestAccVM_WithImagesDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIImagesDataSourceConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), + Config: testAccCheckOutscaleImagesDataSourceConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), imageName), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIImagesDataSourceID("data.outscale_images.nat_ami"), + testAccCheckOutscaleImagesDataSourceID("data.outscale_images.nat_ami"), ), }, }, }) } -func testAccCheckOutscaleOAPIImagesDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleImagesDataSourceID(n string) resource.TestCheckFunc { // Wait for IAM role return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -47,7 +47,7 @@ func testAccCheckOutscaleOAPIImagesDataSourceID(n string) resource.TestCheckFunc } } -func testAccCheckOutscaleOAPIImagesDataSourceConfig(omi, vmType, region, imageName string) string { +func testAccCheckOutscaleImagesDataSourceConfig(omi, vmType, region, imageName string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_imgs_data" { security_group_name = "sg_imgsData" diff --git a/outscale/data_source_outscale_internet_service.go b/outscale/data_source_outscale_internet_service.go index 6563f026e..3cba03804 100644 --- a/outscale/data_source_outscale_internet_service.go +++ b/outscale/data_source_outscale_internet_service.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func datasourceOutscaleOAPIInternetService() *schema.Resource { +func datasourceOutscaleInternetService() *schema.Resource { return &schema.Resource{ - Read: datasourceOutscaleOAPIInternetServiceRead, + Read: datasourceOutscaleInternetServiceRead, Schema: map[string]*schema.Schema{ "filter": dataSourceFiltersSchema(), "state": { @@ -39,7 +39,7 @@ func datasourceOutscaleOAPIInternetService() *schema.Resource { } } -func datasourceOutscaleOAPIInternetServiceRead(d *schema.ResourceData, meta interface{}) error { +func datasourceOutscaleInternetServiceRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI filters, filtersOk := d.GetOk("filter") diff --git a/outscale/data_source_outscale_internet_service_test.go b/outscale/data_source_outscale_internet_service_test.go index 6df55ee70..e579edc76 100644 --- a/outscale/data_source_outscale_internet_service_test.go +++ b/outscale/data_source_outscale_internet_service_test.go @@ -13,7 +13,7 @@ func TestAccOthers_InternetServiceDatasource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIInternetServiceDatasourceConfig, + Config: testAccOutscaleInternetServiceDatasourceConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("data.outscale_internet_service.outscale_internet_serviced", "internet_service_id"), ), @@ -22,7 +22,7 @@ func TestAccOthers_InternetServiceDatasource_basic(t *testing.T) { }) } -const testAccOutscaleOAPIInternetServiceDatasourceConfig = ` +const testAccOutscaleInternetServiceDatasourceConfig = ` resource "outscale_internet_service" "outscale_internet_service" {} data "outscale_internet_service" "outscale_internet_serviced" { diff --git a/outscale/data_source_outscale_internet_services.go b/outscale/data_source_outscale_internet_services.go index a69f4c231..c65a18d61 100644 --- a/outscale/data_source_outscale_internet_services.go +++ b/outscale/data_source_outscale_internet_services.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func datasourceOutscaleOAPIInternetServices() *schema.Resource { +func datasourceOutscaleInternetServices() *schema.Resource { return &schema.Resource{ - Read: datasourceOutscaleOAPIInternetServicesRead, + Read: datasourceOutscaleInternetServicesRead, Schema: map[string]*schema.Schema{ "filter": dataSourceFiltersSchema(), "internet_service_ids": { @@ -54,7 +54,7 @@ func datasourceOutscaleOAPIInternetServices() *schema.Resource { } } -func datasourceOutscaleOAPIInternetServicesRead(d *schema.ResourceData, meta interface{}) error { +func datasourceOutscaleInternetServicesRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI filters, filtersOk := d.GetOk("filter") diff --git a/outscale/data_source_outscale_internet_services_test.go b/outscale/data_source_outscale_internet_services_test.go index 7a267aa02..65846fa52 100644 --- a/outscale/data_source_outscale_internet_services_test.go +++ b/outscale/data_source_outscale_internet_services_test.go @@ -13,13 +13,13 @@ func TestAccOthers_InternetServicesDatasource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIInternetServicesDatasourceConfig, + Config: testAccOutscaleInternetServicesDatasourceConfig, }, }, }) } -const testAccOutscaleOAPIInternetServicesDatasourceConfig = ` +const testAccOutscaleInternetServicesDatasourceConfig = ` resource "outscale_internet_service" "gateway" {} data "outscale_internet_services" "outscale_internet_services" { diff --git a/outscale/data_source_outscale_keypair.go b/outscale/data_source_outscale_keypair.go index 3a883ba5f..365b0a33a 100644 --- a/outscale/data_source_outscale_keypair.go +++ b/outscale/data_source_outscale_keypair.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func datasourceOutscaleOApiKeyPairRead(d *schema.ResourceData, meta interface{}) error { +func datasourceOutscaleKeyPairRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.ReadKeypairsRequest{ Filters: &oscgo.FiltersKeypair{KeypairNames: &[]string{d.Id()}}, @@ -30,7 +30,7 @@ func datasourceOutscaleOApiKeyPairRead(d *schema.ResourceData, meta interface{}) filters, filtersOk := d.GetOk("filter") if filtersOk { - req.SetFilters(buildOutscaleOAPIKeyPairsDataSourceFilters(filters.(*schema.Set))) + req.SetFilters(buildOutscaleKeyPairsDataSourceFilters(filters.(*schema.Set))) } var resp oscgo.ReadKeypairsResponse @@ -79,9 +79,9 @@ func datasourceOutscaleOApiKeyPairRead(d *schema.ResourceData, meta interface{}) return nil } -func datasourceOutscaleOAPIKeyPair() *schema.Resource { +func datasourceOutscaleKeyPair() *schema.Resource { return &schema.Resource{ - Read: datasourceOutscaleOApiKeyPairRead, + Read: datasourceOutscaleKeyPairRead, Schema: map[string]*schema.Schema{ "filter": dataSourceFiltersSchema(), @@ -103,7 +103,7 @@ func datasourceOutscaleOAPIKeyPair() *schema.Resource { } } -func buildOutscaleOAPIKeyPairsDataSourceFilters(set *schema.Set) oscgo.FiltersKeypair { +func buildOutscaleKeyPairsDataSourceFilters(set *schema.Set) oscgo.FiltersKeypair { var filters oscgo.FiltersKeypair for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_keypair_test.go b/outscale/data_source_outscale_keypair_test.go index 89ab1fce4..30d753a9f 100644 --- a/outscale/data_source_outscale_keypair_test.go +++ b/outscale/data_source_outscale_keypair_test.go @@ -18,9 +18,9 @@ func TestAccOthers_KeypairDataSource_Instance(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIKeypairDataSourceConfig(keyPairName), + Config: testAccCheckOutscaleKeypairDataSourceConfig(keyPairName), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIKeypairDataSourceID("data.outscale_keypair.nat_ami"), + testAccCheckOutscaleKeypairDataSourceID("data.outscale_keypair.nat_ami"), resource.TestCheckResourceAttr("data.outscale_keypair.nat_ami", "keypair_name", keyPairName), ), }, @@ -28,7 +28,7 @@ func TestAccOthers_KeypairDataSource_Instance(t *testing.T) { }) } -func testAccCheckOutscaleOAPIKeypairDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleKeypairDataSourceID(n string) resource.TestCheckFunc { // Wait for IAM role return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -43,7 +43,7 @@ func testAccCheckOutscaleOAPIKeypairDataSourceID(n string) resource.TestCheckFun } } -func testAccCheckOutscaleOAPIKeypairDataSourceConfig(keypairName string) string { +func testAccCheckOutscaleKeypairDataSourceConfig(keypairName string) string { return fmt.Sprintf(` resource "outscale_keypair" "a_key_pair" { keypair_name = "%s" diff --git a/outscale/data_source_outscale_keypairs.go b/outscale/data_source_outscale_keypairs.go index ca3d37b4c..e2f7f0a17 100644 --- a/outscale/data_source_outscale_keypairs.go +++ b/outscale/data_source_outscale_keypairs.go @@ -35,7 +35,7 @@ func datasourceOutscaleOAPiKeyPairsRead(d *schema.ResourceData, meta interface{} filters, filtersOk := d.GetOk("filter") if filtersOk { - req.SetFilters(buildOutscaleOAPIKeyPairsDataSourceFilters(filters.(*schema.Set))) + req.SetFilters(buildOutscaleKeyPairsDataSourceFilters(filters.(*schema.Set))) } var resp oscgo.ReadKeypairsResponse @@ -85,7 +85,7 @@ func datasourceOutscaleOAPiKeyPairsRead(d *schema.ResourceData, meta interface{} return d.Set("keypairs", keypairs) } -func datasourceOutscaleOAPIKeyPairs() *schema.Resource { +func datasourceOutscaleKeyPairs() *schema.Resource { return &schema.Resource{ Read: datasourceOutscaleOAPiKeyPairsRead, diff --git a/outscale/data_source_outscale_keypairs_test.go b/outscale/data_source_outscale_keypairs_test.go index e68672822..113264e0a 100644 --- a/outscale/data_source_outscale_keypairs_test.go +++ b/outscale/data_source_outscale_keypairs_test.go @@ -17,9 +17,9 @@ func TestAccOthers_KeypairsDataSource_Instance(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIKeypairsDataSourceConfig(keyPairName), + Config: testAccCheckOutscaleKeypairsDataSourceConfig(keyPairName), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIKeypairsDataSourceID("data.outscale_keypairs.nat_ami"), + testAccCheckOutscaleKeypairsDataSourceID("data.outscale_keypairs.nat_ami"), resource.TestCheckResourceAttr("data.outscale_keypairs.nat_ami", "keypairs.0.keypair_name", keyPairName), ), }, @@ -27,7 +27,7 @@ func TestAccOthers_KeypairsDataSource_Instance(t *testing.T) { }) } -func testAccCheckOutscaleOAPIKeypairsDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleKeypairsDataSourceID(n string) resource.TestCheckFunc { // Wait for IAM role return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -42,7 +42,7 @@ func testAccCheckOutscaleOAPIKeypairsDataSourceID(n string) resource.TestCheckFu } } -func testAccCheckOutscaleOAPIKeypairsDataSourceConfig(keyPairName string) string { +func testAccCheckOutscaleKeypairsDataSourceConfig(keyPairName string) string { return fmt.Sprintf(` resource "outscale_keypair" "a_key_pair" { keypair_name = "%s" diff --git a/outscale/data_source_outscale_load_balancer_tags_test.go b/outscale/data_source_outscale_load_balancer_tags_test.go index eb4352209..1f32ad070 100644 --- a/outscale/data_source_outscale_load_balancer_tags_test.go +++ b/outscale/data_source_outscale_load_balancer_tags_test.go @@ -10,7 +10,7 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPIDSLoadBalancerTags_basic(t *testing.T) { +func TestAccOutscaleDSLoadBalancerTags_basic(t *testing.T) { t.Parallel() r := acctest.RandString(4) diff --git a/outscale/data_source_outscale_load_balancer_test.go b/outscale/data_source_outscale_load_balancer_test.go index fe7c9e718..47ccd16f6 100644 --- a/outscale/data_source_outscale_load_balancer_test.go +++ b/outscale/data_source_outscale_load_balancer_test.go @@ -27,12 +27,12 @@ func TestAccOthers_LBU_basic(t *testing.T) { }, IDRefreshName: "outscale_load_balancer.bar", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILBUDestroy, + CheckDestroy: testAccCheckOutscaleLBUDestroy, Steps: []resource.TestStep{ { - Config: testAccDSOutscaleOAPILBUConfig(zone, number), + Config: testAccDSOutscaleLBUConfig(zone, number), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILBUExists("outscale_load_balancer.dataLb", &conf), + testAccCheckOutscaleLBUExists("outscale_load_balancer.dataLb", &conf), resource.TestCheckResourceAttr( "data.outscale_load_balancer.dataTest", "subregion_names.#", "1"), resource.TestCheckResourceAttr( @@ -42,7 +42,7 @@ func TestAccOthers_LBU_basic(t *testing.T) { }) } -func testAccDSOutscaleOAPILBUConfig(zone string, number int) string { +func testAccDSOutscaleLBUConfig(zone string, number int) string { return fmt.Sprintf(` resource "outscale_load_balancer" "dataLb" { subregion_names = ["%s"] diff --git a/outscale/data_source_outscale_load_balancers_test.go b/outscale/data_source_outscale_load_balancers_test.go index 23d3a6f7a..5eae4f7f7 100644 --- a/outscale/data_source_outscale_load_balancers_test.go +++ b/outscale/data_source_outscale_load_balancers_test.go @@ -18,10 +18,10 @@ func TestAccOthers_LBUs_basic(t *testing.T) { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILBUDestroy, + CheckDestroy: testAccCheckOutscaleLBUDestroy, Steps: []resource.TestStep{ { - Config: testAccDSOutscaleOAPILBsUConfig(region, numLbu), + Config: testAccDSOutscaleLBsUConfig(region, numLbu), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.outscale_load_balancers.test", "load_balancer.#", "1"), )}, @@ -29,7 +29,7 @@ func TestAccOthers_LBUs_basic(t *testing.T) { }) } -func testAccDSOutscaleOAPILBsUConfig(region string, numLbu int) string { +func testAccDSOutscaleLBsUConfig(region string, numLbu int) string { return fmt.Sprintf(` resource "outscale_load_balancer" "bars" { subregion_names = ["%s"] diff --git a/outscale/data_source_outscale_nat_service.go b/outscale/data_source_outscale_nat_service.go index 664fd4b72..dc28a4217 100644 --- a/outscale/data_source_outscale_nat_service.go +++ b/outscale/data_source_outscale_nat_service.go @@ -74,7 +74,7 @@ func DataSourceOutscaleNatServiceRead(d *schema.ResourceData, meta interface{}) params := oscgo.ReadNatServicesRequest{} if filtersOk { - params.SetFilters(buildOutscaleOAPINatServiceDataSourceFilters(filters.(*schema.Set))) + params.SetFilters(buildOutscaleNatServiceDataSourceFilters(filters.(*schema.Set))) } if natGatewayIDOK && natGatewayID.(string) != "" { filter := oscgo.FiltersNatService{} @@ -163,7 +163,7 @@ func ngOAPIDescriptionAttributes(d *schema.ResourceData, ng oscgo.NatService) er return nil } -func buildOutscaleOAPINatServiceDataSourceFilters(set *schema.Set) oscgo.FiltersNatService { +func buildOutscaleNatServiceDataSourceFilters(set *schema.Set) oscgo.FiltersNatService { var filters oscgo.FiltersNatService for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_nat_service_test.go b/outscale/data_source_outscale_nat_service_test.go index 508224dd6..84a483a11 100644 --- a/outscale/data_source_outscale_nat_service_test.go +++ b/outscale/data_source_outscale_nat_service_test.go @@ -15,7 +15,7 @@ func TestAccNet_WithNatServiceDataSource_Instance(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPINatServiceDataSourceConfig, + Config: testAccCheckOutscaleNatServiceDataSourceConfig, Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleNatServiceDataSourceID("data.outscale_nat_service.nat"), resource.TestCheckResourceAttrSet("data.outscale_nat_service.nat", "subnet_id"), @@ -40,7 +40,7 @@ func testAccCheckOutscaleNatServiceDataSourceID(n string) resource.TestCheckFunc } } -const testAccCheckOutscaleOAPINatServiceDataSourceConfig = ` +const testAccCheckOutscaleNatServiceDataSourceConfig = ` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" tags { diff --git a/outscale/data_source_outscale_nat_services.go b/outscale/data_source_outscale_nat_services.go index 323faac10..a682837d1 100644 --- a/outscale/data_source_outscale_nat_services.go +++ b/outscale/data_source_outscale_nat_services.go @@ -86,7 +86,7 @@ func DataSourceOutscaleNatServicesRead(d *schema.ResourceData, meta interface{}) params := oscgo.ReadNatServicesRequest{} if filtersOk { - params.SetFilters(buildOutscaleOAPINatServiceDataSourceFilters(filters.(*schema.Set))) + params.SetFilters(buildOutscaleNatServiceDataSourceFilters(filters.(*schema.Set))) } if natGatewayIDOK { ids := make([]string, len(natGatewayID.([]interface{}))) diff --git a/outscale/data_source_outscale_nat_services_test.go b/outscale/data_source_outscale_nat_services_test.go index f81f6609e..935548fdf 100644 --- a/outscale/data_source_outscale_nat_services_test.go +++ b/outscale/data_source_outscale_nat_services_test.go @@ -13,7 +13,7 @@ func TestAccNet_WithNatServicesDataSource_Instance(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPINatServicesDataSourceConfig, + Config: testAccCheckOutscaleNatServicesDataSourceConfig, Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleNatServiceDataSourceID("data.outscale_nat_services.nat"), resource.TestCheckResourceAttr("data.outscale_nat_services.nat", "nat_services.#", "1"), @@ -24,7 +24,7 @@ func TestAccNet_WithNatServicesDataSource_Instance(t *testing.T) { }) } -const testAccCheckOutscaleOAPINatServicesDataSourceConfig = ` +const testAccCheckOutscaleNatServicesDataSourceConfig = ` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_net.go b/outscale/data_source_outscale_net.go index 364ef7e56..ab8c2b9d5 100644 --- a/outscale/data_source_outscale_net.go +++ b/outscale/data_source_outscale_net.go @@ -60,7 +60,7 @@ func DataSourceOutscaleVpcRead(d *schema.ResourceData, meta interface{}) error { req := oscgo.ReadNetsRequest{} if v, ok := d.GetOk("filter"); ok { - req.SetFilters(buildOutscaleOAPIDataSourceNetFilters(v.(*schema.Set))) + req.SetFilters(buildOutscaleDataSourceNetFilters(v.(*schema.Set))) } if id := d.Get("net_id"); id != "" { @@ -112,7 +112,7 @@ func DataSourceOutscaleVpcRead(d *schema.ResourceData, meta interface{}) error { return d.Set("tags", tagsOSCAPIToMap(net.GetTags())) } -func buildOutscaleOAPIDataSourceNetFilters(set *schema.Set) oscgo.FiltersNet { +func buildOutscaleDataSourceNetFilters(set *schema.Set) oscgo.FiltersNet { var filters oscgo.FiltersNet for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_net_access_point_services_test.go b/outscale/data_source_outscale_net_access_point_services_test.go index 161304544..616f26067 100644 --- a/outscale/data_source_outscale_net_access_point_services_test.go +++ b/outscale/data_source_outscale_net_access_point_services_test.go @@ -19,13 +19,13 @@ func TestAccNet_AccessPointServicesDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPINetAccessPointServicesConfig(serviceName), + Config: testAccDataSourceOutscaleNetAccessPointServicesConfig(serviceName), }, }, }) } -func testAccDataSourceOutscaleOAPINetAccessPointServicesConfig(sName string) string { +func testAccDataSourceOutscaleNetAccessPointServicesConfig(sName string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_net_access_point_test.go b/outscale/data_source_outscale_net_access_point_test.go index 390f81a53..039b26693 100644 --- a/outscale/data_source_outscale_net_access_point_test.go +++ b/outscale/data_source_outscale_net_access_point_test.go @@ -19,13 +19,13 @@ func TestAccNet_AccessPointDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPINetAccessPointConfig(serviceName), + Config: testAccDataSourceOutscaleNetAccessPointConfig(serviceName), }, }, }) } -func testAccDataSourceOutscaleOAPINetAccessPointConfig(sName string) string { +func testAccDataSourceOutscaleNetAccessPointConfig(sName string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_net_access_points_test.go b/outscale/data_source_outscale_net_access_points_test.go index bbb98ff69..2c8e75e7c 100644 --- a/outscale/data_source_outscale_net_access_points_test.go +++ b/outscale/data_source_outscale_net_access_points_test.go @@ -19,13 +19,13 @@ func TestAccNet_AccessPointsDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPINetAccessPointsConfig(serviceName), + Config: testAccDataSourceOutscaleNetAccessPointsConfig(serviceName), }, }, }) } -func testAccDataSourceOutscaleOAPINetAccessPointsConfig(sName string) string { +func testAccDataSourceOutscaleNetAccessPointsConfig(sName string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_net_attributes_test.go b/outscale/data_source_outscale_net_attributes_test.go index fb1761cd3..e42b39b4e 100644 --- a/outscale/data_source_outscale_net_attributes_test.go +++ b/outscale/data_source_outscale_net_attributes_test.go @@ -15,16 +15,16 @@ func TestAccNet_AttributesDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIDSLinAttrConfig, + Config: testAccOutscaleDSLinAttrConfig, Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPIVpcAttrCheck("data.outscale_net_attributes.test"), + testAccDataSourceOutscaleVpcAttrCheck("data.outscale_net_attributes.test"), ), }, }, }) } -func testAccDataSourceOutscaleOAPIVpcAttrCheck(name string) resource.TestCheckFunc { +func testAccDataSourceOutscaleVpcAttrCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] if !ok { @@ -41,7 +41,7 @@ func testAccDataSourceOutscaleOAPIVpcAttrCheck(name string) resource.TestCheckFu } } -const testAccOutscaleOAPIDSLinAttrConfig = ` +const testAccOutscaleDSLinAttrConfig = ` resource "outscale_net" "vpc" { ip_range = "10.0.0.0/16" tags { diff --git a/outscale/data_source_outscale_net_peering.go b/outscale/data_source_outscale_net_peering.go index ad62c35fa..c0346687c 100644 --- a/outscale/data_source_outscale_net_peering.go +++ b/outscale/data_source_outscale_net_peering.go @@ -63,7 +63,7 @@ func DataSourceOutscaleLinPeeringConnectionRead(d *schema.ResourceData, meta int if !filtersOk { return fmt.Errorf("filters must be assigned") } - filtersValues, err := buildOutscaleOAPILinPeeringConnectionFilters(filters.(*schema.Set)) + filtersValues, err := buildOutscaleLinPeeringConnectionFilters(filters.(*schema.Set)) if err != nil { return err } @@ -143,7 +143,7 @@ func DataSourceOutscaleLinPeeringConnectionRead(d *schema.ResourceData, meta int return nil } -func buildOutscaleOAPILinPeeringConnectionFilters(set *schema.Set) (oscgo.FiltersNetPeering, error) { +func buildOutscaleLinPeeringConnectionFilters(set *schema.Set) (oscgo.FiltersNetPeering, error) { var filters oscgo.FiltersNetPeering for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_net_peering_test.go b/outscale/data_source_outscale_net_peering_test.go index 54d16dd30..0d454a7da 100644 --- a/outscale/data_source_outscale_net_peering_test.go +++ b/outscale/data_source_outscale_net_peering_test.go @@ -15,16 +15,16 @@ func TestAccNet_PeeringConnectionDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPILinPeeringConnectionConfig, + Config: testAccDataSourceOutscaleLinPeeringConnectionConfig, Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPILinPeeringConnectionCheck("outscale_net_peering.net_peering"), + testAccDataSourceOutscaleLinPeeringConnectionCheck("outscale_net_peering.net_peering"), ), }, }, }) } -func testAccDataSourceOutscaleOAPILinPeeringConnectionCheck(name string) resource.TestCheckFunc { +func testAccDataSourceOutscaleLinPeeringConnectionCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] if !ok { @@ -50,7 +50,7 @@ func testAccDataSourceOutscaleOAPILinPeeringConnectionCheck(name string) resourc } } -const testAccDataSourceOutscaleOAPILinPeeringConnectionConfig = ` +const testAccDataSourceOutscaleLinPeeringConnectionConfig = ` resource "outscale_net" "net" { ip_range = "10.10.0.0/24" tags { diff --git a/outscale/data_source_outscale_net_peerings.go b/outscale/data_source_outscale_net_peerings.go index d70ba8355..2de65f62f 100644 --- a/outscale/data_source_outscale_net_peerings.go +++ b/outscale/data_source_outscale_net_peerings.go @@ -70,7 +70,7 @@ func DataSourceOutscaleLinPeeringsConnectionRead(d *schema.ResourceData, meta in } params := oscgo.ReadNetPeeringsRequest{} - filtersValues, err := buildOutscaleOAPILinPeeringConnectionFilters(filters.(*schema.Set)) + filtersValues, err := buildOutscaleLinPeeringConnectionFilters(filters.(*schema.Set)) if err != nil { return err } diff --git a/outscale/data_source_outscale_net_peerings_test.go b/outscale/data_source_outscale_net_peerings_test.go index 36fdf8200..bb287f460 100644 --- a/outscale/data_source_outscale_net_peerings_test.go +++ b/outscale/data_source_outscale_net_peerings_test.go @@ -13,7 +13,7 @@ func TestAccNet_PeeringsConnectionDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPILinPeeringsConnectionConfig, + Config: testAccDataSourceOutscaleLinPeeringsConnectionConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.outscale_net_peerings.outscale_net_peerings", "net_peerings.#", "1"), ), @@ -22,7 +22,7 @@ func TestAccNet_PeeringsConnectionDataSource_basic(t *testing.T) { }) } -const testAccDataSourceOutscaleOAPILinPeeringsConnectionConfig = ` +const testAccDataSourceOutscaleLinPeeringsConnectionConfig = ` resource "outscale_net" "outscale_net" { ip_range = "10.10.0.0/24" tags { diff --git a/outscale/data_source_outscale_net_test.go b/outscale/data_source_outscale_net_test.go index 808a03dbd..711810e93 100644 --- a/outscale/data_source_outscale_net_test.go +++ b/outscale/data_source_outscale_net_test.go @@ -21,16 +21,16 @@ func TestAccNet_DataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIVpcConfig(ipRange, tag), + Config: testAccDataSourceOutscaleVpcConfig(ipRange, tag), Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPIVpcCheck("data.outscale_net.by_id", ipRange, tag), + testAccDataSourceOutscaleVpcCheck("data.outscale_net.by_id", ipRange, tag), ), }, }, }) } -func testAccDataSourceOutscaleOAPIVpcCheck(name, ipRange, tag string) resource.TestCheckFunc { +func testAccDataSourceOutscaleVpcCheck(name, ipRange, tag string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] if !ok { @@ -60,7 +60,7 @@ func testAccDataSourceOutscaleOAPIVpcCheck(name, ipRange, tag string) resource.T } } -func testAccDataSourceOutscaleOAPIVpcConfig(ipRange, tag string) string { +func testAccDataSourceOutscaleVpcConfig(ipRange, tag string) string { return fmt.Sprintf(` resource "outscale_net" "test" { ip_range = "%s" diff --git a/outscale/data_source_outscale_nets.go b/outscale/data_source_outscale_nets.go index 706c57ae8..da50e8899 100644 --- a/outscale/data_source_outscale_nets.go +++ b/outscale/data_source_outscale_nets.go @@ -77,7 +77,7 @@ func DataSourceOutscaleVpcsRead(d *schema.ResourceData, meta interface{}) error } if filtersOk { - req.SetFilters(buildOutscaleOAPIDataSourceNetFilters(filters.(*schema.Set))) + req.SetFilters(buildOutscaleDataSourceNetFilters(filters.(*schema.Set))) } if netIdsOk { diff --git a/outscale/data_source_outscale_nets_test.go b/outscale/data_source_outscale_nets_test.go index 3a82af91b..303f75542 100644 --- a/outscale/data_source_outscale_nets_test.go +++ b/outscale/data_source_outscale_nets_test.go @@ -20,7 +20,7 @@ func TestAccNets_DataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIVpcsConfig(ipRange, tag), + Config: testAccDataSourceOutscaleVpcsConfig(ipRange, tag), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.outscale_nets.by_id", "nets.#", "1"), ), @@ -29,7 +29,7 @@ func TestAccNets_DataSource_basic(t *testing.T) { }) } -func testAccDataSourceOutscaleOAPIVpcsConfig(ipRange, tag string) string { +func testAccDataSourceOutscaleVpcsConfig(ipRange, tag string) string { return fmt.Sprintf(` resource "outscale_net" "test" { ip_range = "%s" diff --git a/outscale/data_source_outscale_nic.go b/outscale/data_source_outscale_nic.go index dad0afc36..edfaa55a5 100644 --- a/outscale/data_source_outscale_nic.go +++ b/outscale/data_source_outscale_nic.go @@ -224,7 +224,7 @@ func DataSourceOutscaleNicRead(d *schema.ResourceData, meta interface{}) error { dnri := oscgo.ReadNicsRequest{} if okFilters { - dnri.SetFilters(buildOutscaleOAPIDataSourceNicFilters(filters.(*schema.Set))) + dnri.SetFilters(buildOutscaleDataSourceNicFilters(filters.(*schema.Set))) } var resp oscgo.ReadNicsResponse @@ -351,7 +351,7 @@ func DataSourceOutscaleNicRead(d *schema.ResourceData, meta interface{}) error { return nil } -func buildOutscaleOAPIDataSourceNicFilters(set *schema.Set) oscgo.FiltersNic { +func buildOutscaleDataSourceNicFilters(set *schema.Set) oscgo.FiltersNic { var filters oscgo.FiltersNic for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_nic_test.go b/outscale/data_source_outscale_nic_test.go index f7e511f41..85763a760 100644 --- a/outscale/data_source_outscale_nic_test.go +++ b/outscale/data_source_outscale_nic_test.go @@ -23,13 +23,13 @@ func TestAccNet_WithNicDataSource_basic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_nic.outscale_nic", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIENIDestroy, + CheckDestroy: testAccCheckOutscaleENIDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIENIDataSourceConfig(utils.GetRegion()), + Config: testAccOutscaleENIDataSourceConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIENIExists("outscale_nic.outscale_nic", &conf), - testAccCheckOutscaleOAPIENIAttributes(&conf, utils.GetRegion()), + testAccCheckOutscaleENIExists("outscale_nic.outscale_nic", &conf), + testAccCheckOutscaleENIAttributes(&conf, utils.GetRegion()), ), }, }, @@ -44,20 +44,20 @@ func TestAccNet_WithNicDataSource_basicFilter(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_nic.outscale_nic", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIENIDestroy, + CheckDestroy: testAccCheckOutscaleENIDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIENIDataSourceConfigFilter(utils.GetRegion()), + Config: testAccOutscaleENIDataSourceConfigFilter(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIENIExists("outscale_nic.outscale_nic", &conf), - testAccCheckOutscaleOAPIENIAttributes(&conf, utils.GetRegion()), + testAccCheckOutscaleENIExists("outscale_nic.outscale_nic", &conf), + testAccCheckOutscaleENIAttributes(&conf, utils.GetRegion()), ), }, }, }) } -func testAccCheckOutscaleOAPIENIDestroy(s *terraform.State) error { +func testAccCheckOutscaleENIDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "outscale_nic" { continue @@ -90,7 +90,7 @@ func testAccCheckOutscaleOAPIENIDestroy(s *terraform.State) error { return nil } -func testAccCheckOutscaleOAPINICDestroy(s *terraform.State) error { +func testAccCheckOutscaleNICDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "outscale_nic" { continue @@ -129,7 +129,7 @@ func testAccCheckOutscaleOAPINICDestroy(s *terraform.State) error { return nil } -func testAccOutscaleOAPIENIDataSourceConfig(subregion string) string { +func testAccOutscaleENIDataSourceConfig(subregion string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" @@ -172,7 +172,7 @@ func testAccOutscaleOAPIENIDataSourceConfig(subregion string) string { `, subregion) } -func testAccOutscaleOAPIENIDataSourceConfigFilter(subregion string) string { +func testAccOutscaleENIDataSourceConfigFilter(subregion string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_nics.go b/outscale/data_source_outscale_nics.go index aa47e82a8..69f794e77 100644 --- a/outscale/data_source_outscale_nics.go +++ b/outscale/data_source_outscale_nics.go @@ -226,7 +226,7 @@ func DataSourceOutscaleNicsRead(d *schema.ResourceData, meta interface{}) error params := oscgo.ReadNicsRequest{} if filtersOk { - params.SetFilters(buildOutscaleOAPIDataSourceNicFilters(filters.(*schema.Set))) + params.SetFilters(buildOutscaleDataSourceNicFilters(filters.(*schema.Set))) } var resp oscgo.ReadNicsResponse diff --git a/outscale/data_source_outscale_nics_test.go b/outscale/data_source_outscale_nics_test.go index cce4a85a6..dbed8a409 100644 --- a/outscale/data_source_outscale_nics_test.go +++ b/outscale/data_source_outscale_nics_test.go @@ -15,7 +15,7 @@ func TestAccNet_WithNicsDataSource(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPINicsDataSourceConfig(utils.GetRegion()), + Config: testAccCheckOutscaleNicsDataSourceConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.outscale_nics.outscale_nics", "nics.#", "1"), ), @@ -24,7 +24,7 @@ func TestAccNet_WithNicsDataSource(t *testing.T) { }) } -func testAccCheckOutscaleOAPINicsDataSourceConfig(subregion string) string { +func testAccCheckOutscaleNicsDataSourceConfig(subregion string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_product_type.go b/outscale/data_source_outscale_product_type.go index c7fbb63fc..0e8e4dd42 100644 --- a/outscale/data_source_outscale_product_type.go +++ b/outscale/data_source_outscale_product_type.go @@ -47,7 +47,7 @@ func DataSourceOutscaleProductTypeRead(d *schema.ResourceData, meta interface{}) filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPIProductTypeDataSourceFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleProductTypeDataSourceFilters(filters.(*schema.Set)) } var resp oscgo.ReadProductTypesResponse @@ -90,7 +90,7 @@ func DataSourceOutscaleProductTypeRead(d *schema.ResourceData, meta interface{}) return nil } -func buildOutscaleOAPIProductTypeDataSourceFilters(set *schema.Set) *oscgo.FiltersProductType { +func buildOutscaleProductTypeDataSourceFilters(set *schema.Set) *oscgo.FiltersProductType { var filters oscgo.FiltersProductType for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_product_type_test.go b/outscale/data_source_outscale_product_type_test.go index d89d59945..2ade51910 100644 --- a/outscale/data_source_outscale_product_type_test.go +++ b/outscale/data_source_outscale_product_type_test.go @@ -13,14 +13,14 @@ func TestAccOthers_DataSourceProductType(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIProductTypeConfig, + Config: testAccDataSourceOutscaleProductTypeConfig, Check: resource.ComposeTestCheckFunc(), }, }, }) } -const testAccDataSourceOutscaleOAPIProductTypeConfig = ` +const testAccDataSourceOutscaleProductTypeConfig = ` data "outscale_product_type" "test" { filter { name = "product_type_ids" diff --git a/outscale/data_source_outscale_product_types.go b/outscale/data_source_outscale_product_types.go index c45a1445c..5703871ec 100644 --- a/outscale/data_source_outscale_product_types.go +++ b/outscale/data_source_outscale_product_types.go @@ -54,7 +54,7 @@ func DataSourceOutscaleProductTypesRead(d *schema.ResourceData, meta interface{} filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPIProductTypeDataSourceFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleProductTypeDataSourceFilters(filters.(*schema.Set)) } var resp oscgo.ReadProductTypesResponse diff --git a/outscale/data_source_outscale_product_types_test.go b/outscale/data_source_outscale_product_types_test.go index 1ef0203d7..29ac294c5 100644 --- a/outscale/data_source_outscale_product_types_test.go +++ b/outscale/data_source_outscale_product_types_test.go @@ -13,12 +13,12 @@ func TestAccOthers_DataSourceProductTypes(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIProductTypesConfig, + Config: testAccDataSourceOutscaleProductTypesConfig, Check: resource.ComposeTestCheckFunc(), }, }, }) } -const testAccDataSourceOutscaleOAPIProductTypesConfig = ` +const testAccDataSourceOutscaleProductTypesConfig = ` data "outscale_product_types" "all" {}` diff --git a/outscale/data_source_outscale_public_catalog_test.go b/outscale/data_source_outscale_public_catalog_test.go index 1c18eeaf6..a844e9053 100644 --- a/outscale/data_source_outscale_public_catalog_test.go +++ b/outscale/data_source_outscale_public_catalog_test.go @@ -16,13 +16,13 @@ func TestAccOthers_DataSourcePublicCatalog_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIPublicCatalogConfig(), + Config: testAccDataSourceOutscalePublicCatalogConfig(), }, }, }) } -func testAccDataSourceOutscaleOAPIPublicCatalogConfig() string { +func testAccDataSourceOutscalePublicCatalogConfig() string { return fmt.Sprintf(` data "outscale_public_catalog" "catalog" { } `) diff --git a/outscale/data_source_outscale_public_ip.go b/outscale/data_source_outscale_public_ip.go index f9ccea6a3..3b5ffa4b3 100644 --- a/outscale/data_source_outscale_public_ip.go +++ b/outscale/data_source_outscale_public_ip.go @@ -80,7 +80,7 @@ func DataSourceOutscalePublicIPRead(d *schema.ResourceData, meta interface{}) er filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPIDataSourcePublicIpsFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleDataSourcePublicIpsFilters(filters.(*schema.Set)) } var response oscgo.ReadPublicIpsResponse @@ -147,7 +147,7 @@ func DataSourceOutscalePublicIPRead(d *schema.ResourceData, meta interface{}) er return nil } -func buildOutscaleOAPIDataSourcePublicIpsFilters(set *schema.Set) *oscgo.FiltersPublicIp { +func buildOutscaleDataSourcePublicIpsFilters(set *schema.Set) *oscgo.FiltersPublicIp { var filters oscgo.FiltersPublicIp for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_public_ip_test.go b/outscale/data_source_outscale_public_ip_test.go index ccf8dcb1f..3061e150d 100644 --- a/outscale/data_source_outscale_public_ip_test.go +++ b/outscale/data_source_outscale_public_ip_test.go @@ -17,10 +17,10 @@ func TestAccOthers_DataSourcePublicIP(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIPublicIPConfig, + Config: testAccDataSourceOutscalePublicIPConfig, Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPIPublicIPCheck("data.outscale_public_ip.by_public_ip_id"), - testAccDataSourceOutscaleOAPIPublicIPCheck("data.outscale_public_ip.by_public_ip"), + testAccDataSourceOutscalePublicIPCheck("data.outscale_public_ip.by_public_ip_id"), + testAccDataSourceOutscalePublicIPCheck("data.outscale_public_ip.by_public_ip"), ), }, }, @@ -36,13 +36,13 @@ func TestAccVM_WithPublicIP(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIPublicIPConfigwithVM(omi, utils.GetRegion()), + Config: testAccDataSourceOutscalePublicIPConfigwithVM(omi, utils.GetRegion()), }, }, }) } -func testAccDataSourceOutscaleOAPIPublicIPCheck(name string) resource.TestCheckFunc { +func testAccDataSourceOutscalePublicIPCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] @@ -84,13 +84,13 @@ func TestAccOthers_DataSourcePublicIP_withTags(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIPublicIPConfigWithTags, + Config: testAccDataSourceOutscalePublicIPConfigWithTags, }, }, }) } -const testAccDataSourceOutscaleOAPIPublicIPConfig = ` +const testAccDataSourceOutscalePublicIPConfig = ` resource "outscale_public_ip" "test" {} data "outscale_public_ip" "by_public_ip_id" { @@ -105,7 +105,7 @@ const testAccDataSourceOutscaleOAPIPublicIPConfig = ` } ` -const testAccDataSourceOutscaleOAPIPublicIPConfigWithTags = ` +const testAccDataSourceOutscalePublicIPConfigWithTags = ` resource "outscale_public_ip" "outscale_public_ip" { tags { key = "name" @@ -126,7 +126,7 @@ const testAccDataSourceOutscaleOAPIPublicIPConfigWithTags = ` } ` -func testAccDataSourceOutscaleOAPIPublicIPConfigwithVM(omi, region string) string { +func testAccDataSourceOutscalePublicIPConfigwithVM(omi, region string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_Pbip" { security_group_name = "sg_data_ip" diff --git a/outscale/data_source_outscale_public_ips.go b/outscale/data_source_outscale_public_ips.go index c96f99f71..5478f1256 100644 --- a/outscale/data_source_outscale_public_ips.go +++ b/outscale/data_source_outscale_public_ips.go @@ -76,7 +76,7 @@ func dataSourceOutscalePublicIPSRead(d *schema.ResourceData, meta interface{}) e filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPIDataSourcePublicIpsFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleDataSourcePublicIpsFilters(filters.(*schema.Set)) } var resp oscgo.ReadPublicIpsResponse diff --git a/outscale/data_source_outscale_public_ips_test.go b/outscale/data_source_outscale_public_ips_test.go index ed34a98e0..ca56910a1 100644 --- a/outscale/data_source_outscale_public_ips_test.go +++ b/outscale/data_source_outscale_public_ips_test.go @@ -14,7 +14,7 @@ func TestAccOthers_DataSourcePublicIPS(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIPublicIPSConfig, + Config: testAccDataSourceOutscalePublicIPSConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet( "data.outscale_public_ips.by_public_ips", "public_ips.0.public_ip"), @@ -36,7 +36,7 @@ func TestAccOthers_DataSourcePublicIPS_withTags(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIPublicIPSConfigWithTags, + Config: testAccDataSourceOutscalePublicIPSConfigWithTags, }, }, }) @@ -45,7 +45,7 @@ func TestAccOthers_DataSourcePublicIPS_withTags(t *testing.T) { } } -const testAccDataSourceOutscaleOAPIPublicIPSConfig = ` +const testAccDataSourceOutscalePublicIPSConfig = ` resource "outscale_public_ip" "test" {} resource "outscale_public_ip" "test1" {} resource "outscale_public_ip" "test2" {} @@ -58,7 +58,7 @@ const testAccDataSourceOutscaleOAPIPublicIPSConfig = ` } ` -const testAccDataSourceOutscaleOAPIPublicIPSConfigWithTags = ` +const testAccDataSourceOutscalePublicIPSConfigWithTags = ` resource "outscale_public_ip" "outscale_public_ip" { tags { key = "name" diff --git a/outscale/data_source_outscale_quota.go b/outscale/data_source_outscale_quota.go index 4509dae9c..80909b06e 100644 --- a/outscale/data_source_outscale_quota.go +++ b/outscale/data_source_outscale_quota.go @@ -65,7 +65,7 @@ func DataSourceOutscaleQuotaRead(d *schema.ResourceData, meta interface{}) error filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPIQuotaDataSourceFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleQuotaDataSourceFilters(filters.(*schema.Set)) } var resp oscgo.ReadQuotasResponse diff --git a/outscale/data_source_outscale_quotas.go b/outscale/data_source_outscale_quotas.go index c968ed44b..b9c29fa4e 100644 --- a/outscale/data_source_outscale_quotas.go +++ b/outscale/data_source_outscale_quotas.go @@ -75,7 +75,7 @@ func DataSourceOutscaleQuotasRead(d *schema.ResourceData, meta interface{}) erro filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPIQuotaDataSourceFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleQuotaDataSourceFilters(filters.(*schema.Set)) } var resp oscgo.ReadQuotasResponse @@ -143,7 +143,7 @@ func DataSourceOutscaleQuotasRead(d *schema.ResourceData, meta interface{}) erro return nil } -func buildOutscaleOAPIQuotaDataSourceFilters(set *schema.Set) *oscgo.FiltersQuota { +func buildOutscaleQuotaDataSourceFilters(set *schema.Set) *oscgo.FiltersQuota { var filters oscgo.FiltersQuota for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_quotas_test.go b/outscale/data_source_outscale_quotas_test.go index eb2143fd5..5b247ad5b 100644 --- a/outscale/data_source_outscale_quotas_test.go +++ b/outscale/data_source_outscale_quotas_test.go @@ -13,13 +13,13 @@ func TestAccOthers_DataSourcesQuotas(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourcesOutscaleOAPIQuotasConfig, + Config: testAccDataSourcesOutscaleQuotasConfig, Check: resource.ComposeTestCheckFunc(), }, }, }) } -const testAccDataSourcesOutscaleOAPIQuotasConfig = ` +const testAccDataSourcesOutscaleQuotasConfig = ` data "outscale_quotas" "all-quotas" {} ` diff --git a/outscale/data_source_outscale_regions_test.go b/outscale/data_source_outscale_regions_test.go index 253f26eb6..787c356c7 100644 --- a/outscale/data_source_outscale_regions_test.go +++ b/outscale/data_source_outscale_regions_test.go @@ -17,16 +17,16 @@ func TestAccOthers_RegionsDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIRegionsDataSourceConfig, + Config: testAccCheckOutscaleRegionsDataSourceConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIRegionsDataSourceID("data.outscale_regions.regions"), + testAccCheckOutscaleRegionsDataSourceID("data.outscale_regions.regions"), ), }, }, }) } -func testAccCheckOutscaleOAPIRegionsDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleRegionsDataSourceID(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -40,6 +40,6 @@ func testAccCheckOutscaleOAPIRegionsDataSourceID(n string) resource.TestCheckFun } } -var testAccCheckOutscaleOAPIRegionsDataSourceConfig = ` +var testAccCheckOutscaleRegionsDataSourceConfig = ` data "outscale_regions" "regions" {} ` diff --git a/outscale/data_source_outscale_route_table.go b/outscale/data_source_outscale_route_table.go index 9efc0e579..3b77ca2cd 100644 --- a/outscale/data_source_outscale_route_table.go +++ b/outscale/data_source_outscale_route_table.go @@ -148,7 +148,7 @@ func DataSourceOutscaleRouteTableRead(d *schema.ResourceData, meta interface{}) } if filterOk { - params.Filters = buildOutscaleOAPIDataSourceRouteTableFilters(filter.(*schema.Set)) + params.Filters = buildOutscaleDataSourceRouteTableFilters(filter.(*schema.Set)) } var resp oscgo.ReadRouteTablesResponse @@ -196,7 +196,7 @@ func DataSourceOutscaleRouteTableRead(d *schema.ResourceData, meta interface{}) return d.Set("link_route_tables", setOSCAPILinkRouteTables(rt.GetLinkRouteTables())) } -func buildOutscaleOAPIDataSourceRouteTableFilters(set *schema.Set) *oscgo.FiltersRouteTable { +func buildOutscaleDataSourceRouteTableFilters(set *schema.Set) *oscgo.FiltersRouteTable { var filters oscgo.FiltersRouteTable for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_route_table_test.go b/outscale/data_source_outscale_route_table_test.go index 6af78f189..6783edb3a 100644 --- a/outscale/data_source_outscale_route_table_test.go +++ b/outscale/data_source_outscale_route_table_test.go @@ -14,17 +14,17 @@ func TestAccNet_WithRouteTableDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIRouteTableGroupConfig, + Config: testAccDataSourceOutscaleRouteTableGroupConfig, Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPIRouteTableCheck("data.outscale_route_table.by_filter"), - testAccDataSourceOutscaleOAPIRouteTableCheck("data.outscale_route_table.by_id"), + testAccDataSourceOutscaleRouteTableCheck("data.outscale_route_table.by_filter"), + testAccDataSourceOutscaleRouteTableCheck("data.outscale_route_table.by_id"), ), }, }, }) } -func testAccDataSourceOutscaleOAPIRouteTableCheck(name string) resource.TestCheckFunc { +func testAccDataSourceOutscaleRouteTableCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] @@ -83,7 +83,7 @@ func testAccDataSourceOutscaleOAPIRouteTableCheck(name string) resource.TestChec } } -const testAccDataSourceOutscaleOAPIRouteTableGroupConfig = ` +const testAccDataSourceOutscaleRouteTableGroupConfig = ` resource "outscale_net" "test" { ip_range = "172.16.0.0/16" diff --git a/outscale/data_source_outscale_route_tables.go b/outscale/data_source_outscale_route_tables.go index be67978e6..3889dae92 100644 --- a/outscale/data_source_outscale_route_tables.go +++ b/outscale/data_source_outscale_route_tables.go @@ -164,7 +164,7 @@ func DataSourceOutscaleRouteTablesRead(d *schema.ResourceData, meta interface{}) } if filterOk { - params.Filters = buildOutscaleOAPIDataSourceRouteTableFilters(filter.(*schema.Set)) + params.Filters = buildOutscaleDataSourceRouteTableFilters(filter.(*schema.Set)) } var resp oscgo.ReadRouteTablesResponse diff --git a/outscale/data_source_outscale_route_tables_test.go b/outscale/data_source_outscale_route_tables_test.go index 5a7ade712..569bd7eab 100644 --- a/outscale/data_source_outscale_route_tables_test.go +++ b/outscale/data_source_outscale_route_tables_test.go @@ -13,7 +13,7 @@ func TestAccNet_WithRouteTablesDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIRouteTablesGroupConfig, + Config: testAccDataSourceOutscaleRouteTablesGroupConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.outscale_route_tables.by_filter", "route_tables.#", "1"), resource.TestCheckResourceAttr("data.outscale_route_tables.by_id", "route_tables.#", "1"), @@ -23,7 +23,7 @@ func TestAccNet_WithRouteTablesDataSource_basic(t *testing.T) { }) } -const testAccDataSourceOutscaleOAPIRouteTablesGroupConfig = ` +const testAccDataSourceOutscaleRouteTablesGroupConfig = ` resource "outscale_net" "test" { ip_range = "172.16.0.0/16" diff --git a/outscale/data_source_outscale_security_group.go b/outscale/data_source_outscale_security_group.go index 84d2001c9..0dea77526 100644 --- a/outscale/data_source_outscale_security_group.go +++ b/outscale/data_source_outscale_security_group.go @@ -177,7 +177,7 @@ func DataSourceOutscaleSecurityGroupRead(d *schema.ResourceData, meta interface{ } if filtersOk { - req.SetFilters(buildOutscaleOAPIDataSourceSecurityGroupFilters(filters.(*schema.Set))) + req.SetFilters(buildOutscaleDataSourceSecurityGroupFilters(filters.(*schema.Set))) } var err error @@ -240,7 +240,7 @@ func DataSourceOutscaleSecurityGroupRead(d *schema.ResourceData, meta interface{ return d.Set("outbound_rules", flattenOAPISecurityGroupRule(sg.GetOutboundRules())) } -func buildOutscaleOAPIDataSourceSecurityGroupFilters(set *schema.Set) oscgo.FiltersSecurityGroup { +func buildOutscaleDataSourceSecurityGroupFilters(set *schema.Set) oscgo.FiltersSecurityGroup { var filters oscgo.FiltersSecurityGroup for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_security_group_test.go b/outscale/data_source_outscale_security_group_test.go index 276a58b90..efa1a168f 100644 --- a/outscale/data_source_outscale_security_group_test.go +++ b/outscale/data_source_outscale_security_group_test.go @@ -17,10 +17,10 @@ func TestAccNet_WithSecurityGroupDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPISecurityGroupConfig(rInt), + Config: testAccDataSourceOutscaleSecurityGroupConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPISecurityGroupCheck("data.outscale_security_group.by_id"), - //testAccDataSourceOutscaleOAPISecurityGroupCheck("data.outscale_security_group.by_filter"), + testAccDataSourceOutscaleSecurityGroupCheck("data.outscale_security_group.by_id"), + //testAccDataSourceOutscaleSecurityGroupCheck("data.outscale_security_group.by_filter"), ), }, }, @@ -35,16 +35,16 @@ func TestAccNet_WithSecurityGroupPublic_(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPISecurityGroupPublicConfig(rInt), + Config: testAccDataSourceOutscaleSecurityGroupPublicConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPISecurityGroupCheck("data.outscale_security_group.by_filter_public"), + testAccDataSourceOutscaleSecurityGroupCheck("data.outscale_security_group.by_filter_public"), ), }, }, }) } -func testAccDataSourceOutscaleOAPISecurityGroupCheck(name string) resource.TestCheckFunc { +func testAccDataSourceOutscaleSecurityGroupCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] if !ok { @@ -75,7 +75,7 @@ func testAccDataSourceOutscaleOAPISecurityGroupCheck(name string) resource.TestC } } -func testAccDataSourceOutscaleOAPISecurityGroupConfig(rInt int) string { +func testAccDataSourceOutscaleSecurityGroupConfig(rInt int) string { return fmt.Sprintf(` resource "outscale_net" "vpc" { ip_range = "10.0.0.0/16" @@ -107,7 +107,7 @@ func testAccDataSourceOutscaleOAPISecurityGroupConfig(rInt int) string { #}`, rInt, rInt) } -func testAccDataSourceOutscaleOAPISecurityGroupPublicConfig(rInt int) string { +func testAccDataSourceOutscaleSecurityGroupPublicConfig(rInt int) string { return fmt.Sprintf(` resource "outscale_security_group" "test" { description = "Used in the terraform acceptance tests" diff --git a/outscale/data_source_outscale_security_groups.go b/outscale/data_source_outscale_security_groups.go index 23c79cf2d..8c48651ed 100644 --- a/outscale/data_source_outscale_security_groups.go +++ b/outscale/data_source_outscale_security_groups.go @@ -205,7 +205,7 @@ func DataSourceOutscaleSecurityGroupsRead(d *schema.ResourceData, meta interface } if filtersOk { - req.SetFilters(buildOutscaleOAPIDataSourceSecurityGroupFilters(filters.(*schema.Set))) + req.SetFilters(buildOutscaleDataSourceSecurityGroupFilters(filters.(*schema.Set))) } var err error diff --git a/outscale/data_source_outscale_security_groups_test.go b/outscale/data_source_outscale_security_groups_test.go index 91426df73..f521efcef 100644 --- a/outscale/data_source_outscale_security_groups_test.go +++ b/outscale/data_source_outscale_security_groups_test.go @@ -15,7 +15,7 @@ func TestAccNet_WIthSecurityGroups_DataSource(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPISecurityGroupConfigVPC(rInt), + Config: testAccDataSourceOutscaleSecurityGroupConfigVPC(rInt), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "data.outscale_security_groups.by_id", "security_groups.#", "3"), @@ -27,7 +27,7 @@ func TestAccNet_WIthSecurityGroups_DataSource(t *testing.T) { }) } -func testAccDataSourceOutscaleOAPISecurityGroupConfigVPC(rInt int) string { +func testAccDataSourceOutscaleSecurityGroupConfigVPC(rInt int) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_server_certificate.go b/outscale/data_source_outscale_server_certificate.go index ac57880cc..247036cdb 100644 --- a/outscale/data_source_outscale_server_certificate.go +++ b/outscale/data_source_outscale_server_certificate.go @@ -13,9 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func datasourceOutscaleOAPIServerCertificate() *schema.Resource { +func datasourceOutscaleServerCertificate() *schema.Resource { return &schema.Resource{ - Read: datasourceOutscaleOAPIServerCertificateRead, + Read: datasourceOutscaleServerCertificateRead, Schema: map[string]*schema.Schema{ "filter": dataSourceFiltersSchema(), "expiration_date": { @@ -46,7 +46,7 @@ func datasourceOutscaleOAPIServerCertificate() *schema.Resource { } } -func datasourceOutscaleOAPIServerCertificateRead(d *schema.ResourceData, meta interface{}) error { +func datasourceOutscaleServerCertificateRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI filters, filtersOk := d.GetOk("filter") diff --git a/outscale/data_source_outscale_server_certificate_test.go b/outscale/data_source_outscale_server_certificate_test.go index 00e39559b..14b2e9a33 100644 --- a/outscale/data_source_outscale_server_certificate_test.go +++ b/outscale/data_source_outscale_server_certificate_test.go @@ -100,13 +100,13 @@ kbcI5Y2wveEgMqPSRya2OapYGiPeqYhg6JAGPRXtOfOq9IUDcPuc2emnihNpSa8y Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIServerCertificateDatasourceConfig(rName, body, private), + Config: testAccOutscaleServerCertificateDatasourceConfig(rName, body, private), }, }, }) } -func testAccOutscaleOAPIServerCertificateDatasourceConfig(name, body, privateKey string) string { +func testAccOutscaleServerCertificateDatasourceConfig(name, body, privateKey string) string { return fmt.Sprintf(` resource "outscale_server_certificate" "test" { name = %[1]q diff --git a/outscale/data_source_outscale_server_certificates.go b/outscale/data_source_outscale_server_certificates.go index 13791e1a4..403c93dc0 100644 --- a/outscale/data_source_outscale_server_certificates.go +++ b/outscale/data_source_outscale_server_certificates.go @@ -12,9 +12,9 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func datasourceOutscaleOAPIServerCertificates() *schema.Resource { +func datasourceOutscaleServerCertificates() *schema.Resource { return &schema.Resource{ - Read: datasourceOutscaleOAPIServerCertificatesRead, + Read: datasourceOutscaleServerCertificatesRead, Schema: map[string]*schema.Schema{ "filter": dataSourceFiltersSchema(), "server_certificates": { @@ -57,7 +57,7 @@ func datasourceOutscaleOAPIServerCertificates() *schema.Resource { } } -func datasourceOutscaleOAPIServerCertificatesRead(d *schema.ResourceData, meta interface{}) error { +func datasourceOutscaleServerCertificatesRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI filters, filtersOk := d.GetOk("filter") diff --git a/outscale/data_source_outscale_server_certificates_test.go b/outscale/data_source_outscale_server_certificates_test.go index 355f12771..afe42af95 100644 --- a/outscale/data_source_outscale_server_certificates_test.go +++ b/outscale/data_source_outscale_server_certificates_test.go @@ -100,13 +100,13 @@ kbcI5Y2wveEgMqPSRya2OapYGiPeqYhg6JAGPRXtOfOq9IUDcPuc2emnihNpSa8y Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIServerCertificatesDatasourceConfig(rName, body, private), + Config: testAccOutscaleServerCertificatesDatasourceConfig(rName, body, private), }, }, }) } -func testAccOutscaleOAPIServerCertificatesDatasourceConfig(name, body, privateKey string) string { +func testAccOutscaleServerCertificatesDatasourceConfig(name, body, privateKey string) string { return fmt.Sprintf(` resource "outscale_server_certificate" "test" { name = %[1]q diff --git a/outscale/data_source_outscale_snapshot_export_task_test.go b/outscale/data_source_outscale_snapshot_export_task_test.go index d9af73e4a..da5fefadc 100644 --- a/outscale/data_source_outscale_snapshot_export_task_test.go +++ b/outscale/data_source_outscale_snapshot_export_task_test.go @@ -20,7 +20,7 @@ func TestAccOthers_SnapshotExportTaskDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotExportTaskDataSourceConfig(imageName, utils.GetRegion()), + Config: testAccOutscaleSnapshotExportTaskDataSourceConfig(imageName, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleSnapshotExportTaskDataSourceID("data.outscale_snapshot_export_task.export_task"), ), @@ -44,7 +44,7 @@ func testAccCheckOutscaleSnapshotExportTaskDataSourceID(n string) resource.TestC } } -func testAccOutscaleOAPISnapshotExportTaskDataSourceConfig(testName, region string) string { +func testAccOutscaleSnapshotExportTaskDataSourceConfig(testName, region string) string { var stringTemplate = ` resource "outscale_volume" "outscale_volume_snap" { subregion_name = "%[2]sa" diff --git a/outscale/data_source_outscale_snapshot_export_tasks_test.go b/outscale/data_source_outscale_snapshot_export_tasks_test.go index 86a6cc651..8d8ba9e46 100644 --- a/outscale/data_source_outscale_snapshot_export_tasks_test.go +++ b/outscale/data_source_outscale_snapshot_export_tasks_test.go @@ -18,7 +18,7 @@ func TestAccOthers_SnapshotExportTasksDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotExportTasksDataSourceConfig(imageName, utils.GetRegion()), + Config: testAccOutscaleSnapshotExportTasksDataSourceConfig(imageName, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleSnapshotExportTaskDataSourceID("data.outscale_snapshot_export_tasks.export_tasks"), ), @@ -27,7 +27,7 @@ func TestAccOthers_SnapshotExportTasksDataSource_basic(t *testing.T) { }) } -func testAccOutscaleOAPISnapshotExportTasksDataSourceConfig(testName, region string) string { +func testAccOutscaleSnapshotExportTasksDataSourceConfig(testName, region string) string { return fmt.Sprintf(` resource "outscale_volume" "outscale_volume_snap" { subregion_name = "%[2]sa" diff --git a/outscale/data_source_outscale_snapshot_test.go b/outscale/data_source_outscale_snapshot_test.go index c03266cf6..d00144cc0 100644 --- a/outscale/data_source_outscale_snapshot_test.go +++ b/outscale/data_source_outscale_snapshot_test.go @@ -17,9 +17,9 @@ func TestAccOthers_SnapshotDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPISnapshotDataSourceConfig(utils.GetRegion()), + Config: testAccCheckOutscaleSnapshotDataSourceConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISnapshotDataSourceID("data.outscale_snapshot.snapshot"), + testAccCheckOutscaleSnapshotDataSourceID("data.outscale_snapshot.snapshot"), resource.TestCheckResourceAttr("data.outscale_snapshot.snapshot", "volume_size", "1"), ), }, @@ -35,9 +35,9 @@ func TestAccOthers_SnapshotDataSource_multipleFilters(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPISnapshotDataSourceConfigWithMultipleFilters(utils.GetRegion()), + Config: testAccCheckOutscaleSnapshotDataSourceConfigWithMultipleFilters(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISnapshotDataSourceID("data.outscale_snapshot.snapshot"), + testAccCheckOutscaleSnapshotDataSourceID("data.outscale_snapshot.snapshot"), resource.TestCheckResourceAttr("data.outscale_snapshot.snapshot", "volume_size", "10"), ), }, @@ -45,7 +45,7 @@ func TestAccOthers_SnapshotDataSource_multipleFilters(t *testing.T) { }) } -func testAccCheckOutscaleOAPISnapshotDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleSnapshotDataSourceID(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -59,7 +59,7 @@ func testAccCheckOutscaleOAPISnapshotDataSourceID(n string) resource.TestCheckFu } } -func testAccCheckOutscaleOAPISnapshotDataSourceConfig(region string) string { +func testAccCheckOutscaleSnapshotDataSourceConfig(region string) string { return fmt.Sprintf(` resource "outscale_volume" "example" { subregion_name = "%sa" @@ -76,7 +76,7 @@ func testAccCheckOutscaleOAPISnapshotDataSourceConfig(region string) string { `, region) } -func testAccCheckOutscaleOAPISnapshotDataSourceConfigWithMultipleFilters(region string) string { +func testAccCheckOutscaleSnapshotDataSourceConfigWithMultipleFilters(region string) string { return fmt.Sprintf(` resource "outscale_volume" "external1" { subregion_name = "%sa" diff --git a/outscale/data_source_outscale_snapshots_test.go b/outscale/data_source_outscale_snapshots_test.go index afe89ec54..b1ccabdab 100644 --- a/outscale/data_source_outscale_snapshots_test.go +++ b/outscale/data_source_outscale_snapshots_test.go @@ -16,7 +16,7 @@ func TestAccOthers_SnapshotsDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPISnapshotsDataSourceConfig(utils.GetRegion()), + Config: testAccCheckOutscaleSnapshotsDataSourceConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.outscale_snapshots.outscale_snapshots", "snapshots.#", "1"), ), @@ -25,7 +25,7 @@ func TestAccOthers_SnapshotsDataSource_basic(t *testing.T) { }) } -func testAccCheckOutscaleOAPISnapshotsDataSourceConfig(region string) string { +func testAccCheckOutscaleSnapshotsDataSourceConfig(region string) string { return fmt.Sprintf(` resource "outscale_volume" "example" { subregion_name = "%sa" diff --git a/outscale/data_source_outscale_subnet.go b/outscale/data_source_outscale_subnet.go index b2c70922f..3e6aad2ee 100644 --- a/outscale/data_source_outscale_subnet.go +++ b/outscale/data_source_outscale_subnet.go @@ -71,7 +71,7 @@ func DataSourceOutscaleSubnetRead(d *schema.ResourceData, meta interface{}) erro filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPISubnetDataSourceFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleSubnetDataSourceFilters(filters.(*schema.Set)) } var resp oscgo.ReadSubnetsResponse @@ -130,7 +130,7 @@ func DataSourceOutscaleSubnetRead(d *schema.ResourceData, meta interface{}) erro return nil } -func buildOutscaleOAPISubnetDataSourceFilters(set *schema.Set) *oscgo.FiltersSubnet { +func buildOutscaleSubnetDataSourceFilters(set *schema.Set) *oscgo.FiltersSubnet { var filters oscgo.FiltersSubnet for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_subnet_test.go b/outscale/data_source_outscale_subnet_test.go index d72d1f9a0..892e478e4 100644 --- a/outscale/data_source_outscale_subnet_test.go +++ b/outscale/data_source_outscale_subnet_test.go @@ -15,10 +15,10 @@ func TestAccNet_WithSubnet_DataSource(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPISubnetConfig(utils.GetRegion()), + Config: testAccDataSourceOutscaleSubnetConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPISubnetCheck("data.outscale_subnet.by_id"), - testAccDataSourceOutscaleOAPISubnetCheck("data.outscale_subnet.by_filter"), + testAccDataSourceOutscaleSubnetCheck("data.outscale_subnet.by_id"), + testAccDataSourceOutscaleSubnetCheck("data.outscale_subnet.by_filter"), ), }, }, @@ -31,16 +31,16 @@ func TestAccNet_SubnetDataSource_withAvailableIpsCountsFilter(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPISubnetWithAvailableIpsCountsFilter(utils.GetRegion()), + Config: testAccDataSourceOutscaleSubnetWithAvailableIpsCountsFilter(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPISubnetCheck("data.outscale_subnet.by_filter"), + testAccDataSourceOutscaleSubnetCheck("data.outscale_subnet.by_filter"), ), }, }, }) } -func testAccDataSourceOutscaleOAPISubnetCheck(name string) resource.TestCheckFunc { +func testAccDataSourceOutscaleSubnetCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] if !ok { @@ -74,7 +74,7 @@ func testAccDataSourceOutscaleOAPISubnetCheck(name string) resource.TestCheckFun } } -func testAccDataSourceOutscaleOAPISubnetConfig(region string) string { +func testAccDataSourceOutscaleSubnetConfig(region string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" @@ -104,7 +104,7 @@ func testAccDataSourceOutscaleOAPISubnetConfig(region string) string { `, region) } -func testAccDataSourceOutscaleOAPISubnetWithAvailableIpsCountsFilter(region string) string { +func testAccDataSourceOutscaleSubnetWithAvailableIpsCountsFilter(region string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_subnets.go b/outscale/data_source_outscale_subnets.go index 5567b8b9b..dcbd500c5 100644 --- a/outscale/data_source_outscale_subnets.go +++ b/outscale/data_source_outscale_subnets.go @@ -88,7 +88,7 @@ func DataSourceOutscaleSubnetsRead(d *schema.ResourceData, meta interface{}) err filters, filtersOk := d.GetOk("filter") if filtersOk { - req.Filters = buildOutscaleOAPISubnetDataSourceFilters(filters.(*schema.Set)) + req.Filters = buildOutscaleSubnetDataSourceFilters(filters.(*schema.Set)) } var resp oscgo.ReadSubnetsResponse diff --git a/outscale/data_source_outscale_subnets_test.go b/outscale/data_source_outscale_subnets_test.go index bbb19b249..e0557eba7 100644 --- a/outscale/data_source_outscale_subnets_test.go +++ b/outscale/data_source_outscale_subnets_test.go @@ -17,7 +17,7 @@ func TestAccNet_WithSubnetsDataSource(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPISubnetsConfig(rInt, utils.GetRegion()), + Config: testAccDataSourceOutscaleSubnetsConfig(rInt, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.outscale_subnets.by_filter", "subnets.#", "1"), ), @@ -33,13 +33,13 @@ func TestAccNet_Subnets_withAvailableIpsCountsFilter(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPISubnetsWithAvailableIpsCountsFilter(utils.GetRegion()), + Config: testAccDataSourceOutscaleSubnetsWithAvailableIpsCountsFilter(utils.GetRegion()), }, }, }) } -func testAccDataSourceOutscaleOAPISubnetsConfig(rInt int, region string) string { +func testAccDataSourceOutscaleSubnetsConfig(rInt int, region string) string { return fmt.Sprintf(` resource "outscale_net" "net" { ip_range = "10.%[1]d.123.0/24" @@ -70,7 +70,7 @@ func testAccDataSourceOutscaleOAPISubnetsConfig(rInt int, region string) string `, rInt, region) } -func testAccDataSourceOutscaleOAPISubnetsWithAvailableIpsCountsFilter(region string) string { +func testAccDataSourceOutscaleSubnetsWithAvailableIpsCountsFilter(region string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net1" { ip_range = "10.0.0.0/16" diff --git a/outscale/data_source_outscale_subregions.go b/outscale/data_source_outscale_subregions.go index 4f3f471cc..58527f40b 100644 --- a/outscale/data_source_outscale_subregions.go +++ b/outscale/data_source_outscale_subregions.go @@ -58,7 +58,7 @@ func DataSourceOutscaleSubregionsRead(d *schema.ResourceData, meta interface{}) filtersReq := &oscgo.FiltersSubregion{} if filtersOk { - filtersReq = buildOutscaleOAPIDataSourceSubregionsFilters(filters.(*schema.Set)) + filtersReq = buildOutscaleDataSourceSubregionsFilters(filters.(*schema.Set)) } req := oscgo.ReadSubregionsRequest{Filters: filtersReq} @@ -97,7 +97,7 @@ func DataSourceOutscaleSubregionsRead(d *schema.ResourceData, meta interface{}) }) } -func buildOutscaleOAPIDataSourceSubregionsFilters(set *schema.Set) *oscgo.FiltersSubregion { +func buildOutscaleDataSourceSubregionsFilters(set *schema.Set) *oscgo.FiltersSubregion { filters := &oscgo.FiltersSubregion{} for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_subregions_test.go b/outscale/data_source_outscale_subregions_test.go index 35230071b..9f99dd09b 100644 --- a/outscale/data_source_outscale_subregions_test.go +++ b/outscale/data_source_outscale_subregions_test.go @@ -19,9 +19,9 @@ func TestAccOthers_SubregionsDataSource_Basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPISubregionsDataSourceConfig(utils.GetRegion()), + Config: testAccCheckOutscaleSubregionsDataSourceConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISubregionsDataSourceID("data.outscale_subregions.test"), + testAccCheckOutscaleSubregionsDataSourceID("data.outscale_subregions.test"), ), }, }, @@ -37,16 +37,16 @@ func TestAccOthers_SubregionsDataSource_All(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPISubregionsDataSourceConfigAll, + Config: testAccCheckOutscaleSubregionsDataSourceConfigAll, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISubregionsDataSourceID("data.outscale_subregions.test"), + testAccCheckOutscaleSubregionsDataSourceID("data.outscale_subregions.test"), ), }, }, }) } -func testAccCheckOutscaleOAPISubregionsDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleSubregionsDataSourceID(n string) resource.TestCheckFunc { // Wait for IAM role return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -61,7 +61,7 @@ func testAccCheckOutscaleOAPISubregionsDataSourceID(n string) resource.TestCheck } } -func testAccCheckOutscaleOAPISubregionsDataSourceConfig(subregionName string) string { +func testAccCheckOutscaleSubregionsDataSourceConfig(subregionName string) string { return fmt.Sprintf(` data "outscale_subregions" "test" { filter { @@ -76,7 +76,7 @@ func testAccCheckOutscaleOAPISubregionsDataSourceConfig(subregionName string) st `, subregionName) } -var testAccCheckOutscaleOAPISubregionsDataSourceConfigAll = ` +var testAccCheckOutscaleSubregionsDataSourceConfigAll = ` data "outscale_subregions" "test" { } ` diff --git a/outscale/data_source_outscale_tags_test.go b/outscale/data_source_outscale_tags_test.go index 2f378531e..a34cde759 100644 --- a/outscale/data_source_outscale_tags_test.go +++ b/outscale/data_source_outscale_tags_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccOutscaleOAPITagsDataSource_basic(t *testing.T) { +func TestAccOutscaleTagsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, diff --git a/outscale/data_source_outscale_virtual_gateway_test.go b/outscale/data_source_outscale_virtual_gateway_test.go index fca3d915f..681e9f6d5 100644 --- a/outscale/data_source_outscale_virtual_gateway_test.go +++ b/outscale/data_source_outscale_virtual_gateway_test.go @@ -20,7 +20,7 @@ func TestAccOthers_DataSourceVirtualGateway_unattached(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIVirtualGatewayUnattachedConfig(rInt), + Config: testAccDataSourceOutscaleVirtualGatewayUnattachedConfig(rInt), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair( "data.outscale_virtual_gateway.test_by_id", "id", @@ -33,7 +33,7 @@ func TestAccOthers_DataSourceVirtualGateway_unattached(t *testing.T) { }) } -func testAccDataSourceOutscaleOAPIVirtualGatewayUnattachedConfig(rInt int) string { +func testAccDataSourceOutscaleVirtualGatewayUnattachedConfig(rInt int) string { return fmt.Sprintf(` resource "outscale_virtual_gateway" "unattached" { connection_type = "ipsec.1" diff --git a/outscale/data_source_outscale_virtual_gateways_test.go b/outscale/data_source_outscale_virtual_gateways_test.go index 5b5f386e1..bb78b7792 100644 --- a/outscale/data_source_outscale_virtual_gateways_test.go +++ b/outscale/data_source_outscale_virtual_gateways_test.go @@ -20,13 +20,13 @@ func TestAccOthers_DataSourceVpnGateways_unattached(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIVpnGatewaysUnattachedConfig(rInt), + Config: testAccDataSourceOutscaleVpnGatewaysUnattachedConfig(rInt), }, }, }) } -func testAccDataSourceOutscaleOAPIVpnGatewaysUnattachedConfig(rInt int) string { +func testAccDataSourceOutscaleVpnGatewaysUnattachedConfig(rInt int) string { return fmt.Sprintf(` resource "outscale_virtual_gateway" "unattached" { connection_type = "ipsec.1" diff --git a/outscale/data_source_outscale_vm.go b/outscale/data_source_outscale_vm.go index f5c8188d8..ec816123f 100644 --- a/outscale/data_source_outscale_vm.go +++ b/outscale/data_source_outscale_vm.go @@ -33,7 +33,7 @@ func DataSourceOutscaleVMRead(d *schema.ResourceData, meta interface{}) error { // Build up search parameters params := oscgo.ReadVmsRequest{} if filtersOk { - params.Filters, err = buildOutscaleOAPIDataSourceVMFilters(filters.(*schema.Set)) + params.Filters, err = buildOutscaleDataSourceVMFilters(filters.(*schema.Set)) if err != nil { return err } @@ -270,7 +270,7 @@ func getDataSourceOAPIVMSchemas() map[string]*schema.Schema { return wholeSchema } -func buildOutscaleOAPIDataSourceVMFilters(set *schema.Set) (*oscgo.FiltersVm, error) { +func buildOutscaleDataSourceVMFilters(set *schema.Set) (*oscgo.FiltersVm, error) { filters := new(oscgo.FiltersVm) for _, v := range set.List() { diff --git a/outscale/data_source_outscale_vm_state.go b/outscale/data_source_outscale_vm_state.go index a40e17def..b9b053973 100644 --- a/outscale/data_source_outscale_vm_state.go +++ b/outscale/data_source_outscale_vm_state.go @@ -96,7 +96,7 @@ func DataSourceOutscaleVMStateRead(d *schema.ResourceData, meta interface{}) err params := oscgo.ReadVmsStateRequest{} if filtersOk { - params.SetFilters(buildOutscaleOAPIDataSourceVMStateFilters(filters.(*schema.Set))) + params.SetFilters(buildOutscaleDataSourceVMStateFilters(filters.(*schema.Set))) } if instanceIDOk { filter := oscgo.FiltersVmsState{} @@ -178,7 +178,7 @@ func statusSetOAPIVMState(status []oscgo.MaintenanceEvent) []map[string]interfac return s } -func buildOutscaleOAPIDataSourceVMStateFilters(set *schema.Set) oscgo.FiltersVmsState { +func buildOutscaleDataSourceVMStateFilters(set *schema.Set) oscgo.FiltersVmsState { var filters oscgo.FiltersVmsState for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_vm_state_test.go b/outscale/data_source_outscale_vm_state_test.go index f422d7f6e..f924dfe90 100644 --- a/outscale/data_source_outscale_vm_state_test.go +++ b/outscale/data_source_outscale_vm_state_test.go @@ -18,16 +18,16 @@ func TestAccVM_StateDataSource(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIVmStateConfig(omi, "tinav4.c2r2p2"), + Config: testAccDataSourceOutscaleVmStateConfig(omi, "tinav4.c2r2p2"), Check: resource.ComposeTestCheckFunc( - testAccDataSourceOutscaleOAPIVMStateCheck("data.outscale_vm_state.state"), + testAccDataSourceOutscaleVMStateCheck("data.outscale_vm_state.state"), ), }, }, }) } -func testAccDataSourceOutscaleOAPIVMStateCheck(name string) resource.TestCheckFunc { +func testAccDataSourceOutscaleVMStateCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] @@ -53,7 +53,7 @@ func testAccDataSourceOutscaleOAPIVMStateCheck(name string) resource.TestCheckFu } } -func testAccDataSourceOutscaleOAPIVmStateConfig(omi, vmType string) string { +func testAccDataSourceOutscaleVmStateConfig(omi, vmType string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_vm_state" { security_group_name = "sg_vmState" diff --git a/outscale/data_source_outscale_vm_states.go b/outscale/data_source_outscale_vm_states.go index 8fc2e79ab..ac781d368 100644 --- a/outscale/data_source_outscale_vm_states.go +++ b/outscale/data_source_outscale_vm_states.go @@ -61,7 +61,7 @@ func DataSourceOutscaleVMStatesRead(d *schema.ResourceData, meta interface{}) er params := oscgo.ReadVmsStateRequest{} if filtersOk { - params.SetFilters(buildOutscaleOAPIDataSourceVMStateFilters(filters.(*schema.Set))) + params.SetFilters(buildOutscaleDataSourceVMStateFilters(filters.(*schema.Set))) } if instanceIdsOk { filter := oscgo.FiltersVmsState{} diff --git a/outscale/data_source_outscale_vm_states_test.go b/outscale/data_source_outscale_vm_states_test.go index 641b59f66..1bc664da4 100644 --- a/outscale/data_source_outscale_vm_states_test.go +++ b/outscale/data_source_outscale_vm_states_test.go @@ -17,13 +17,13 @@ func TestAccVM_StatesDataSource(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIVMStatesConfig(omi, "tinav4.c2r2p2"), + Config: testAccDataSourceOutscaleVMStatesConfig(omi, "tinav4.c2r2p2"), }, }, }) } -func testAccDataSourceOutscaleOAPIVMStatesConfig(omi, vmType string) string { +func testAccDataSourceOutscaleVMStatesConfig(omi, vmType string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_vStates" { description = "testAcc Terraform security group" diff --git a/outscale/data_source_outscale_vm_types.go b/outscale/data_source_outscale_vm_types.go index c95645254..37fcaa380 100644 --- a/outscale/data_source_outscale_vm_types.go +++ b/outscale/data_source_outscale_vm_types.go @@ -70,7 +70,7 @@ func DataSourceOutscaleVMTypesRead(d *schema.ResourceData, meta interface{}) err filtersReq := oscgo.FiltersVmType{} if filterOk { - filtersReq = buildOutscaleOAPIDataSourceVMTypesFilters(filter.(*schema.Set)) + filtersReq = buildOutscaleDataSourceVMTypesFilters(filter.(*schema.Set)) } req := oscgo.ReadVmTypesRequest{Filters: &filtersReq} @@ -151,7 +151,7 @@ func statusDescriptionOAPIVMTypesAttributes(d *schema.ResourceData, fTypes []osc } -func buildOutscaleOAPIDataSourceVMTypesFilters(set *schema.Set) oscgo.FiltersVmType { +func buildOutscaleDataSourceVMTypesFilters(set *schema.Set) oscgo.FiltersVmType { var filters oscgo.FiltersVmType for _, v := range set.List() { m := v.(map[string]interface{}) diff --git a/outscale/data_source_outscale_vm_types_test.go b/outscale/data_source_outscale_vm_types_test.go index 382b23338..328e8c8c5 100644 --- a/outscale/data_source_outscale_vm_types_test.go +++ b/outscale/data_source_outscale_vm_types_test.go @@ -19,13 +19,13 @@ func TestAccVM_TypesDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleOAPIVMTypesConfig(omi, "tinav4.c1r1p1"), + Config: testAccDataSourceOutscaleVMTypesConfig(omi, "tinav4.c1r1p1"), }, }, }) } -func testAccDataSourceOutscaleOAPIVMTypesConfig(omi, vmType string) string { +func testAccDataSourceOutscaleVMTypesConfig(omi, vmType string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_vms_types" { security_group_name = "sg_vm_type" diff --git a/outscale/data_source_outscale_vms.go b/outscale/data_source_outscale_vms.go index b20c5c9b2..9c54b4f03 100644 --- a/outscale/data_source_outscale_vms.go +++ b/outscale/data_source_outscale_vms.go @@ -13,11 +13,11 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func datasourceOutscaleOApiVMS() *schema.Resource { +func datasourceOutscaleVMS() *schema.Resource { return &schema.Resource{ - Read: dataSourceOutscaleOApiVMSRead, + Read: dataSourceOutscaleVMSRead, - Schema: datasourceOutscaleOApiVMSSchema(), + Schema: datasourceOutscaleVMSSchema(), } } @@ -43,7 +43,7 @@ func dataSourceFiltersSchema() *schema.Schema { } } -func datasourceOutscaleOApiVMSSchema() map[string]*schema.Schema { +func datasourceOutscaleVMSSchema() map[string]*schema.Schema { wholeSchema := map[string]*schema.Schema{ "filter": dataSourceFiltersSchema(), "vms": { @@ -62,7 +62,7 @@ func datasourceOutscaleOApiVMSSchema() map[string]*schema.Schema { return wholeSchema } -func dataSourceOutscaleOApiVMSRead(d *schema.ResourceData, meta interface{}) error { +func dataSourceOutscaleVMSRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*OutscaleClient).OSCAPI filters, filtersOk := d.GetOk("filter") @@ -75,7 +75,7 @@ func dataSourceOutscaleOApiVMSRead(d *schema.ResourceData, meta interface{}) err // Build up search parameters params := oscgo.ReadVmsRequest{} if filtersOk { - params.Filters, err = buildOutscaleOAPIDataSourceVMFilters(filters.(*schema.Set)) + params.Filters, err = buildOutscaleDataSourceVMFilters(filters.(*schema.Set)) if err != nil { return err } diff --git a/outscale/data_source_outscale_volume.go b/outscale/data_source_outscale_volume.go index 971237cf0..10820f1b0 100644 --- a/outscale/data_source_outscale_volume.go +++ b/outscale/data_source_outscale_volume.go @@ -15,7 +15,7 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func datasourceOutscaleOAPIVolume() *schema.Resource { +func datasourceOutscaleVolume() *schema.Resource { return &schema.Resource{ Read: datasourceOAPIVolumeRead, diff --git a/outscale/data_source_outscale_volume_test.go b/outscale/data_source_outscale_volume_test.go index ad7698341..b00312f5e 100644 --- a/outscale/data_source_outscale_volume_test.go +++ b/outscale/data_source_outscale_volume_test.go @@ -17,9 +17,9 @@ func TestAccOthers_VolumeDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVolumeDataSourceConfig(utils.GetRegion()), + Config: testAccCheckOutscaleVolumeDataSourceConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVolumeDataSourceID("data.outscale_volume.ebs_volume"), + testAccCheckOutscaleVolumeDataSourceID("data.outscale_volume.ebs_volume"), resource.TestCheckResourceAttr("data.outscale_volume.ebs_volume", "size", "10"), resource.TestCheckResourceAttr("data.outscale_volume.ebs_volume", "volume_type", "standard"), ), @@ -36,9 +36,9 @@ func TestAccOthers_VolumeDataSource_filterByTags(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVolumeDataSourceConfigFilterByTags(utils.GetRegion()), + Config: testAccCheckOutscaleVolumeDataSourceConfigFilterByTags(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVolumeDataSourceID("data.outscale_volume.ebs_volume"), + testAccCheckOutscaleVolumeDataSourceID("data.outscale_volume.ebs_volume"), resource.TestCheckResourceAttr("data.outscale_volume.ebs_volume", "size", "10"), resource.TestCheckResourceAttr("data.outscale_volume.ebs_volume", "volume_type", "standard"), ), @@ -47,7 +47,7 @@ func TestAccOthers_VolumeDataSource_filterByTags(t *testing.T) { }) } -func testAccCheckOutscaleOAPIVolumeDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckOutscaleVolumeDataSourceID(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -61,7 +61,7 @@ func testAccCheckOutscaleOAPIVolumeDataSourceID(n string) resource.TestCheckFunc } } -func testAccCheckOutscaleOAPIVolumeDataSourceConfig(region string) string { +func testAccCheckOutscaleVolumeDataSourceConfig(region string) string { return fmt.Sprintf(` resource "outscale_volume" "example" { subregion_name = "%sa" @@ -83,7 +83,7 @@ func testAccCheckOutscaleOAPIVolumeDataSourceConfig(region string) string { `, region) } -func testAccCheckOutscaleOAPIVolumeDataSourceConfigFilterByTags(region string) string { +func testAccCheckOutscaleVolumeDataSourceConfigFilterByTags(region string) string { return fmt.Sprintf(` resource "outscale_volume" "example" { subregion_name = "%sa" diff --git a/outscale/data_source_outscale_volumes.go b/outscale/data_source_outscale_volumes.go index 018246ab9..12afc7018 100644 --- a/outscale/data_source_outscale_volumes.go +++ b/outscale/data_source_outscale_volumes.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func datasourceOutscaleOAPIVolumes() *schema.Resource { +func datasourceOutscaleVolumes() *schema.Resource { return &schema.Resource{ Read: datasourceOAPIVolumesRead, diff --git a/outscale/data_source_outscale_volumes_test.go b/outscale/data_source_outscale_volumes_test.go index dc684f528..7806ce8e5 100644 --- a/outscale/data_source_outscale_volumes_test.go +++ b/outscale/data_source_outscale_volumes_test.go @@ -17,9 +17,9 @@ func TestAccOthers_VolumesDataSource_multipleFilters(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVolumeDataSourceConfigWithMultipleFilters(utils.GetRegion()), + Config: testAccCheckOutscaleVolumeDataSourceConfigWithMultipleFilters(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVolumeDataSourceID("data.outscale_volumes.ebs_volume"), + testAccCheckOutscaleVolumeDataSourceID("data.outscale_volumes.ebs_volume"), resource.TestCheckResourceAttr("data.outscale_volumes.ebs_volume", "volumes.0.size", "1"), resource.TestCheckResourceAttr("data.outscale_volumes.ebs_volume", "volumes.0.volume_type", "standard"), ), @@ -36,9 +36,9 @@ func TestAccOthers_VolumeDataSource_multipleVIdsFilters(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVolumesDataSourceConfigWithMultipleVolumeIDsFilter(utils.GetRegion()), + Config: testAccCheckOutscaleVolumesDataSourceConfigWithMultipleVolumeIDsFilter(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVolumeDataSourceID("data.outscale_volumes.outscale_volumes"), + testAccCheckOutscaleVolumeDataSourceID("data.outscale_volumes.outscale_volumes"), resource.TestCheckResourceAttr("data.outscale_volumes.outscale_volumes", "volumes.0.size", "40"), ), }, @@ -56,9 +56,9 @@ func TestAccVM_withVolumesDataSource(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVolumesDataSourceConfigWithVM(utils.GetRegion(), omi, keypair), + Config: testAccCheckOutscaleVolumesDataSourceConfigWithVM(utils.GetRegion(), omi, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVolumeDataSourceID("data.outscale_volumes.outscale_volumes"), + testAccCheckOutscaleVolumeDataSourceID("data.outscale_volumes.outscale_volumes"), // resource.TestCheckResourceAttr("data.outscale_volumes.outscale_volumes", "volumes.0.size", "1"), // resource.TestCheckResourceAttr("data.outscale_volumes.outscale_volumes", "volumes.0.volume_type", "standard"), ), @@ -67,7 +67,7 @@ func TestAccVM_withVolumesDataSource(t *testing.T) { }) } -func testAccCheckOutscaleOAPIVolumeDataSourceConfigWithMultipleFilters(region string) string { +func testAccCheckOutscaleVolumeDataSourceConfigWithMultipleFilters(region string) string { return fmt.Sprintf(` resource "outscale_volume" "external" { subregion_name = "%sa" @@ -94,7 +94,7 @@ func testAccCheckOutscaleOAPIVolumeDataSourceConfigWithMultipleFilters(region st `, region) } -func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithMultipleVolumeIDsFilter(region string) string { +func testAccCheckOutscaleVolumesDataSourceConfigWithMultipleVolumeIDsFilter(region string) string { return fmt.Sprintf(` resource "outscale_volume" "outscale_volume" { subregion_name = "%[1]sa" @@ -115,7 +115,7 @@ func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithMultipleVolumeIDsFilter( `, region) } -func testAccCheckOutscaleOAPIVolumesDataSourceConfigWithVM(region, imageID, keypair string) string { +func testAccCheckOutscaleVolumesDataSourceConfigWithVM(region, imageID, keypair string) string { return fmt.Sprintf(` resource "outscale_volume" "outscale_volume" { subregion_name = "%[1]sa" diff --git a/outscale/data_source_quota.go b/outscale/data_source_quota.go index 5b07ad385..66f9ad61d 100644 --- a/outscale/data_source_quota.go +++ b/outscale/data_source_quota.go @@ -145,7 +145,7 @@ func (d *dataSourceQuota) Read(ctx context.Context, req datasource.ReadRequest, if err != nil { goto CHECK_ERR } - filters, err = buildOutscaleQuotaDataSourceFilters(listFilters) + filters, err = buildOutscaleQuotaDataSourceFrameworkFilters(listFilters) if err != nil { goto CHECK_ERR } @@ -222,7 +222,7 @@ CHECK_ERR: } } -func buildOutscaleQuotaDataSourceFilters(listFilters []tftypes.Value) (*oscgo.FiltersQuota, error) { +func buildOutscaleQuotaDataSourceFrameworkFilters(listFilters []tftypes.Value) (*oscgo.FiltersQuota, error) { var filters oscgo.FiltersQuota for _, val := range listFilters { diff --git a/outscale/data_source_quota_test.go b/outscale/data_source_quota_test.go index da0e16251..a097780b1 100644 --- a/outscale/data_source_quota_test.go +++ b/outscale/data_source_quota_test.go @@ -20,14 +20,14 @@ func TestAccFwOthers_DataSourceQuota(t *testing.T) { PreCheck: func() { TestAccFwPreCheck(t) }, Steps: []resource.TestStep{ { - Config: testAccFwDataSourceOutscaleOAPIQuotaConfig, + Config: testAccFwDataSourceOutscaleQuotaConfig, Check: resource.ComposeTestCheckFunc(), }, }, }) } -const testAccFwDataSourceOutscaleOAPIQuotaConfig = ` +const testAccFwDataSourceOutscaleQuotaConfig = ` data "outscale_quota" "lbuQuota1" { filter { name = "quota_names" diff --git a/outscale/framework_provider_test.go b/outscale/framework_provider_test.go index 8c7063ef9..31250c838 100644 --- a/outscale/framework_provider_test.go +++ b/outscale/framework_provider_test.go @@ -48,7 +48,7 @@ func TestMuxServer(t *testing.T) { }, Steps: []resource.TestStep{ { - Config: fwtestAccDataSourceOutscaleOAPIQuotaConfig, + Config: fwtestAccDataSourceOutscaleQuotaConfig, }, }, }) @@ -64,7 +64,7 @@ func TestDataSource_UpgradeFromVersion(t *testing.T) { Source: "outscale/outscale", }, }, - Config: fwtestAccDataSourceOutscaleOAPIQuotaConfig, + Config: fwtestAccDataSourceOutscaleQuotaConfig, }, { ProtoV5ProviderFactories: map[string]func() (tfprotov5.ProviderServer, error){ @@ -83,14 +83,14 @@ func TestDataSource_UpgradeFromVersion(t *testing.T) { return muxServer.ProviderServer(), nil }, }, - Config: fwtestAccDataSourceOutscaleOAPIQuotaConfig, + Config: fwtestAccDataSourceOutscaleQuotaConfig, PlanOnly: true, }, }, }) } -const fwtestAccDataSourceOutscaleOAPIQuotaConfig = ` +const fwtestAccDataSourceOutscaleQuotaConfig = ` data "outscale_quota" "lbuquota1" { filter { name = "quota_names" diff --git a/outscale/import_outscale_net_attributes_test.go b/outscale/import_outscale_net_attributes_test.go index a6b5333be..2f69aa6f2 100644 --- a/outscale/import_outscale_net_attributes_test.go +++ b/outscale/import_outscale_net_attributes_test.go @@ -15,7 +15,7 @@ func TestAccNet_Attr_import(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILinAttrConfig, + Config: testAccOutscaleLinAttrConfig, }, { ResourceName: resourceName, diff --git a/outscale/provider.go b/outscale/provider.go index 48709ad06..e799fdb69 100644 --- a/outscale/provider.go +++ b/outscale/provider.go @@ -52,61 +52,61 @@ func Provider() *schema.Provider { }, ResourcesMap: map[string]*schema.Resource{ - "outscale_vm": ResourceOutscaleOApiVM(), - "outscale_keypair": ResourceOutscaleOAPIKeyPair(), - "outscale_image": ResourceOutscaleOAPIImage(), - "outscale_internet_service_link": ResourceOutscaleOAPIInternetServiceLink(), - "outscale_internet_service": ResourceOutscaleOAPIInternetService(), - "outscale_net": ResourceOutscaleOAPINet(), - "outscale_security_group": ResourceOutscaleOAPISecurityGroup(), - "outscale_outbound_rule": ResourceOutscaleOAPIOutboundRule(), - "outscale_security_group_rule": ResourceOutscaleOAPIOutboundRule(), - "outscale_tag": ResourceOutscaleOAPITags(), - "outscale_public_ip": ResourceOutscaleOAPIPublicIP(), - "outscale_public_ip_link": ResourceOutscaleOAPIPublicIPLink(), - "outscale_volume": ResourceOutscaleOAPIVolume(), - "outscale_volumes_link": ResourceOutscaleOAPIVolumeLink(), - "outscale_net_attributes": ResourceOutscaleOAPILinAttributes(), - "outscale_nat_service": ResourceOutscaleOAPINatService(), - "outscale_subnet": ResourceOutscaleOAPISubNet(), - "outscale_route": ResourceOutscaleOAPIRoute(), - "outscale_route_table": ResourceOutscaleOAPIRouteTable(), - "outscale_route_table_link": ResourceOutscaleOAPILinkRouteTable(), - "outscale_nic": ResourceOutscaleOAPINic(), - "outscale_snapshot": ResourceOutscaleOAPISnapshot(), - "outscale_image_launch_permission": ResourceOutscaleOAPIImageLaunchPermission(), - "outscale_net_peering": ResourceOutscaleOAPILinPeeringConnection(), - "outscale_net_peering_acceptation": ResourceOutscaleOAPILinPeeringConnectionAccepter(), + "outscale_vm": ResourceOutscaleVM(), + "outscale_keypair": ResourceOutscaleKeyPair(), + "outscale_image": ResourceOutscaleImage(), + "outscale_internet_service_link": ResourceOutscaleInternetServiceLink(), + "outscale_internet_service": ResourceOutscaleInternetService(), + "outscale_net": ResourceOutscaleNet(), + "outscale_security_group": ResourceOutscaleSecurityGroup(), + "outscale_outbound_rule": ResourceOutscaleOutboundRule(), + "outscale_security_group_rule": ResourceOutscaleOutboundRule(), + "outscale_tag": ResourceOutscaleTags(), + "outscale_public_ip": ResourceOutscalePublicIP(), + "outscale_public_ip_link": ResourceOutscalePublicIPLink(), + "outscale_volume": ResourceOutscaleVolume(), + "outscale_volumes_link": ResourceOutscaleVolumeLink(), + "outscale_net_attributes": ResourceOutscaleLinAttributes(), + "outscale_nat_service": ResourceOutscaleNatService(), + "outscale_subnet": ResourceOutscaleSubNet(), + "outscale_route": ResourceOutscaleRoute(), + "outscale_route_table": ResourceOutscaleRouteTable(), + "outscale_route_table_link": ResourceOutscaleLinkRouteTable(), + "outscale_nic": ResourceOutscaleNic(), + "outscale_snapshot": ResourceOutscaleSnapshot(), + "outscale_image_launch_permission": ResourceOutscaleImageLaunchPermission(), + "outscale_net_peering": ResourceOutscaleLinPeeringConnection(), + "outscale_net_peering_acceptation": ResourceOutscaleLinPeeringConnectionAccepter(), "outscale_net_access_point": ResourceOutscaleNetAccessPoint(), - "outscale_nic_link": ResourceOutscaleOAPINetworkInterfaceAttachment(), - "outscale_nic_private_ip": ResourceOutscaleOAPINetworkInterfacePrivateIP(), - "outscale_snapshot_attributes": resourcedOutscaleOAPISnapshotAttributes(), + "outscale_nic_link": ResourceOutscaleNetworkInterfaceAttachment(), + "outscale_nic_private_ip": ResourceOutscaleNetworkInterfacePrivateIP(), + "outscale_snapshot_attributes": resourcedOutscaleSnapshotAttributes(), "outscale_dhcp_option": ResourceOutscaleDHCPOption(), "outscale_client_gateway": ResourceOutscaleClientGateway(), - "outscale_virtual_gateway": ResourceOutscaleOAPIVirtualGateway(), - "outscale_virtual_gateway_link": ResourceOutscaleOAPIVirtualGatewayLink(), - "outscale_virtual_gateway_route_propagation": ResourceOutscaleOAPIVirtualGatewayRoutePropagation(), + "outscale_virtual_gateway": ResourceOutscaleVirtualGateway(), + "outscale_virtual_gateway_link": ResourceOutscaleVirtualGatewayLink(), + "outscale_virtual_gateway_route_propagation": ResourceOutscaleVirtualGatewayRoutePropagation(), "outscale_vpn_connection": ResourceOutscaleVPNConnection(), "outscale_vpn_connection_route": ResourceOutscaleVPNConnectionRoute(), "outscale_access_key": ResourceOutscaleAccessKey(), - "outscale_load_balancer": ResourceOutscaleOAPILoadBalancer(), + "outscale_load_balancer": ResourceOutscaleLoadBalancer(), "outscale_load_balancer_policy": ResourceOutscaleAppCookieStickinessPolicy(), "outscale_load_balancer_vms": resourceLBUAttachment(), - "outscale_load_balancer_attributes": ResourceOutscaleOAPILoadBalancerAttributes(), + "outscale_load_balancer_attributes": ResourceOutscaleLoadBalancerAttributes(), "outscale_load_balancer_listener_rule": ResourceOutscaleLoadBalancerListenerRule(), - "outscale_flexible_gpu": ResourceOutscaleOAPIFlexibleGpu(), - "outscale_flexible_gpu_link": ResourceOutscaleOAPIFlexibleGpuLink(), - "outscale_image_export_task": ResourceOutscaleOAPIIMageExportTask(), - "outscale_server_certificate": ResourceOutscaleOAPIServerCertificate(), - "outscale_snapshot_export_task": ResourceOutscaleOAPISnapshotExportTask(), - "outscale_ca": ResourceOutscaleOAPICa(), - "outscale_api_access_rule": ResourceOutscaleOAPIApiAccessRule(), - "outscale_api_access_policy": ResourceOutscaleOAPIApiAccessPolicy(), + "outscale_flexible_gpu": ResourceOutscaleFlexibleGpu(), + "outscale_flexible_gpu_link": ResourceOutscaleFlexibleGpuLink(), + "outscale_image_export_task": ResourceOutscaleIMageExportTask(), + "outscale_server_certificate": ResourceOutscaleServerCertificate(), + "outscale_snapshot_export_task": ResourceOutscaleSnapshotExportTask(), + "outscale_ca": ResourceOutscaleCa(), + "outscale_api_access_rule": ResourceOutscaleApiAccessRule(), + "outscale_api_access_policy": ResourceOutscaleApiAccessPolicy(), "outscale_main_route_table_link": resourceLinkMainRouteTable(), }, DataSourcesMap: map[string]*schema.Resource{ "outscale_vm": DataSourceOutscaleVM(), - "outscale_vms": datasourceOutscaleOApiVMS(), + "outscale_vms": datasourceOutscaleVMS(), "outscale_security_group": DataSourceOutscaleSecurityGroup(), "outscale_security_groups": DataSourceOutscaleSecurityGroups(), "outscale_image": DataSourceOutscaleImage(), @@ -115,16 +115,16 @@ func Provider() *schema.Provider { "outscale_tags": DataSourceOutscaleTags(), "outscale_public_ip": DataSourceOutscalePublicIP(), "outscale_public_ips": DataSourceOutscalePublicIPS(), - "outscale_volume": datasourceOutscaleOAPIVolume(), - "outscale_volumes": datasourceOutscaleOAPIVolumes(), + "outscale_volume": datasourceOutscaleVolume(), + "outscale_volumes": datasourceOutscaleVolumes(), "outscale_nat_service": DataSourceOutscaleNatService(), "outscale_nat_services": DataSourceOutscaleNatServices(), - "outscale_keypair": datasourceOutscaleOAPIKeyPair(), - "outscale_keypairs": datasourceOutscaleOAPIKeyPairs(), + "outscale_keypair": datasourceOutscaleKeyPair(), + "outscale_keypairs": datasourceOutscaleKeyPairs(), "outscale_vm_state": DataSourceOutscaleVMState(), "outscale_vm_states": DataSourceOutscaleVMStates(), - "outscale_internet_service": datasourceOutscaleOAPIInternetService(), - "outscale_internet_services": datasourceOutscaleOAPIInternetServices(), + "outscale_internet_service": datasourceOutscaleInternetService(), + "outscale_internet_services": datasourceOutscaleInternetServices(), "outscale_subnet": DataSourceOutscaleSubnet(), "outscale_subnets": DataSourceOutscaleSubnets(), "outscale_net": DataSourceOutscaleVpc(), @@ -168,8 +168,8 @@ func Provider() *schema.Provider { "outscale_quotas": DataSourceOutscaleQuotas(), "outscale_image_export_task": DataSourceOutscaleImageExportTask(), "outscale_image_export_tasks": DataSourceOutscaleImageExportTasks(), - "outscale_server_certificate": datasourceOutscaleOAPIServerCertificate(), - "outscale_server_certificates": datasourceOutscaleOAPIServerCertificates(), + "outscale_server_certificate": datasourceOutscaleServerCertificate(), + "outscale_server_certificates": datasourceOutscaleServerCertificates(), "outscale_snapshot_export_task": DataSourceOutscaleSnapshotExportTask(), "outscale_snapshot_export_tasks": DataSourceOutscaleSnapshotExportTasks(), "outscale_ca": DataSourceOutscaleCa(), diff --git a/outscale/resource_outscale_api_access_policy.go b/outscale/resource_outscale_api_access_policy.go index b3d8a9747..114452b7a 100644 --- a/outscale/resource_outscale_api_access_policy.go +++ b/outscale/resource_outscale_api_access_policy.go @@ -11,12 +11,12 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIApiAccessPolicy() *schema.Resource { +func ResourceOutscaleApiAccessPolicy() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIApiAccessPolicyCreate, - Read: ResourceOutscaleOAPIApiAccessPolicyRead, - Update: ResourceOutscaleOAPIApiAccessPolicyUpdate, - Delete: ResourceOutscaleOAPIApiAccessPolicyDelete, + Create: ResourceOutscaleApiAccessPolicyCreate, + Read: ResourceOutscaleApiAccessPolicyRead, + Update: ResourceOutscaleApiAccessPolicyUpdate, + Delete: ResourceOutscaleApiAccessPolicyDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -37,7 +37,7 @@ func ResourceOutscaleOAPIApiAccessPolicy() *schema.Resource { } } -func ResourceOutscaleOAPIApiAccessPolicyCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleApiAccessPolicyCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI maxAcc := d.Get("max_access_key_expiration_seconds") @@ -63,10 +63,10 @@ func ResourceOutscaleOAPIApiAccessPolicyCreate(d *schema.ResourceData, meta inte if err != nil { return err } - return ResourceOutscaleOAPIApiAccessPolicyRead(d, meta) + return ResourceOutscaleApiAccessPolicyRead(d, meta) } -func ResourceOutscaleOAPIApiAccessPolicyRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleApiAccessPolicyRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.ReadApiAccessPolicyRequest{} @@ -102,7 +102,7 @@ func ResourceOutscaleOAPIApiAccessPolicyRead(d *schema.ResourceData, meta interf return nil } -func ResourceOutscaleOAPIApiAccessPolicyUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleApiAccessPolicyUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI _, maxAcc := d.GetChange("max_access_key_expiration_seconds") @@ -128,10 +128,10 @@ func ResourceOutscaleOAPIApiAccessPolicyUpdate(d *schema.ResourceData, meta inte if err != nil { return err } - return ResourceOutscaleOAPIApiAccessPolicyRead(d, meta) + return ResourceOutscaleApiAccessPolicyRead(d, meta) } -func ResourceOutscaleOAPIApiAccessPolicyDelete(d *schema.ResourceData, _ interface{}) error { +func ResourceOutscaleApiAccessPolicyDelete(d *schema.ResourceData, _ interface{}) error { d.SetId("") return nil } diff --git a/outscale/resource_outscale_api_access_rule.go b/outscale/resource_outscale_api_access_rule.go index 8102caddb..4de834b50 100644 --- a/outscale/resource_outscale_api_access_rule.go +++ b/outscale/resource_outscale_api_access_rule.go @@ -12,12 +12,12 @@ import ( "github.com/spf13/cast" ) -func ResourceOutscaleOAPIApiAccessRule() *schema.Resource { +func ResourceOutscaleApiAccessRule() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIApiAccessRuleCreate, - Read: ResourceOutscaleOAPIApiAccessRuleRead, - Update: ResourceOutscaleOAPIApiAccessRuleUpdate, - Delete: ResourceOutscaleOAPIApiAccessRuleDelete, + Create: ResourceOutscaleApiAccessRuleCreate, + Read: ResourceOutscaleApiAccessRuleRead, + Update: ResourceOutscaleApiAccessRuleUpdate, + Delete: ResourceOutscaleApiAccessRuleDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -53,7 +53,7 @@ func ResourceOutscaleOAPIApiAccessRule() *schema.Resource { } } -func ResourceOutscaleOAPIApiAccessRuleCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleApiAccessRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var checkParam = false req := oscgo.CreateApiAccessRuleRequest{} @@ -92,10 +92,10 @@ func ResourceOutscaleOAPIApiAccessRuleCreate(d *schema.ResourceData, meta interf } d.SetId(cast.ToString(resp.ApiAccessRule.GetApiAccessRuleId())) - return ResourceOutscaleOAPIApiAccessRuleRead(d, meta) + return ResourceOutscaleApiAccessRuleRead(d, meta) } -func ResourceOutscaleOAPIApiAccessRuleRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleApiAccessRuleRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.ReadApiAccessRulesRequest{ @@ -153,7 +153,7 @@ func ResourceOutscaleOAPIApiAccessRuleRead(d *schema.ResourceData, meta interfac return nil } -func ResourceOutscaleOAPIApiAccessRuleUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleApiAccessRuleUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI accRid, isIdOk := d.GetOk("api_access_rule_id") @@ -197,10 +197,10 @@ func ResourceOutscaleOAPIApiAccessRuleUpdate(d *schema.ResourceData, meta interf if err != nil { return err } - return ResourceOutscaleOAPIApiAccessRuleRead(d, meta) + return ResourceOutscaleApiAccessRuleRead(d, meta) } -func ResourceOutscaleOAPIApiAccessRuleDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleApiAccessRuleDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.DeleteApiAccessRuleRequest{ diff --git a/outscale/resource_outscale_api_access_rule_test.go b/outscale/resource_outscale_api_access_rule_test.go index 86516101a..b873bf5dd 100644 --- a/outscale/resource_outscale_api_access_rule_test.go +++ b/outscale/resource_outscale_api_access_rule_test.go @@ -24,7 +24,7 @@ func TestAccOthers_AccessRule_basic(t *testing.T) { CheckDestroy: testAccCheckOutscaleApiAccessRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIApiAccessRuleConfig(ca_path), + Config: testAccOutscaleApiAccessRuleConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleApiAccessRuleExists(resourceName), ), @@ -117,7 +117,7 @@ func testAccCheckOutscaleApiAccessRuleDestroy(s *terraform.State) error { return nil } -func testAccOutscaleOAPIApiAccessRuleConfig(path string) string { +func testAccOutscaleApiAccessRuleConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_rule" { ca_pem = file(%q) diff --git a/outscale/resource_outscale_ca.go b/outscale/resource_outscale_ca.go index 8c398bf3a..8236260c1 100644 --- a/outscale/resource_outscale_ca.go +++ b/outscale/resource_outscale_ca.go @@ -12,12 +12,12 @@ import ( "github.com/spf13/cast" ) -func ResourceOutscaleOAPICa() *schema.Resource { +func ResourceOutscaleCa() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPICaCreate, - Read: ResourceOutscaleOAPICaRead, - Update: ResourceOutscaleOAPICaUpdate, - Delete: ResourceOutscaleOAPICaDelete, + Create: ResourceOutscaleCaCreate, + Read: ResourceOutscaleCaRead, + Update: ResourceOutscaleCaUpdate, + Delete: ResourceOutscaleCaDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -47,7 +47,7 @@ func ResourceOutscaleOAPICa() *schema.Resource { } } -func ResourceOutscaleOAPICaCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleCaCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if _, ok := d.GetOk("ca_pem"); ok == false { @@ -76,10 +76,10 @@ func ResourceOutscaleOAPICaCreate(d *schema.ResourceData, meta interface{}) erro } d.SetId(cast.ToString(resp.Ca.GetCaId())) - return ResourceOutscaleOAPICaRead(d, meta) + return ResourceOutscaleCaRead(d, meta) } -func ResourceOutscaleOAPICaRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleCaRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.ReadCasRequest{ @@ -121,7 +121,7 @@ func ResourceOutscaleOAPICaRead(d *schema.ResourceData, meta interface{}) error return nil } -func ResourceOutscaleOAPICaUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleCaUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.UpdateCaRequest{ @@ -143,10 +143,10 @@ func ResourceOutscaleOAPICaUpdate(d *schema.ResourceData, meta interface{}) erro if err != nil { return err } - return ResourceOutscaleOAPICaRead(d, meta) + return ResourceOutscaleCaRead(d, meta) } -func ResourceOutscaleOAPICaDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleCaDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.DeleteCaRequest{ diff --git a/outscale/resource_outscale_ca_test.go b/outscale/resource_outscale_ca_test.go index 42b443e42..49fe050ba 100644 --- a/outscale/resource_outscale_ca_test.go +++ b/outscale/resource_outscale_ca_test.go @@ -24,13 +24,13 @@ func TestAccOthers_Ca_basic(t *testing.T) { CheckDestroy: testAccCheckOutscaleCaDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPICaConfig(ca_path), + Config: testAccOutscaleCaConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resourceName), ), }, { - Config: testAccOutscaleOAPICaConfigUpdateDescription(ca_path), + Config: testAccOutscaleCaConfigUpdateDescription(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resourceName), ), @@ -122,7 +122,7 @@ func testAccCheckOutscaleCaDestroy(s *terraform.State) error { return nil } -func testAccOutscaleOAPICaConfig(path string) string { +func testAccOutscaleCaConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { ca_pem = file(%q) @@ -130,7 +130,7 @@ resource "outscale_ca" "ca_test" { }`, path) } -func testAccOutscaleOAPICaConfigUpdateDescription(path string) string { +func testAccOutscaleCaConfigUpdateDescription(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { ca_pem = file(%q) diff --git a/outscale/resource_outscale_flexible_gpu.go b/outscale/resource_outscale_flexible_gpu.go index a6064aac2..9c3e73670 100644 --- a/outscale/resource_outscale_flexible_gpu.go +++ b/outscale/resource_outscale_flexible_gpu.go @@ -11,12 +11,12 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIFlexibleGpu() *schema.Resource { +func ResourceOutscaleFlexibleGpu() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIFlexibleGpuCreate, - Read: ResourceOutscaleOAPIFlexibleGpuRead, - Delete: ResourceOutscaleOAPIFlexibleGpuDelete, - Update: ResourceOutscaleOAPIFlexibleGpuUpdate, + Create: ResourceOutscaleFlexibleGpuCreate, + Read: ResourceOutscaleFlexibleGpuRead, + Delete: ResourceOutscaleFlexibleGpuDelete, + Update: ResourceOutscaleFlexibleGpuUpdate, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -64,7 +64,7 @@ func ResourceOutscaleOAPIFlexibleGpu() *schema.Resource { } } -func ResourceOutscaleOAPIFlexibleGpuCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleFlexibleGpuCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := &oscgo.CreateFlexibleGpuRequest{} @@ -102,10 +102,10 @@ func ResourceOutscaleOAPIFlexibleGpuCreate(d *schema.ResourceData, meta interfac d.SetId(resp.FlexibleGpu.GetFlexibleGpuId()) - return ResourceOutscaleOAPIFlexibleGpuRead(d, meta) + return ResourceOutscaleFlexibleGpuRead(d, meta) } -func ResourceOutscaleOAPIFlexibleGpuRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleFlexibleGpuRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI napid := d.Id() @@ -167,7 +167,7 @@ func ResourceOutscaleOAPIFlexibleGpuRead(d *schema.ResourceData, meta interface{ return nil } -func ResourceOutscaleOAPIFlexibleGpuUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleFlexibleGpuUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI v := d.Get("delete_on_vm_deletion") @@ -191,11 +191,11 @@ func ResourceOutscaleOAPIFlexibleGpuUpdate(d *schema.ResourceData, meta interfac if err != nil { return err } - return ResourceOutscaleOAPIFlexibleGpuRead(d, meta) + return ResourceOutscaleFlexibleGpuRead(d, meta) } -func ResourceOutscaleOAPIFlexibleGpuDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleFlexibleGpuDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := &oscgo.DeleteFlexibleGpuRequest{ diff --git a/outscale/resource_outscale_flexible_gpu_link.go b/outscale/resource_outscale_flexible_gpu_link.go index 8c647a124..367c663a8 100644 --- a/outscale/resource_outscale_flexible_gpu_link.go +++ b/outscale/resource_outscale_flexible_gpu_link.go @@ -12,12 +12,12 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIFlexibleGpuLink() *schema.Resource { +func ResourceOutscaleFlexibleGpuLink() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIFlexibleGpuLinkCreate, - Read: ResourceOutscaleOAPIFlexibleGpuLinkRead, + Create: ResourceOutscaleFlexibleGpuLinkCreate, + Read: ResourceOutscaleFlexibleGpuLinkRead, Update: resourceFlexibleGpuLinkUpdate, - Delete: ResourceOutscaleOAPIFlexibleGpuLinkDelete, + Delete: ResourceOutscaleFlexibleGpuLinkDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -50,7 +50,7 @@ func ResourceOutscaleOAPIFlexibleGpuLink() *schema.Resource { } } -func ResourceOutscaleOAPIFlexibleGpuLinkCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleFlexibleGpuLinkCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI vmId := d.Get("vm_id").(string) GpuIdsList := utils.SetToStringSlice(d.Get("flexible_gpu_ids").(*schema.Set)) @@ -83,10 +83,10 @@ func ResourceOutscaleOAPIFlexibleGpuLinkCreate(d *schema.ResourceData, meta inte return fmt.Errorf("Unable to change ShutdownBehavior: %s\n", err) } - return ResourceOutscaleOAPIFlexibleGpuLinkRead(d, meta) + return ResourceOutscaleFlexibleGpuLinkRead(d, meta) } -func ResourceOutscaleOAPIFlexibleGpuLinkRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleFlexibleGpuLinkRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI vmId := d.Get("vm_id").(string) req := &oscgo.ReadFlexibleGpusRequest{ @@ -129,7 +129,7 @@ func ResourceOutscaleOAPIFlexibleGpuLinkRead(d *schema.ResourceData, meta interf return nil } -func ResourceOutscaleOAPIFlexibleGpuLinkDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleFlexibleGpuLinkDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI GpuIdsList := utils.SetToStringSlice(d.Get("flexible_gpu_ids").(*schema.Set)) vmId := d.Get("vm_id").(string) @@ -239,7 +239,7 @@ func resourceFlexibleGpuLinkUpdate(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("Unable to change ShutdownBehavior: %s\n", err) } - return ResourceOutscaleOAPIFlexibleGpuLinkRead(d, meta) + return ResourceOutscaleFlexibleGpuLinkRead(d, meta) } func changeShutdownBehavior(conn *oscgo.APIClient, vmId string, timeOut time.Duration) error { diff --git a/outscale/resource_outscale_flexible_gpu_link_test.go b/outscale/resource_outscale_flexible_gpu_link_test.go index 1cbf3ab57..6cefbfa27 100644 --- a/outscale/resource_outscale_flexible_gpu_link_test.go +++ b/outscale/resource_outscale_flexible_gpu_link_test.go @@ -19,7 +19,7 @@ func TestAccVM_withFlexibleGpuLink_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIFlexibleGpuLinkConfig(omi, "tinav5.c2r2p2", utils.GetRegion()), + Config: testAccOutscaleFlexibleGpuLinkConfig(omi, "tinav5.c2r2p2", utils.GetRegion()), }, }, }) @@ -28,7 +28,7 @@ func TestAccVM_withFlexibleGpuLink_basic(t *testing.T) { } } -func testAccOutscaleOAPIFlexibleGpuLinkConfig(omi, vmType, region string) string { +func testAccOutscaleFlexibleGpuLinkConfig(omi, vmType, region string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_fgpu" { security_group_name = "sg_GPU" diff --git a/outscale/resource_outscale_flexible_gpu_test.go b/outscale/resource_outscale_flexible_gpu_test.go index 00e49fe7e..9e35af961 100644 --- a/outscale/resource_outscale_flexible_gpu_test.go +++ b/outscale/resource_outscale_flexible_gpu_test.go @@ -18,13 +18,13 @@ func TestAccOthers_FlexibleGpu_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIFlexibleGpuConfig(utils.GetRegion()), + Config: testAccOutscaleFlexibleGpuConfig(utils.GetRegion()), }, }, }) } -func testAccOutscaleOAPIFlexibleGpuConfig(region string) string { +func testAccOutscaleFlexibleGpuConfig(region string) string { return fmt.Sprintf(` resource "outscale_flexible_gpu" "fGPU-1" { model_name = "nvidia-p6" diff --git a/outscale/resource_outscale_image.go b/outscale/resource_outscale_image.go index efc28fbe4..bdd2025a9 100644 --- a/outscale/resource_outscale_image.go +++ b/outscale/resource_outscale_image.go @@ -24,7 +24,7 @@ const ( OutscaleImageRetryMinTimeout = 3 * time.Second ) -func ResourceOutscaleOAPIImage() *schema.Resource { +func ResourceOutscaleImage() *schema.Resource { return &schema.Resource{ Create: resourceOAPIImageCreate, Read: resourceOAPIImageRead, @@ -436,7 +436,7 @@ func resourceOAPIImageDelete(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error deleting the image %s", err) } - if err := ResourceOutscaleOAPIImageWaitForDestroy(d.Id(), conn); err != nil { + if err := ResourceOutscaleImageWaitForDestroy(d.Id(), conn); err != nil { return err } @@ -444,7 +444,7 @@ func resourceOAPIImageDelete(d *schema.ResourceData, meta interface{}) error { return nil } -func ResourceOutscaleOAPIImageWaitForDestroy(id string, conn *oscgo.APIClient) error { +func ResourceOutscaleImageWaitForDestroy(id string, conn *oscgo.APIClient) error { log.Printf("[INFO] Waiting for OMI %s to be deleted...", id) filterReq := oscgo.ReadImagesRequest{ diff --git a/outscale/resource_outscale_image_export_task.go b/outscale/resource_outscale_image_export_task.go index 66f6e1401..5230fe255 100644 --- a/outscale/resource_outscale_image_export_task.go +++ b/outscale/resource_outscale_image_export_task.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIIMageExportTask() *schema.Resource { +func ResourceOutscaleIMageExportTask() *schema.Resource { return &schema.Resource{ Create: resourceOAPIImageExportTaskCreate, Read: resourceOAPIImageExportTaskRead, diff --git a/outscale/resource_outscale_image_export_task_test.go b/outscale/resource_outscale_image_export_task_test.go index d0efd5ed4..487b2e719 100644 --- a/outscale/resource_outscale_image_export_task_test.go +++ b/outscale/resource_outscale_image_export_task_test.go @@ -33,13 +33,13 @@ func TestAccVM_withImageExportTask_basic(t *testing.T) { { Config: testAccOAPIImageExportTaskConfigBasic(omi, "tinav4.c2r2p2", region, imageName, ""), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPImageExportTaskExists("outscale_image_export_task.outscale_image_export_task"), + testAccCheckOutscalemageExportTaskExists("outscale_image_export_task.outscale_image_export_task"), ), }, { Config: testAccOAPIImageExportTaskConfigBasic(omi, "tinav4.c2r2p2", region, imageName, tags), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPImageExportTaskExists("outscale_image_export_task.outscale_image_export_task"), + testAccCheckOutscalemageExportTaskExists("outscale_image_export_task.outscale_image_export_task"), ), }, }, @@ -49,7 +49,7 @@ func TestAccVM_withImageExportTask_basic(t *testing.T) { } } -func testAccCheckOutscaleOAPImageExportTaskExists(n string) resource.TestCheckFunc { +func testAccCheckOutscalemageExportTaskExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { diff --git a/outscale/resource_outscale_image_launch_permission.go b/outscale/resource_outscale_image_launch_permission.go index 850355bc3..4de6ae4ff 100644 --- a/outscale/resource_outscale_image_launch_permission.go +++ b/outscale/resource_outscale_image_launch_permission.go @@ -17,12 +17,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIImageLaunchPermission() *schema.Resource { +func ResourceOutscaleImageLaunchPermission() *schema.Resource { return &schema.Resource{ - Exists: ResourceOutscaleOAPIImageLaunchPermissionExists, - Create: ResourceOutscaleOAPIImageLaunchPermissionCreate, - Read: ResourceOutscaleOAPIImageLaunchPermissionRead, - Delete: ResourceOutscaleOAPIImageLaunchPermissionDelete, + Exists: ResourceOutscaleImageLaunchPermissionExists, + Create: ResourceOutscaleImageLaunchPermissionCreate, + Read: ResourceOutscaleImageLaunchPermissionRead, + Delete: ResourceOutscaleImageLaunchPermissionDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -106,7 +106,7 @@ func ResourceOutscaleOAPIImageLaunchPermission() *schema.Resource { } } -func ResourceOutscaleOAPIImageLaunchPermissionExists(d *schema.ResourceData, meta interface{}) (bool, error) { +func ResourceOutscaleImageLaunchPermissionExists(d *schema.ResourceData, meta interface{}) (bool, error) { conn := meta.(*OutscaleClient).OSCAPI imageID := d.Get("image_id").(string) @@ -130,7 +130,7 @@ func expandOAPIImagePermission(permissionType interface{}) (res oscgo.Permission return } -func ResourceOutscaleOAPIImageLaunchPermissionCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleImageLaunchPermissionCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI imageID, ok := d.GetOk("image_id") @@ -171,10 +171,10 @@ func ResourceOutscaleOAPIImageLaunchPermissionCreate(d *schema.ResourceData, met d.SetId(imageID.(string)) - return ResourceOutscaleOAPIImageLaunchPermissionRead(d, meta) + return ResourceOutscaleImageLaunchPermissionRead(d, meta) } -func ResourceOutscaleOAPIImageLaunchPermissionRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleImageLaunchPermissionRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var resp oscgo.ReadImagesResponse @@ -221,7 +221,7 @@ func ResourceOutscaleOAPIImageLaunchPermissionRead(d *schema.ResourceData, meta return d.Set("permissions_to_launch", []map[string]interface{}{lp}) } -func ResourceOutscaleOAPIImageLaunchPermissionDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleImageLaunchPermissionDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI imageID, ok := d.GetOk("image_id") diff --git a/outscale/resource_outscale_image_launch_permission_test.go b/outscale/resource_outscale_image_launch_permission_test.go index c849dff68..e98ba3101 100644 --- a/outscale/resource_outscale_image_launch_permission_test.go +++ b/outscale/resource_outscale_image_launch_permission_test.go @@ -31,21 +31,21 @@ func TestAccVM_WithImageLaunchPermission_Basic(t *testing.T) { Steps: []r.TestStep{ // Scaffold everything { - Config: testAccOutscaleOAPIImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, true, rInt), + Config: testAccOutscaleImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, true, rInt), Check: r.ComposeTestCheckFunc( testCheckResourceOAPILPIGetAttr("outscale_image.outscale_image", "id", &imageID), ), }, // Drop just launch permission to test destruction { - Config: testAccOutscaleOAPIImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, false, rInt), + Config: testAccOutscaleImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, false, rInt), Check: r.ComposeTestCheckFunc( - testAccOutscaleOAPIImageLaunchPermissionDestroyed(accountID, &imageID), + testAccOutscaleImageLaunchPermissionDestroyed(accountID, &imageID), ), }, // Re-add everything so we can test when AMI disappears { - Config: testAccOutscaleOAPIImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, true, rInt), + Config: testAccOutscaleImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, true, rInt), Check: r.ComposeTestCheckFunc( testCheckResourceOAPILPIGetAttr("outscale_image.outscale_image", "id", &imageID), ), @@ -53,9 +53,9 @@ func TestAccVM_WithImageLaunchPermission_Basic(t *testing.T) { // Here we delete the AMI to verify the follow-on refresh after this step // should not error. { - Config: testAccOutscaleOAPIImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, true, rInt), + Config: testAccOutscaleImageLaunchPermissionConfig(omi, "tinav4.c2r2p2", region, accountID, keypair, true, rInt), Check: r.ComposeTestCheckFunc( - testAccOutscaleOAPIImageDisappears(&imageID), + testAccOutscaleImageDisappears(&imageID), ), ExpectNonEmptyPlan: true, }, @@ -78,14 +78,14 @@ func TestAccVM_ImageLaunchPermissionDestruction_Basic(t *testing.T) { Steps: []r.TestStep{ // Scaffold everything { - Config: testAccOutscaleOAPIImageLaunchPermissionCreateConfig(omi, "tinav4.c2r2p2", region, keypair, rInt, true, false), + Config: testAccOutscaleImageLaunchPermissionCreateConfig(omi, "tinav4.c2r2p2", region, keypair, rInt, true, false), Check: r.ComposeTestCheckFunc( testCheckResourceOAPILPIGetAttr("outscale_image.outscale_image", "id", &imageID), - testAccOutscaleOAPIImageLaunchPermissionExists(accountID, &imageID), + testAccOutscaleImageLaunchPermissionExists(accountID, &imageID), ), }, { - Config: testAccOutscaleOAPIImageLaunchPermissionCreateConfig(omi, "tinav4.c2r2p2", region, keypair, rInt, true, true), + Config: testAccOutscaleImageLaunchPermissionCreateConfig(omi, "tinav4.c2r2p2", region, keypair, rInt, true, true), Check: r.ComposeTestCheckFunc( testCheckResourceOAPILPIGetAttr("outscale_image.outscale_image", "id", &imageID), ), @@ -112,7 +112,7 @@ func testCheckResourceOAPILPIGetAttr(name, key string, value *string) r.TestChec } } -func testAccOutscaleOAPIImageLaunchPermissionExists(accountID string, imageID *string) r.TestCheckFunc { +func testAccOutscaleImageLaunchPermissionExists(accountID string, imageID *string) r.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI if has, err := hasOAPILaunchPermission(conn, *imageID); err != nil { @@ -124,7 +124,7 @@ func testAccOutscaleOAPIImageLaunchPermissionExists(accountID string, imageID *s } } -func testAccOutscaleOAPIImageLaunchPermissionDestroyed(accountID string, imageID *string) r.TestCheckFunc { +func testAccOutscaleImageLaunchPermissionDestroyed(accountID string, imageID *string) r.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI if has, err := hasOAPILaunchPermission(conn, *imageID); err != nil { @@ -136,10 +136,10 @@ func testAccOutscaleOAPIImageLaunchPermissionDestroyed(accountID string, imageID } } -// testAccOutscaleOAPIImageDisappears is technically a "test check function" but really it +// testAccOutscaleImageDisappears is technically a "test check function" but really it // exists to perform a side effect of deleting an AMI out from under a resource // so we can test that Terraform will react properly -func testAccOutscaleOAPIImageDisappears(imageID *string) r.TestCheckFunc { +func testAccOutscaleImageDisappears(imageID *string) r.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI req := oscgo.DeleteImageRequest{ @@ -158,7 +158,7 @@ func testAccOutscaleOAPIImageDisappears(imageID *string) r.TestCheckFunc { return err } - return ResourceOutscaleOAPIImageWaitForDestroy(*imageID, conn) + return ResourceOutscaleImageWaitForDestroy(*imageID, conn) } } @@ -180,7 +180,7 @@ func testCheckResourceGetAttr(name, key string, value *string) r.TestCheckFunc { } } -func testAccOutscaleOAPIImageLaunchPermissionConfig(omi, vmType, region, accountID, keypair string, includeLaunchPermission bool, r int) string { +func testAccOutscaleImageLaunchPermissionConfig(omi, vmType, region, accountID, keypair string, includeLaunchPermission bool, r int) string { base := fmt.Sprintf(` resource "outscale_security_group" "sg_perm" { security_group_name = "sgLPerm" @@ -221,7 +221,7 @@ func testAccOutscaleOAPIImageLaunchPermissionConfig(omi, vmType, region, account `, accountID) } -func testAccOutscaleOAPIImageLaunchPermissionCreateConfig(omi, vmType, region, keypair string, r int, includeAddtion, includeRemoval bool) string { +func testAccOutscaleImageLaunchPermissionCreateConfig(omi, vmType, region, keypair string, r int, includeAddtion, includeRemoval bool) string { base := fmt.Sprintf(` resource "outscale_security_group" "sg_perm" { security_group_name = "sgLPerm" diff --git a/outscale/resource_outscale_internet_service.go b/outscale/resource_outscale_internet_service.go index 7afb4bce4..e843ca4ce 100644 --- a/outscale/resource_outscale_internet_service.go +++ b/outscale/resource_outscale_internet_service.go @@ -12,12 +12,12 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIInternetService() *schema.Resource { +func ResourceOutscaleInternetService() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIInternetServiceCreate, - Read: ResourceOutscaleOAPIInternetServiceRead, - Update: ResourceOutscaleOAPIInternetServiceUpdate, - Delete: ResourceOutscaleOAPIInternetServiceDelete, + Create: ResourceOutscaleInternetServiceCreate, + Read: ResourceOutscaleInternetServiceRead, + Update: ResourceOutscaleInternetServiceUpdate, + Delete: ResourceOutscaleInternetServiceDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -44,7 +44,7 @@ func ResourceOutscaleOAPIInternetService() *schema.Resource { } } -func ResourceOutscaleOAPIInternetServiceCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleInternetServiceCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var resp oscgo.CreateInternetServiceResponse @@ -71,10 +71,10 @@ func ResourceOutscaleOAPIInternetServiceCreate(d *schema.ResourceData, meta inte d.SetId(resp.InternetService.GetInternetServiceId()) - return ResourceOutscaleOAPIInternetServiceRead(d, meta) + return ResourceOutscaleInternetServiceRead(d, meta) } -func ResourceOutscaleOAPIInternetServiceRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleInternetServiceRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Id() @@ -119,16 +119,16 @@ func ResourceOutscaleOAPIInternetServiceRead(d *schema.ResourceData, meta interf return d.Set("tags", tagsOSCAPIToMap(resp.GetInternetServices()[0].GetTags())) } -func ResourceOutscaleOAPIInternetServiceUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleInternetServiceUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPIInternetServiceRead(d, meta) + return ResourceOutscaleInternetServiceRead(d, meta) } -func ResourceOutscaleOAPIInternetServiceDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleInternetServiceDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI internetServiceID := d.Id() diff --git a/outscale/resource_outscale_internet_service_link.go b/outscale/resource_outscale_internet_service_link.go index 4257d12b8..2bbb64602 100644 --- a/outscale/resource_outscale_internet_service_link.go +++ b/outscale/resource_outscale_internet_service_link.go @@ -12,11 +12,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIInternetServiceLink() *schema.Resource { +func ResourceOutscaleInternetServiceLink() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIInternetServiceLinkCreate, - Read: ResourceOutscaleOAPIInternetServiceLinkRead, - Delete: ResourceOutscaleOAPIInternetServiceLinkDelete, + Create: ResourceOutscaleInternetServiceLinkCreate, + Read: ResourceOutscaleInternetServiceLinkRead, + Delete: ResourceOutscaleInternetServiceLinkDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -63,7 +63,7 @@ func ResourceOutscaleOAPIInternetServiceLink() *schema.Resource { } } -func ResourceOutscaleOAPIInternetServiceLinkCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleInternetServiceLinkCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI internetServiceID := d.Get("internet_service_id").(string) @@ -107,10 +107,10 @@ func ResourceOutscaleOAPIInternetServiceLinkCreate(d *schema.ResourceData, meta d.SetId(internetServiceID) - return ResourceOutscaleOAPIInternetServiceLinkRead(d, meta) + return ResourceOutscaleInternetServiceLinkRead(d, meta) } -func ResourceOutscaleOAPIInternetServiceLinkRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleInternetServiceLinkRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI internetServiceID := d.Id() @@ -158,7 +158,7 @@ func ResourceOutscaleOAPIInternetServiceLinkRead(d *schema.ResourceData, meta in }) } -func ResourceOutscaleOAPIInternetServiceLinkDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleInternetServiceLinkDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI internetServiceID := d.Id() diff --git a/outscale/resource_outscale_internet_service_test.go b/outscale/resource_outscale_internet_service_test.go index 1ed197143..3cbea0ab6 100644 --- a/outscale/resource_outscale_internet_service_test.go +++ b/outscale/resource_outscale_internet_service_test.go @@ -21,13 +21,13 @@ func TestAccOthers_InternetService_basic(t *testing.T) { CheckDestroy: testAccCheckOutscaleInternetServiceDestroyed, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIInternetServiceConfig(), + Config: testAccOutscaleInternetServiceConfig(), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleInternetServiceExists("outscale_internet_service.outscale_internet_service"), ), }, { - Config: testAccOutscaleOAPIInternetServiceConfig(), + Config: testAccOutscaleInternetServiceConfig(), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleInternetServiceExists("outscale_internet_service.outscale_internet_service"), ), @@ -99,7 +99,7 @@ func testAccCheckOutscaleInternetServiceDestroyed(s *terraform.State) error { return nil } -func testAccOutscaleOAPIInternetServiceConfig() string { +func testAccOutscaleInternetServiceConfig() string { return ` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_keypair.go b/outscale/resource_outscale_keypair.go index 653b7a970..3fe2aed9d 100644 --- a/outscale/resource_outscale_keypair.go +++ b/outscale/resource_outscale_keypair.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIKeyPair() *schema.Resource { +func ResourceOutscaleKeyPair() *schema.Resource { return &schema.Resource{ Create: resourceOAPIKeyPairCreate, Read: resourceOAPIKeyPairRead, diff --git a/outscale/resource_outscale_keypair_test.go b/outscale/resource_outscale_keypair_test.go index ad3d617da..038bc8fbe 100644 --- a/outscale/resource_outscale_keypair_test.go +++ b/outscale/resource_outscale_keypair_test.go @@ -24,13 +24,13 @@ func TestAccOthers_Keypair_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIKeyPairDestroy, + CheckDestroy: testAccCheckOutscaleKeyPairDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIKeyPairConfig(rInt), + Config: testAccOutscaleKeyPairConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIKeyPairExists("outscale_keypair.a_key_pair", &conf), - testAccCheckOutscaleOAPIKeyPairFingerprint("8a:47:95:bb:b1:45:66:ef:99:f5:80:91:cc:be:94:48", &conf), + testAccCheckOutscaleKeyPairExists("outscale_keypair.a_key_pair", &conf), + testAccCheckOutscaleKeyPairFingerprint("8a:47:95:bb:b1:45:66:ef:99:f5:80:91:cc:be:94:48", &conf), ), }, }, @@ -45,12 +45,12 @@ func TestAccOthers_Keypair_retrieveName(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIKeyPairDestroy, + CheckDestroy: testAccCheckOutscaleKeyPairDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIKeyPairConfigRetrieveName(rInt), + Config: testAccOutscaleKeyPairConfigRetrieveName(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIKeyPairExists("outscale_keypair.a_key_pair", &conf), + testAccCheckOutscaleKeyPairExists("outscale_keypair.a_key_pair", &conf), resource.TestCheckResourceAttr( "outscale_keypair.a_key_pair", "keypair_name", fmt.Sprintf("tf-acc-key-pair-%d", rInt), ), @@ -68,13 +68,13 @@ func TestAccOthers_Keypair_generatedName(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIKeyPairDestroy, + CheckDestroy: testAccCheckOutscaleKeyPairDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIKeyPairConfigGeneratedName, + Config: testAccOutscaleKeyPairConfigGeneratedName, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIKeyPairExists("outscale_keypair.a_key_pair", &conf), - testAccCheckOutscaleOAPIKeyPairFingerprint("8a:47:95:bb:b1:45:66:ef:99:f5:80:91:cc:be:94:48", &conf), + testAccCheckOutscaleKeyPairExists("outscale_keypair.a_key_pair", &conf), + testAccCheckOutscaleKeyPairFingerprint("8a:47:95:bb:b1:45:66:ef:99:f5:80:91:cc:be:94:48", &conf), func(s *terraform.State) error { if conf.GetKeypairName() == "" { return fmt.Errorf("bad: No SG name") @@ -90,7 +90,7 @@ func TestAccOthers_Keypair_generatedName(t *testing.T) { }) } -func testAccCheckOutscaleOAPIKeyPairDestroy(s *terraform.State) error { +func testAccCheckOutscaleKeyPairDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient) for _, rs := range s.RootModule().Resources { @@ -126,7 +126,7 @@ func testAccCheckOutscaleOAPIKeyPairDestroy(s *terraform.State) error { return nil } -func testAccCheckOutscaleOAPIKeyPairFingerprint(expectedFingerprint string, conf *oscgo.Keypair) resource.TestCheckFunc { +func testAccCheckOutscaleKeyPairFingerprint(expectedFingerprint string, conf *oscgo.Keypair) resource.TestCheckFunc { return func(s *terraform.State) error { if conf.GetKeypairFingerprint() != expectedFingerprint { return fmt.Errorf("incorrect fingerprint. expected %s, got %s", expectedFingerprint, conf.GetKeypairFingerprint()) @@ -135,7 +135,7 @@ func testAccCheckOutscaleOAPIKeyPairFingerprint(expectedFingerprint string, conf } } -func testAccCheckOutscaleOAPIKeyPairExists(n string, res *oscgo.Keypair) resource.TestCheckFunc { +func testAccCheckOutscaleKeyPairExists(n string, res *oscgo.Keypair) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -175,7 +175,7 @@ func testAccCheckOutscaleOAPIKeyPairExists(n string, res *oscgo.Keypair) resourc } } -func testAccOutscaleOAPIKeyPairConfig(r int) string { +func testAccOutscaleKeyPairConfig(r int) string { return fmt.Sprintf(` resource "outscale_keypair" "a_key_pair" { keypair_name = "tf-acc-key-pair-%d" @@ -184,7 +184,7 @@ func testAccOutscaleOAPIKeyPairConfig(r int) string { `, r) } -func testAccOutscaleOAPIKeyPairConfigRetrieveName(r int) string { +func testAccOutscaleKeyPairConfigRetrieveName(r int) string { return fmt.Sprintf(` resource "outscale_keypair" "a_key_pair" { keypair_name = "tf-acc-key-pair-%d" @@ -192,7 +192,7 @@ func testAccOutscaleOAPIKeyPairConfigRetrieveName(r int) string { `, r) } -const testAccOutscaleOAPIKeyPairConfigGeneratedName = ` +const testAccOutscaleKeyPairConfigGeneratedName = ` resource "outscale_keypair" "a_key_pair" { public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" } diff --git a/outscale/resource_outscale_load_balancer.go b/outscale/resource_outscale_load_balancer.go index 87f82f566..4079c9350 100644 --- a/outscale/resource_outscale_load_balancer.go +++ b/outscale/resource_outscale_load_balancer.go @@ -35,12 +35,12 @@ func lb_sg_schema() *schema.Schema { } } -func ResourceOutscaleOAPILoadBalancer() *schema.Resource { +func ResourceOutscaleLoadBalancer() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPILoadBalancerCreate, - Read: ResourceOutscaleOAPILoadBalancerRead, - Update: ResourceOutscaleOAPILoadBalancerUpdate, - Delete: ResourceOutscaleOAPILoadBalancerDelete, + Create: ResourceOutscaleLoadBalancerCreate, + Read: ResourceOutscaleLoadBalancerRead, + Update: ResourceOutscaleLoadBalancerUpdate, + Delete: ResourceOutscaleLoadBalancerDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -365,11 +365,11 @@ func lb_listener_schema(computed bool) map[string]*schema.Schema { } } -func ResourceOutscaleOAPILoadBalancerCreate(d *schema.ResourceData, meta interface{}) error { - return ResourceOutscaleOAPILoadBalancerCreate_(d, meta, false) +func ResourceOutscaleLoadBalancerCreate(d *schema.ResourceData, meta interface{}) error { + return ResourceOutscaleLoadBalancerCreate_(d, meta, false) } -func ResourceOutscaleOAPILoadBalancerCreate_(d *schema.ResourceData, meta interface{}, isUpdate bool) error { +func ResourceOutscaleLoadBalancerCreate_(d *schema.ResourceData, meta interface{}, isUpdate bool) error { conn := meta.(*OutscaleClient).OSCAPI req := &oscgo.CreateLoadBalancerRequest{} @@ -462,7 +462,7 @@ func ResourceOutscaleOAPILoadBalancerCreate_(d *schema.ResourceData, meta interf } } - return ResourceOutscaleOAPILoadBalancerRead(d, meta) + return ResourceOutscaleLoadBalancerRead(d, meta) } func readResourceLb(conn *oscgo.APIClient, elbName string) (*oscgo.LoadBalancer, *oscgo.ReadLoadBalancersResponse, error) { @@ -498,7 +498,7 @@ func readResourceLb(conn *oscgo.APIClient, elbName string) (*oscgo.LoadBalancer, return &lb, &resp, nil } -func ResourceOutscaleOAPILoadBalancerRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLoadBalancerRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI elbName := d.Id() @@ -580,7 +580,7 @@ func ResourceOutscaleOAPILoadBalancerRead(d *schema.ResourceData, meta interface return nil } -func ResourceOutscaleOAPILoadBalancerUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLoadBalancerUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var err error @@ -893,10 +893,10 @@ func ResourceOutscaleOAPILoadBalancerUpdate(d *schema.ResourceData, meta interfa } } - return ResourceOutscaleOAPILoadBalancerRead(d, meta) + return ResourceOutscaleLoadBalancerRead(d, meta) } -func ResourceOutscaleOAPILoadBalancerDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLoadBalancerDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI log.Printf("[INFO] Deleting Load Balancer: %s", d.Id()) diff --git a/outscale/resource_outscale_load_balancer_attributes.go b/outscale/resource_outscale_load_balancer_attributes.go index e542d698a..da61c1c03 100644 --- a/outscale/resource_outscale_load_balancer_attributes.go +++ b/outscale/resource_outscale_load_balancer_attributes.go @@ -15,12 +15,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPILoadBalancerAttributes() *schema.Resource { +func ResourceOutscaleLoadBalancerAttributes() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPILoadBalancerAttributesCreate, - Update: ResourceOutscaleOAPILoadBalancerAttributesUpdate, - Read: ResourceOutscaleOAPILoadBalancerAttributesRead, - Delete: ResourceOutscaleOAPILoadBalancerAttributesDelete, + Create: ResourceOutscaleLoadBalancerAttributesCreate, + Update: ResourceOutscaleLoadBalancerAttributesUpdate, + Read: ResourceOutscaleLoadBalancerAttributesRead, + Delete: ResourceOutscaleLoadBalancerAttributesDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -272,13 +272,13 @@ func lb_atoi_at(hc map[string]interface{}, el string) (int, bool) { return r, err == nil } -func ResourceOutscaleOAPILoadBalancerAttributesUpdate(d *schema.ResourceData, +func ResourceOutscaleLoadBalancerAttributesUpdate(d *schema.ResourceData, meta interface{}) error { - return ResourceOutscaleOAPILoadBalancerAttributesCreate_(d, meta, true) + return ResourceOutscaleLoadBalancerAttributesCreate_(d, meta, true) } -func ResourceOutscaleOAPILoadBalancerAttributesCreate(d *schema.ResourceData, meta interface{}) error { - return ResourceOutscaleOAPILoadBalancerAttributesCreate_(d, meta, false) +func ResourceOutscaleLoadBalancerAttributesCreate(d *schema.ResourceData, meta interface{}) error { + return ResourceOutscaleLoadBalancerAttributesCreate_(d, meta, false) } func loadBalancerAttributesDoRequest(d *schema.ResourceData, meta interface{}, req oscgo.UpdateLoadBalancerRequest) error { @@ -300,11 +300,11 @@ func loadBalancerAttributesDoRequest(d *schema.ResourceData, meta interface{}, r d.SetId(req.LoadBalancerName) log.Printf("[INFO] LBU Attr ID: %s", d.Id()) - return ResourceOutscaleOAPILoadBalancerAttributesRead(d, meta) + return ResourceOutscaleLoadBalancerAttributesRead(d, meta) } -func ResourceOutscaleOAPILoadBalancerAttributesCreate_(d *schema.ResourceData, meta interface{}, isUpdate bool) error { +func ResourceOutscaleLoadBalancerAttributesCreate_(d *schema.ResourceData, meta interface{}, isUpdate bool) error { ename, ok := d.GetOk("load_balancer_name") if !ok { @@ -394,7 +394,7 @@ func ResourceOutscaleOAPILoadBalancerAttributesCreate_(d *schema.ResourceData, m return loadBalancerAttributesDoRequest(d, meta, req) } -func ResourceOutscaleOAPILoadBalancerAttributesRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLoadBalancerAttributesRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI elbName := d.Id() @@ -494,7 +494,7 @@ func ResourceOutscaleOAPILoadBalancerAttributesRead(d *schema.ResourceData, meta return nil } -func ResourceOutscaleOAPILoadBalancerAttributesDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLoadBalancerAttributesDelete(d *schema.ResourceData, meta interface{}) error { var err error conn := meta.(*OutscaleClient).OSCAPI diff --git a/outscale/resource_outscale_load_balancer_attributes_test.go b/outscale/resource_outscale_load_balancer_attributes_test.go index 18e55099b..f994bb9fc 100644 --- a/outscale/resource_outscale_load_balancer_attributes_test.go +++ b/outscale/resource_outscale_load_balancer_attributes_test.go @@ -25,15 +25,15 @@ func TestAccOthers_LBUAttr_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILBUAttrConfig(utils.GetRegion(), r), + Config: testAccOutscaleLBUAttrConfig(utils.GetRegion(), r), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILBUAttrExists("outscale_load_balancer_attributes.bar2", &conf), + testAccCheckOutscaleLBUAttrExists("outscale_load_balancer_attributes.bar2", &conf), )}, }, }) } -func testAccCheckOutscaleOAPILBUAttrExists(n string, res *oscgo.AccessLog) resource.TestCheckFunc { +func testAccCheckOutscaleLBUAttrExists(n string, res *oscgo.AccessLog) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -48,7 +48,7 @@ func testAccCheckOutscaleOAPILBUAttrExists(n string, res *oscgo.AccessLog) resou } } -func testAccOutscaleOAPILBUAttrConfig(region string, r int) string { +func testAccOutscaleLBUAttrConfig(region string, r int) string { return fmt.Sprintf(` resource "outscale_load_balancer" "barAtt" { subregion_names = ["%sa"] diff --git a/outscale/resource_outscale_load_balancer_test.go b/outscale/resource_outscale_load_balancer_test.go index 7eaf8c520..a1edd1d1c 100644 --- a/outscale/resource_outscale_load_balancer_test.go +++ b/outscale/resource_outscale_load_balancer_test.go @@ -28,12 +28,12 @@ func TestAccOthers_LBUBasic(t *testing.T) { }, IDRefreshName: lbResourceName, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILBUDestroy, + CheckDestroy: testAccCheckOutscaleLBUDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILBUConfig(r), + Config: testAccOutscaleLBUConfig(r), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILBUExists(lbResourceName, &conf), + testAccCheckOutscaleLBUExists(lbResourceName, &conf), resource.TestCheckResourceAttr(lbResourceName, "subregion_names.#", "1"), resource.TestCheckResourceAttr(lbResourceName, "subregion_names.0", zone), resource.TestCheckResourceAttr(lbResourceName, "listeners.#", "1"), @@ -58,12 +58,12 @@ func TestAccOthers_LBUPublicIp(t *testing.T) { }, IDRefreshName: resourceName, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILBUDestroy, + CheckDestroy: testAccCheckOutscaleLBUDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILBUPublicIpConfig(r), + Config: testAccOutscaleLBUPublicIpConfig(r), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILBUExists(resourceName, &conf), + testAccCheckOutscaleLBUExists(resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "listeners.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "public_ip"), )}, @@ -71,7 +71,7 @@ func TestAccOthers_LBUPublicIp(t *testing.T) { }) } -func testAccCheckOutscaleOAPILBUDestroy(s *terraform.State) error { +func testAccCheckOutscaleLBUDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI for _, rs := range s.RootModule().Resources { @@ -120,7 +120,7 @@ func testAccCheckOutscaleOAPILBUDestroy(s *terraform.State) error { return nil } -func testAccCheckOutscaleOAPILBUExists(n string, res *oscgo.LoadBalancer) resource.TestCheckFunc { +func testAccCheckOutscaleLBUExists(n string, res *oscgo.LoadBalancer) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -176,7 +176,7 @@ func testAccCheckOutscaleOAPILBUExists(n string, res *oscgo.LoadBalancer) resour } } -func testAccOutscaleOAPILBUConfig(r int) string { +func testAccOutscaleLBUConfig(r int) string { return fmt.Sprintf(` resource "outscale_load_balancer" "barRes" { subregion_names = ["%sa"] @@ -200,7 +200,7 @@ resource "outscale_load_balancer" "barRes" { `, utils.GetRegion(), r) } -func testAccOutscaleOAPILBUPublicIpConfig(r int) string { +func testAccOutscaleLBUPublicIpConfig(r int) string { return fmt.Sprintf(` resource "outscale_public_ip" "my_public_ip" { diff --git a/outscale/resource_outscale_load_balancer_vms_test.go b/outscale/resource_outscale_load_balancer_vms_test.go index 671e5995b..7116493a2 100644 --- a/outscale/resource_outscale_load_balancer_vms_test.go +++ b/outscale/resource_outscale_load_balancer_vms_test.go @@ -34,12 +34,12 @@ func TestAccVM_WithLBUAttachment_basic(t *testing.T) { PreCheck: func() { testAccPreCheckValues(t) }, IDRefreshName: "outscale_load_balancer.barTach", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILBUDestroy, + CheckDestroy: testAccCheckOutscaleLBUDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILBUAttachmentConfig1(rand, omi, utils.GetRegion()), + Config: testAccOutscaleLBUAttachmentConfig1(rand, omi, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILBUExists("outscale_load_balancer.barTach", &conf), + testAccCheckOutscaleLBUExists("outscale_load_balancer.barTach", &conf), testCheckInstanceAttached(1), ), }, @@ -48,7 +48,7 @@ func TestAccVM_WithLBUAttachment_basic(t *testing.T) { } // add one attachment -func testAccOutscaleOAPILBUAttachmentConfig1(num int, omi, region string) string { +func testAccOutscaleLBUAttachmentConfig1(num int, omi, region string) string { return fmt.Sprintf(` resource "outscale_load_balancer" "barTach" { load_balancer_name = "load-test-%d" diff --git a/outscale/resource_outscale_main_route_table_link.go b/outscale/resource_outscale_main_route_table_link.go index a7b6934a0..c4a081f63 100644 --- a/outscale/resource_outscale_main_route_table_link.go +++ b/outscale/resource_outscale_main_route_table_link.go @@ -86,7 +86,7 @@ func resourceLinkMainRouteTableCreate(d *schema.ResourceData, meta interface{}) } d.SetId(resp.GetLinkRouteTableId()) - return ResourceOutscaleOAPILinkRouteTableRead(d, meta) + return ResourceOutscaleLinkRouteTableRead(d, meta) } func resourceLinkMainRouteTableRead(d *schema.ResourceData, meta interface{}) error { diff --git a/outscale/resource_outscale_nat_service.go b/outscale/resource_outscale_nat_service.go index f28583f08..f5f8bb0d7 100644 --- a/outscale/resource_outscale_nat_service.go +++ b/outscale/resource_outscale_nat_service.go @@ -13,12 +13,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPINatService() *schema.Resource { +func ResourceOutscaleNatService() *schema.Resource { return &schema.Resource{ Create: resourceOAPINatServiceCreate, Read: resourceOAPINatServiceRead, Delete: resourceOAPINatServiceDelete, - Update: ResourceOutscaleOAPINatServiceUpdate, + Update: ResourceOutscaleNatServiceUpdate, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -196,7 +196,7 @@ func resourceOAPINatServiceRead(d *schema.ResourceData, meta interface{}) error }) } -func ResourceOutscaleOAPINatServiceUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNatServiceUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { diff --git a/outscale/resource_outscale_net.go b/outscale/resource_outscale_net.go index dbd779355..c68c3eda5 100644 --- a/outscale/resource_outscale_net.go +++ b/outscale/resource_outscale_net.go @@ -13,12 +13,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPINet() *schema.Resource { +func ResourceOutscaleNet() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPINetCreate, - Read: ResourceOutscaleOAPINetRead, - Update: ResourceOutscaleOAPINetUpdate, - Delete: ResourceOutscaleOAPINetDelete, + Create: ResourceOutscaleNetCreate, + Read: ResourceOutscaleNetRead, + Update: ResourceOutscaleNetUpdate, + Delete: ResourceOutscaleNetDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -27,7 +27,7 @@ func ResourceOutscaleOAPINet() *schema.Resource { } } -func ResourceOutscaleOAPINetCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.CreateNetRequest{ @@ -69,7 +69,7 @@ func ResourceOutscaleOAPINetCreate(d *schema.ResourceData, meta interface{}) err d.SetId(resp.Net.GetNetId()) return resource.Retry(120*time.Second, func() *resource.RetryError { - err = ResourceOutscaleOAPINetRead(d, meta) + err = ResourceOutscaleNetRead(d, meta) if err != nil { return resource.NonRetryableError(err) } @@ -83,7 +83,7 @@ func ResourceOutscaleOAPINetCreate(d *schema.ResourceData, meta interface{}) err }) } -func ResourceOutscaleOAPINetRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI filters := oscgo.FiltersNet{ @@ -131,16 +131,16 @@ func ResourceOutscaleOAPINetRead(d *schema.ResourceData, meta interface{}) error return d.Set("tags", tagsOSCAPIToMap(resp.GetNets()[0].GetTags())) } -func ResourceOutscaleOAPINetUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPINetRead(d, meta) + return ResourceOutscaleNetRead(d, meta) } -func ResourceOutscaleOAPINetDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.DeleteNetRequest{ diff --git a/outscale/resource_outscale_net_access_point_test.go b/outscale/resource_outscale_net_access_point_test.go index fadde54a3..0754b0291 100644 --- a/outscale/resource_outscale_net_access_point_test.go +++ b/outscale/resource_outscale_net_access_point_test.go @@ -18,13 +18,13 @@ func TestAccNet_AccessPoint_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPINetAccessPointConfig(ServiceName), + Config: testAccOutscaleNetAccessPointConfig(ServiceName), }, }, }) } -func testAccOutscaleOAPINetAccessPointConfig(sName string) string { +func testAccOutscaleNetAccessPointConfig(sName string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_net_attributes.go b/outscale/resource_outscale_net_attributes.go index aba5fd345..260860fab 100644 --- a/outscale/resource_outscale_net_attributes.go +++ b/outscale/resource_outscale_net_attributes.go @@ -13,12 +13,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPILinAttributes() *schema.Resource { +func ResourceOutscaleLinAttributes() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPILinAttrCreate, - Read: ResourceOutscaleOAPILinAttrRead, - Update: ResourceOutscaleOAPILinAttrUpdate, - Delete: ResourceOutscaleOAPILinAttrDelete, + Create: ResourceOutscaleLinAttrCreate, + Read: ResourceOutscaleLinAttrRead, + Update: ResourceOutscaleLinAttrUpdate, + Delete: ResourceOutscaleLinAttrDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -54,7 +54,7 @@ func ResourceOutscaleOAPILinAttributes() *schema.Resource { } } -func ResourceOutscaleOAPILinAttrCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinAttrCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.UpdateNetRequest{ @@ -84,10 +84,10 @@ func ResourceOutscaleOAPILinAttrCreate(d *schema.ResourceData, meta interface{}) d.SetId(resp.Net.GetNetId()) - return ResourceOutscaleOAPILinAttrRead(d, meta) + return ResourceOutscaleLinAttrRead(d, meta) } -func ResourceOutscaleOAPILinAttrUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinAttrUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.UpdateNetRequest{ @@ -108,10 +108,10 @@ func ResourceOutscaleOAPILinAttrUpdate(d *schema.ResourceData, meta interface{}) d.SetId(d.Get("net_id").(string)) - return ResourceOutscaleOAPILinAttrRead(d, meta) + return ResourceOutscaleLinAttrRead(d, meta) } -func ResourceOutscaleOAPILinAttrRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinAttrRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.ReadNetsRequest{ @@ -154,7 +154,7 @@ func ResourceOutscaleOAPILinAttrRead(d *schema.ResourceData, meta interface{}) e return d.Set("tags", tagsOSCAPIToMap(resp.GetNets()[0].GetTags())) } -func ResourceOutscaleOAPILinAttrDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinAttrDelete(d *schema.ResourceData, meta interface{}) error { d.SetId("") return nil diff --git a/outscale/resource_outscale_net_attributes_test.go b/outscale/resource_outscale_net_attributes_test.go index 0071d8b7f..fbb1893c2 100644 --- a/outscale/resource_outscale_net_attributes_test.go +++ b/outscale/resource_outscale_net_attributes_test.go @@ -15,7 +15,7 @@ func TestAccNet_Attributes_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILinAttrConfig, + Config: testAccOutscaleLinAttrConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_set_id"), resource.TestCheckResourceAttrSet(resourceName, "net_id"), @@ -33,14 +33,14 @@ func TestAccNet_Attributes_withoutDHCPID(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILinAttrConfigwithoutDHCPID("outscale_net.vpc.id"), + Config: testAccOutscaleLinAttrConfigwithoutDHCPID("outscale_net.vpc.id"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_set_id"), resource.TestCheckResourceAttrSet(resourceName, "net_id"), ), }, { - Config: testAccOutscaleOAPILinAttrConfigwithoutDHCPID("outscale_net.vpc2.id"), + Config: testAccOutscaleLinAttrConfigwithoutDHCPID("outscale_net.vpc2.id"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(resourceName, "dhcp_options_set_id"), resource.TestCheckResourceAttrSet(resourceName, "net_id"), @@ -50,7 +50,7 @@ func TestAccNet_Attributes_withoutDHCPID(t *testing.T) { }) } -const testAccOutscaleOAPILinAttrConfig = ` +const testAccOutscaleLinAttrConfig = ` resource "outscale_net" "vpc" { ip_range = "10.0.0.0/16" @@ -75,7 +75,7 @@ const testAccOutscaleOAPILinAttrConfig = ` } ` -func testAccOutscaleOAPILinAttrConfigwithoutDHCPID(vpc string) string { +func testAccOutscaleLinAttrConfigwithoutDHCPID(vpc string) string { return fmt.Sprintf(` resource "outscale_net" "vpc" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_net_peering.go b/outscale/resource_outscale_net_peering.go index fe08d51b5..4f42ef967 100644 --- a/outscale/resource_outscale_net_peering.go +++ b/outscale/resource_outscale_net_peering.go @@ -17,12 +17,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPILinPeeringConnection() *schema.Resource { +func ResourceOutscaleLinPeeringConnection() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPILinPeeringCreate, - Read: ResourceOutscaleOAPILinPeeringRead, - Update: ResourceOutscaleOAPINetPeeringUpdate, - Delete: ResourceOutscaleOAPILinPeeringDelete, + Create: ResourceOutscaleLinPeeringCreate, + Read: ResourceOutscaleLinPeeringRead, + Update: ResourceOutscaleNetPeeringUpdate, + Delete: ResourceOutscaleLinPeeringDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -77,7 +77,7 @@ func ResourceOutscaleOAPILinPeeringConnection() *schema.Resource { } } -func ResourceOutscaleOAPILinPeeringCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinPeeringCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI // Create the vpc peering connection @@ -123,7 +123,7 @@ func ResourceOutscaleOAPILinPeeringCreate(d *schema.ResourceData, meta interface stateConf := &resource.StateChangeConf{ Pending: []string{"initiating-request", "provisioning", "pending"}, Target: []string{"pending-acceptance", "active"}, - Refresh: ResourceOutscaleOAPILinPeeringConnectionStateRefreshFunc(conn, d.Id()), + Refresh: ResourceOutscaleLinPeeringConnectionStateRefreshFunc(conn, d.Id()), Timeout: 1 * time.Minute, } if _, err := stateConf.WaitForState(); err != nil { @@ -132,10 +132,10 @@ func ResourceOutscaleOAPILinPeeringCreate(d *schema.ResourceData, meta interface d.Id()), err) } - return ResourceOutscaleOAPILinPeeringRead(d, meta) + return ResourceOutscaleLinPeeringRead(d, meta) } -func ResourceOutscaleOAPILinPeeringRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinPeeringRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var resp oscgo.ReadNetPeeringsResponse var err error @@ -220,16 +220,16 @@ func ResourceOutscaleOAPILinPeeringRead(d *schema.ResourceData, meta interface{} return nil } -func ResourceOutscaleOAPINetPeeringUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetPeeringUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPILinPeeringRead(d, meta) + return ResourceOutscaleLinPeeringRead(d, meta) } -func ResourceOutscaleOAPILinPeeringDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinPeeringDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var err error @@ -252,9 +252,9 @@ func ResourceOutscaleOAPILinPeeringDelete(d *schema.ResourceData, meta interface return nil } -// ResourceOutscaleOAPILinPeeringConnectionStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch +// ResourceOutscaleLinPeeringConnectionStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch // a VPCPeeringConnection. -func ResourceOutscaleOAPILinPeeringConnectionStateRefreshFunc(conn *oscgo.APIClient, id string) resource.StateRefreshFunc { +func ResourceOutscaleLinPeeringConnectionStateRefreshFunc(conn *oscgo.APIClient, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { var resp oscgo.ReadNetPeeringsResponse var err error diff --git a/outscale/resource_outscale_net_peering_acceptation.go b/outscale/resource_outscale_net_peering_acceptation.go index da9d01bd9..82c2fb38a 100644 --- a/outscale/resource_outscale_net_peering_acceptation.go +++ b/outscale/resource_outscale_net_peering_acceptation.go @@ -13,11 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPILinPeeringConnectionAccepter() *schema.Resource { +func ResourceOutscaleLinPeeringConnectionAccepter() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPILinPeeringAccepterCreate, - Read: ResourceOutscaleOAPILinPeeringRead, - Delete: ResourceOutscaleOAPILinPeeringAccepterDelete, + Create: ResourceOutscaleLinPeeringAccepterCreate, + Read: ResourceOutscaleLinPeeringRead, + Delete: ResourceOutscaleLinPeeringAccepterDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -65,7 +65,7 @@ func ResourceOutscaleOAPILinPeeringConnectionAccepter() *schema.Resource { } } -func ResourceOutscaleOAPILinPeeringAccepterCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinPeeringAccepterCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Get("net_peering_id").(string) @@ -90,10 +90,10 @@ func ResourceOutscaleOAPILinPeeringAccepterCreate(d *schema.ResourceData, meta i return fmt.Errorf("Error creating Net Peering accepter. Details: %s", errString) } - return ResourceOutscaleOAPILinPeeringRead(d, meta) + return ResourceOutscaleLinPeeringRead(d, meta) } -func ResourceOutscaleOAPILinPeeringAccepterDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinPeeringAccepterDelete(d *schema.ResourceData, meta interface{}) error { log.Printf("[WARN] Will not delete VPC peering connection. Terraform will remove this resource from the state file, however resources may remain.") d.SetId("") return nil diff --git a/outscale/resource_outscale_net_peering_acceptation_test.go b/outscale/resource_outscale_net_peering_acceptation_test.go index f7c6dda94..dc820c935 100644 --- a/outscale/resource_outscale_net_peering_acceptation_test.go +++ b/outscale/resource_outscale_net_peering_acceptation_test.go @@ -12,19 +12,19 @@ func TestAccNet_PeeringConnectionAccepter_sameAccount(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccOutscaleOAPILinPeeringConnectionAccepterDestroy, + CheckDestroy: testAccOutscaleLinPeeringConnectionAccepterDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILinPeeringConnectionAccepterSameAccountConfig, + Config: testAccOutscaleLinPeeringConnectionAccepterSameAccountConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILinPeeringConnectionAccepterExists("outscale_net_peering_acceptation.peer"), + testAccCheckOutscaleLinPeeringConnectionAccepterExists("outscale_net_peering_acceptation.peer"), ), }, }, }) } -func testAccCheckOutscaleOAPILinPeeringConnectionAccepterExists(n string) resource.TestCheckFunc { +func testAccCheckOutscaleLinPeeringConnectionAccepterExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -38,12 +38,12 @@ func testAccCheckOutscaleOAPILinPeeringConnectionAccepterExists(n string) resour } } -func testAccOutscaleOAPILinPeeringConnectionAccepterDestroy(s *terraform.State) error { +func testAccOutscaleLinPeeringConnectionAccepterDestroy(s *terraform.State) error { // We don't destroy the underlying VPC Peering Connection. return nil } -const testAccOutscaleOAPILinPeeringConnectionAccepterSameAccountConfig = ` +const testAccOutscaleLinPeeringConnectionAccepterSameAccountConfig = ` resource "outscale_net" "foo" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_net_peering_test.go b/outscale/resource_outscale_net_peering_test.go index 88d6da7ca..015fd9ca9 100644 --- a/outscale/resource_outscale_net_peering_test.go +++ b/outscale/resource_outscale_net_peering_test.go @@ -21,12 +21,12 @@ func TestAccNet_PeeringConnection_basic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_net_peering.foo", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILinPeeringConnectionDestroy, + CheckDestroy: testAccCheckOutscaleLinPeeringConnectionDestroy, Steps: []resource.TestStep{ { Config: testAccOAPIVpcPeeringConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILinPeeringConnectionExists( + testAccCheckOutscaleLinPeeringConnectionExists( "outscale_net_peering.foo", &connection), ), @@ -41,14 +41,14 @@ func TestAccNet_PeeringConnection_importBasic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILinPeeringConnectionDestroy, + CheckDestroy: testAccCheckOutscaleLinPeeringConnectionDestroy, Steps: []resource.TestStep{ { Config: testAccOAPIVpcPeeringConfig, }, { ResourceName: resourceName, - ImportStateIdFunc: testAccCheckOutscaleOAPILinkPeeeringConnectionImportStateIDFunc(resourceName), + ImportStateIdFunc: testAccCheckOutscaleLinkPeeeringConnectionImportStateIDFunc(resourceName), ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"request_id"}, @@ -57,7 +57,7 @@ func TestAccNet_PeeringConnection_importBasic(t *testing.T) { }) } -func testAccCheckOutscaleOAPILinkPeeeringConnectionImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { +func testAccCheckOutscaleLinkPeeeringConnectionImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -93,12 +93,12 @@ func TestAccNet_PeeringConnection_plan(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPILinPeeringConnectionDestroy, + CheckDestroy: testAccCheckOutscaleLinPeeringConnectionDestroy, Steps: []resource.TestStep{ { Config: testAccOAPIVpcPeeringConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILinPeeringConnectionExists( + testAccCheckOutscaleLinPeeringConnectionExists( "outscale_net_peering.foo", &connection), testDestroy, @@ -109,7 +109,7 @@ func TestAccNet_PeeringConnection_plan(t *testing.T) { }) } -func testAccCheckOutscaleOAPILinPeeringConnectionDestroy(s *terraform.State) error { +func testAccCheckOutscaleLinPeeringConnectionDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI for _, rs := range s.RootModule().Resources { @@ -159,12 +159,12 @@ func testAccCheckOutscaleOAPILinPeeringConnectionDestroy(s *terraform.State) err // return error here; we've found the vpc_peering object we want, however // it's not in an expected state - return fmt.Errorf("Fall through error for testAccCheckOutscaleOAPILinPeeringConnectionDestroy") + return fmt.Errorf("Fall through error for testAccCheckOutscaleLinPeeringConnectionDestroy") } return nil } -func testAccCheckOutscaleOAPILinPeeringConnectionExists(n string, connection *oscgo.NetPeering) resource.TestCheckFunc { +func testAccCheckOutscaleLinPeeringConnectionExists(n string, connection *oscgo.NetPeering) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { diff --git a/outscale/resource_outscale_net_test.go b/outscale/resource_outscale_net_test.go index 03904df37..088c6d55a 100644 --- a/outscale/resource_outscale_net_test.go +++ b/outscale/resource_outscale_net_test.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccOutscaleOAPILin_basic(t *testing.T) { +func TestAccOutscaleLin_basic(t *testing.T) { t.Parallel() var conf oscgo.Net @@ -23,9 +23,9 @@ func TestAccOutscaleOAPILin_basic(t *testing.T) { // CheckDestroy: testAccCheckOutscaleLinDestroyed, // we need to create the destroyed test case Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILinConfig, + Config: testAccOutscaleLinConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILinExists("outscale_net.vpc", &conf), + testAccCheckOutscaleLinExists("outscale_net.vpc", &conf), resource.TestCheckResourceAttr( "outscale_net.vpc", "ip_range", "10.0.0.0/16"), ), @@ -39,21 +39,21 @@ func TestAccNet_UpdateTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPINICDestroy, + CheckDestroy: testAccCheckOutscaleNICDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPILinConfigUpdateTags("Terraform_net"), + Config: testAccOutscaleLinConfigUpdateTags("Terraform_net"), Check: resource.ComposeTestCheckFunc(), }, { - Config: testAccOutscaleOAPILinConfigUpdateTags("Terraform_net2"), + Config: testAccOutscaleLinConfigUpdateTags("Terraform_net2"), Check: resource.ComposeTestCheckFunc(), }, }, }) } -func testAccCheckOutscaleOAPILinExists(n string, res *oscgo.Net) resource.TestCheckFunc { +func testAccCheckOutscaleLinExists(n string, res *oscgo.Net) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -91,7 +91,7 @@ func testAccCheckOutscaleOAPILinExists(n string, res *oscgo.Net) resource.TestCh } } -const testAccOutscaleOAPILinConfig = ` +const testAccOutscaleLinConfig = ` resource "outscale_net" "vpc" { ip_range = "10.0.0.0/16" tags { @@ -101,7 +101,7 @@ const testAccOutscaleOAPILinConfig = ` } ` -func testAccOutscaleOAPILinConfigUpdateTags(value string) string { +func testAccOutscaleLinConfigUpdateTags(value string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_nic.go b/outscale/resource_outscale_nic.go index 62e6343c4..40c39a7d7 100644 --- a/outscale/resource_outscale_nic.go +++ b/outscale/resource_outscale_nic.go @@ -19,12 +19,12 @@ import ( ) // Creates a network interface in the specified subnet -func ResourceOutscaleOAPINic() *schema.Resource { +func ResourceOutscaleNic() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPINicCreate, - Read: ResourceOutscaleOAPINicRead, - Update: ResourceOutscaleOAPINicUpdate, - Delete: ResourceOutscaleOAPINicDelete, + Create: ResourceOutscaleNicCreate, + Read: ResourceOutscaleNicRead, + Update: ResourceOutscaleNicUpdate, + Delete: ResourceOutscaleNicDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -234,7 +234,7 @@ func getOAPINicSchema() map[string]*schema.Schema { } // Create OAPINic -func ResourceOutscaleOAPINicCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNicCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI @@ -283,11 +283,11 @@ func ResourceOutscaleOAPINicCreate(d *schema.ResourceData, meta interface{}) err if err := d.Set("private_ip", ""); err != nil { return err } - return ResourceOutscaleOAPINicRead(d, meta) + return ResourceOutscaleNicRead(d, meta) } // Read OAPINic -func ResourceOutscaleOAPINicRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNicRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI dnir := oscgo.ReadNicsRequest{ @@ -405,13 +405,13 @@ func ResourceOutscaleOAPINicRead(d *schema.ResourceData, meta interface{}) error } // Delete OAPINic -func ResourceOutscaleOAPINicDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNicDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI log.Printf("[INFO] Deleting ENI: %s", d.Id()) - err := ResourceOutscaleOAPINicDetach(meta, d.Id()) + err := ResourceOutscaleNicDetach(meta, d.Id()) if err != nil { return err } @@ -436,7 +436,7 @@ func ResourceOutscaleOAPINicDelete(d *schema.ResourceData, meta interface{}) err return nil } -func ResourceOutscaleOAPINicDetach(meta interface{}, nicID string) error { +func ResourceOutscaleNicDetach(meta interface{}, nicID string) error { // if there was an old nic_link, remove it conn := meta.(*OutscaleClient).OSCAPI @@ -481,14 +481,14 @@ func ResourceOutscaleOAPINicDetach(meta interface{}, nicID string) error { } // Update OAPINic -func ResourceOutscaleOAPINicUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNicUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var err error if d.HasChange("link_nic") { _, na := d.GetChange("link_nic") - err := ResourceOutscaleOAPINicDetach(meta, d.Id()) + err := ResourceOutscaleNicDetach(meta, d.Id()) if err != nil { return err } @@ -655,7 +655,7 @@ func ResourceOutscaleOAPINicUpdate(d *schema.ResourceData, meta interface{}) err if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPINicRead(d, meta) + return ResourceOutscaleNicRead(d, meta) } func expandPrivateIPLight(pIPs []interface{}) []oscgo.PrivateIpLight { diff --git a/outscale/resource_outscale_nic_link.go b/outscale/resource_outscale_nic_link.go index df834aac0..125f56a2c 100644 --- a/outscale/resource_outscale_nic_link.go +++ b/outscale/resource_outscale_nic_link.go @@ -16,11 +16,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPINetworkInterfaceAttachment() *schema.Resource { +func ResourceOutscaleNetworkInterfaceAttachment() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPINetworkInterfaceAttachmentCreate, - Read: ResourceOutscaleOAPINetworkInterfaceAttachmentRead, - Delete: ResourceOutscaleOAPINetworkInterfaceAttachmentDelete, + Create: ResourceOutscaleNetworkInterfaceAttachmentCreate, + Read: ResourceOutscaleNetworkInterfaceAttachmentRead, + Delete: ResourceOutscaleNetworkInterfaceAttachmentDelete, Importer: &schema.ResourceImporter{ State: ResourceOutscaleNetworkInterfaceAttachmentImportState, }, @@ -66,7 +66,7 @@ func ResourceOutscaleOAPINetworkInterfaceAttachment() *schema.Resource { } } -func ResourceOutscaleOAPINetworkInterfaceAttachmentCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetworkInterfaceAttachmentCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI di := d.Get("device_number").(int) @@ -97,10 +97,10 @@ func ResourceOutscaleOAPINetworkInterfaceAttachmentCreate(d *schema.ResourceData } d.SetId(resp.GetLinkNicId()) - return ResourceOutscaleOAPINetworkInterfaceAttachmentRead(d, meta) + return ResourceOutscaleNetworkInterfaceAttachmentRead(d, meta) } -func ResourceOutscaleOAPINetworkInterfaceAttachmentRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetworkInterfaceAttachmentRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI nicID := d.Get("nic_id").(string) @@ -143,7 +143,7 @@ func ResourceOutscaleOAPINetworkInterfaceAttachmentRead(d *schema.ResourceData, return nil } -func ResourceOutscaleOAPINetworkInterfaceAttachmentDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetworkInterfaceAttachmentDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI interfaceID := d.Id() diff --git a/outscale/resource_outscale_nic_link_test.go b/outscale/resource_outscale_nic_link_test.go index 5169131b2..97c6f5498 100644 --- a/outscale/resource_outscale_nic_link_test.go +++ b/outscale/resource_outscale_nic_link_test.go @@ -32,7 +32,7 @@ func TestAccNet_withNicLink_Basic(t *testing.T) { { Config: testAccOutscaleNicLinkConfigBasic(rInt, omi, "tinav4.c2r2p2", region), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIENIExists("outscale_nic.outscale_nic", &conf), + testAccCheckOutscaleENIExists("outscale_nic.outscale_nic", &conf), resource.TestCheckResourceAttr( "outscale_nic_link.outscale_nic_link", "device_number", "1"), resource.TestCheckResourceAttrSet( diff --git a/outscale/resource_outscale_nic_private_ip.go b/outscale/resource_outscale_nic_private_ip.go index cd18ac2e0..8f81ccc55 100644 --- a/outscale/resource_outscale_nic_private_ip.go +++ b/outscale/resource_outscale_nic_private_ip.go @@ -13,11 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPINetworkInterfacePrivateIP() *schema.Resource { +func ResourceOutscaleNetworkInterfacePrivateIP() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPINetworkInterfacePrivateIPCreate, - Read: ResourceOutscaleOAPINetworkInterfacePrivateIPRead, - Delete: ResourceOutscaleOAPINetworkInterfacePrivateIPDelete, + Create: ResourceOutscaleNetworkInterfacePrivateIPCreate, + Read: ResourceOutscaleNetworkInterfacePrivateIPRead, + Delete: ResourceOutscaleNetworkInterfacePrivateIPDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -57,7 +57,7 @@ func ResourceOutscaleOAPINetworkInterfacePrivateIP() *schema.Resource { } } -func ResourceOutscaleOAPINetworkInterfacePrivateIPCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetworkInterfacePrivateIPCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI input := oscgo.LinkPrivateIpsRequest{ @@ -91,10 +91,10 @@ func ResourceOutscaleOAPINetworkInterfacePrivateIPCreate(d *schema.ResourceData, d.SetId(input.NicId) - return ResourceOutscaleOAPINetworkInterfacePrivateIPRead(d, meta) + return ResourceOutscaleNetworkInterfacePrivateIPRead(d, meta) } -func ResourceOutscaleOAPINetworkInterfacePrivateIPRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetworkInterfacePrivateIPRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.ReadNicsRequest{ @@ -171,7 +171,7 @@ func ResourceOutscaleOAPINetworkInterfacePrivateIPRead(d *schema.ResourceData, m return nil } -func ResourceOutscaleOAPINetworkInterfacePrivateIPDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleNetworkInterfacePrivateIPDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI input := oscgo.UnlinkPrivateIpsRequest{ diff --git a/outscale/resource_outscale_nic_private_ip_test.go b/outscale/resource_outscale_nic_private_ip_test.go index 82f6371dd..fc3fe7de6 100644 --- a/outscale/resource_outscale_nic_private_ip_test.go +++ b/outscale/resource_outscale_nic_private_ip_test.go @@ -17,12 +17,12 @@ func TestAccNet_NICPrivateIPBasic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_nic.outscale_nic", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIENIDestroy, + CheckDestroy: testAccCheckOutscaleENIDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPINetworkInterfacePrivateIPConfigBasic(utils.GetRegion()), + Config: testAccOutscaleNetworkInterfacePrivateIPConfigBasic(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIENIExists("outscale_nic.outscale_nic", &conf), + testAccCheckOutscaleENIExists("outscale_nic.outscale_nic", &conf), resource.TestCheckResourceAttr("outscale_nic_private_ip.outscale_nic_private_ip", "private_ips.#", "1"), resource.TestCheckResourceAttr("outscale_nic_private_ip.outscale_nic_private_ip", "private_ips.0", "10.0.45.67"), resource.TestCheckResourceAttrSet("outscale_nic_private_ip.outscale_nic_private_ip", "primary_private_ip")), @@ -38,10 +38,10 @@ func TestAccNet_Import_NIC_PrivateIP_Basic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_nic.outscale_nic", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIENIDestroy, + CheckDestroy: testAccCheckOutscaleENIDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPINetworkInterfacePrivateIPConfigBasic(utils.GetRegion()), + Config: testAccOutscaleNetworkInterfacePrivateIPConfigBasic(utils.GetRegion()), }, { ResourceName: resourceName, @@ -53,7 +53,7 @@ func TestAccNet_Import_NIC_PrivateIP_Basic(t *testing.T) { }) } -func testAccOutscaleOAPINetworkInterfacePrivateIPConfigBasic(region string) string { +func testAccOutscaleNetworkInterfacePrivateIPConfigBasic(region string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_nic_test.go b/outscale/resource_outscale_nic_test.go index 73997fca4..ef7f671c4 100644 --- a/outscale/resource_outscale_nic_test.go +++ b/outscale/resource_outscale_nic_test.go @@ -22,21 +22,21 @@ func TestAccNet_WithNic_basic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_nic.outscale_nic", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPINICDestroy, + CheckDestroy: testAccCheckOutscaleNICDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIENIConfig(subregion), + Config: testAccOutscaleENIConfig(subregion), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIENIExists("outscale_nic.outscale_nic", &conf), - testAccCheckOutscaleOAPIENIAttributes(&conf, subregion), + testAccCheckOutscaleENIExists("outscale_nic.outscale_nic", &conf), + testAccCheckOutscaleENIAttributes(&conf, subregion), resource.TestCheckResourceAttr("outscale_nic.outscale_nic", "private_ips.#", "2"), ), }, { - Config: testAccOutscaleOAPIENIConfigUpdate(subregion), + Config: testAccOutscaleENIConfigUpdate(subregion), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIENIExists("outscale_nic.outscale_nic", &conf), - testAccCheckOutscaleOAPIENIAttributes(&conf, subregion), + testAccCheckOutscaleENIExists("outscale_nic.outscale_nic", &conf), + testAccCheckOutscaleENIAttributes(&conf, subregion), resource.TestCheckResourceAttr("outscale_nic.outscale_nic", "private_ips.#", "3"), ), }, @@ -44,7 +44,7 @@ func TestAccNet_WithNic_basic(t *testing.T) { }) } -func testAccCheckOutscaleOAPIENIExists(n string, res *oscgo.Nic) resource.TestCheckFunc { +func testAccCheckOutscaleENIExists(n string, res *oscgo.Nic) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -88,7 +88,7 @@ func testAccCheckOutscaleOAPIENIExists(n string, res *oscgo.Nic) resource.TestCh } } -func testAccCheckOutscaleOAPIENIAttributes(conf *oscgo.Nic, suregion string) resource.TestCheckFunc { +func testAccCheckOutscaleENIAttributes(conf *oscgo.Nic, suregion string) resource.TestCheckFunc { return func(s *terraform.State) error { if !reflect.DeepEqual(conf.GetLinkNic(), oscgo.LinkNic{}) { @@ -103,7 +103,7 @@ func testAccCheckOutscaleOAPIENIAttributes(conf *oscgo.Nic, suregion string) res } } -func testAccOutscaleOAPIENIConfig(subregion string) string { +func testAccOutscaleENIConfig(subregion string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" @@ -142,7 +142,7 @@ func testAccOutscaleOAPIENIConfig(subregion string) string { `, subregion) } -func testAccOutscaleOAPIENIConfigUpdate(subregion string) string { +func testAccOutscaleENIConfigUpdate(subregion string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_public_ip.go b/outscale/resource_outscale_public_ip.go index 8534e73c5..842f89b3f 100644 --- a/outscale/resource_outscale_public_ip.go +++ b/outscale/resource_outscale_public_ip.go @@ -13,12 +13,12 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIPublicIP() *schema.Resource { +func ResourceOutscalePublicIP() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIPublicIPCreate, - Read: ResourceOutscaleOAPIPublicIPRead, - Delete: ResourceOutscaleOAPIPublicIPDelete, - Update: ResourceOutscaleOAPIPublicIPUpdate, + Create: ResourceOutscalePublicIPCreate, + Read: ResourceOutscalePublicIPRead, + Delete: ResourceOutscalePublicIPDelete, + Update: ResourceOutscalePublicIPUpdate, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -32,7 +32,7 @@ func ResourceOutscaleOAPIPublicIP() *schema.Resource { } } -func ResourceOutscaleOAPIPublicIPCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscalePublicIPCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI allocOpts := oscgo.CreatePublicIpRequest{} @@ -67,10 +67,10 @@ func ResourceOutscaleOAPIPublicIPCreate(d *schema.ResourceData, meta interface{} } log.Printf("[INFO] EIP ID: %s (placement: %v)", d.Id(), allocResp.GetPublicIp()) - return ResourceOutscaleOAPIPublicIPUpdate(d, meta) + return ResourceOutscalePublicIPUpdate(d, meta) } -func ResourceOutscaleOAPIPublicIPRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscalePublicIPRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Id() @@ -135,7 +135,7 @@ func ResourceOutscaleOAPIPublicIPRead(d *schema.ResourceData, meta interface{}) return nil } -func ResourceOutscaleOAPIPublicIPUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscalePublicIPUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI vVm, okInstance := d.GetOk("vm_id") @@ -185,7 +185,7 @@ func ResourceOutscaleOAPIPublicIPUpdate(d *schema.ResourceData, meta interface{} if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPIPublicIPRead(d, meta) + return ResourceOutscalePublicIPRead(d, meta) } func unlinkPublicIp(conn *oscgo.APIClient, publicIpId *string) error { @@ -202,10 +202,10 @@ func unlinkPublicIp(conn *oscgo.APIClient, publicIpId *string) error { return err } -func ResourceOutscaleOAPIPublicIPDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscalePublicIPDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI - if err := ResourceOutscaleOAPIPublicIPRead(d, meta); err != nil { + if err := ResourceOutscalePublicIPRead(d, meta); err != nil { return err } if d.Id() == "" { @@ -218,7 +218,7 @@ func ResourceOutscaleOAPIPublicIPDelete(d *schema.ResourceData, meta interface{} if (okInstance && vInstance.(string) != "") || (okAssociationID && linkPublicIPID.(string) != "") { log.Printf("[DEBUG] Disassociating EIP: %s", d.Id()) var err error - switch ResourceOutscaleOAPIPublicIPDomain(d) { + switch ResourceOutscalePublicIPDomain(d) { case "vpc": linIpId := d.Get("link_public_ip_id").(string) err = unlinkPublicIp(conn, &linIpId) @@ -289,7 +289,7 @@ func getOAPIPublicIPSchema() map[string]*schema.Schema { } } -func ResourceOutscaleOAPIPublicIPDomain(d *schema.ResourceData) string { +func ResourceOutscalePublicIPDomain(d *schema.ResourceData) string { if v, ok := d.GetOk("placement"); ok { return v.(string) } else if strings.Contains(d.Id(), "eipalloc") { diff --git a/outscale/resource_outscale_public_ip_link.go b/outscale/resource_outscale_public_ip_link.go index 7d4c08772..cd3995877 100644 --- a/outscale/resource_outscale_public_ip_link.go +++ b/outscale/resource_outscale_public_ip_link.go @@ -14,11 +14,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIPublicIPLink() *schema.Resource { +func ResourceOutscalePublicIPLink() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIPublicIPLinkCreate, - Read: ResourceOutscaleOAPIPublicIPLinkRead, - Delete: ResourceOutscaleOAPIPublicIPLinkDelete, + Create: ResourceOutscalePublicIPLinkCreate, + Read: ResourceOutscalePublicIPLinkRead, + Delete: ResourceOutscalePublicIPLinkDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -32,7 +32,7 @@ func ResourceOutscaleOAPIPublicIPLink() *schema.Resource { } } -func ResourceOutscaleOAPIPublicIPLinkCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscalePublicIPLinkCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI request := oscgo.LinkPublicIpRequest{} @@ -72,7 +72,7 @@ func ResourceOutscaleOAPIPublicIPLinkCreate(d *schema.ResourceData, meta interfa }) if err != nil { - log.Printf("[WARN] ERROR ResourceOutscaleOAPIPublicIPLinkCreate (%s)", err) + log.Printf("[WARN] ERROR ResourceOutscalePublicIPLinkCreate (%s)", err) return err } //Using validation with request. @@ -82,10 +82,10 @@ func ResourceOutscaleOAPIPublicIPLinkCreate(d *schema.ResourceData, meta interfa d.SetId(request.GetPublicIp()) } - return ResourceOutscaleOAPIPublicIPLinkRead(d, meta) + return ResourceOutscalePublicIPLinkRead(d, meta) } -func ResourceOutscaleOAPIPublicIPLinkRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscalePublicIPLinkRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Id() @@ -118,7 +118,7 @@ func ResourceOutscaleOAPIPublicIPLinkRead(d *schema.ResourceData, meta interface }) if err != nil { - log.Printf("[WARN] ERROR ResourceOutscaleOAPIPublicIPLinkRead (%s)", err) + log.Printf("[WARN] ERROR ResourceOutscalePublicIPLinkRead (%s)", err) return fmt.Errorf("Error reading Outscale VM Public IP %s: %#v", d.Get("public_ip_id").(string), err) } if utils.IsResponseEmpty(len(response.GetPublicIps()), "PublicIpLink", d.Id()) { @@ -130,10 +130,10 @@ func ResourceOutscaleOAPIPublicIPLinkRead(d *schema.ResourceData, meta interface return err } - return readOutscaleOAPIPublicIPLink(d, &response.GetPublicIps()[0]) + return readOutscalePublicIPLink(d, &response.GetPublicIps()[0]) } -func ResourceOutscaleOAPIPublicIPLinkDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscalePublicIPLinkDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI linkID := d.Get("link_public_ip_id") @@ -152,14 +152,14 @@ func ResourceOutscaleOAPIPublicIPLinkDelete(d *schema.ResourceData, meta interfa }) if err != nil { - log.Printf("[WARN] ERROR ResourceOutscaleOAPIPublicIPLinkDelete (%s)", err) + log.Printf("[WARN] ERROR ResourceOutscalePublicIPLinkDelete (%s)", err) return fmt.Errorf("Error deleting Elastic IP association: %s", err) } return nil } -func readOutscaleOAPIPublicIPLink(d *schema.ResourceData, address *oscgo.PublicIp) error { +func readOutscalePublicIPLink(d *schema.ResourceData, address *oscgo.PublicIp) error { // if err := d.Set("public_ip_id", address.ReservationId); err != nil { // log.Printf("[WARN] ERROR readOutscalePublicIPLink1 (%s)", err) @@ -181,31 +181,31 @@ func readOutscaleOAPIPublicIPLink(d *schema.ResourceData, address *oscgo.PublicI return err } if err := d.Set("public_ip", address.GetPublicIp()); err != nil { - fmt.Printf("[WARN] ERROR readOutscaleOAPIPublicIPLink (%s)", err) + fmt.Printf("[WARN] ERROR readOutscalePublicIPLink (%s)", err) return err } if err := d.Set("link_public_ip_id", address.GetLinkPublicIpId()); err != nil { - fmt.Printf("[WARN] ERROR readOutscaleOAPIPublicIPLink (%s)", err) + fmt.Printf("[WARN] ERROR readOutscalePublicIPLink (%s)", err) return err } if err := d.Set("nic_account_id", address.GetNicAccountId()); err != nil { - fmt.Printf("[WARN] ERROR readOutscaleOAPIPublicIPLink (%s)", err) + fmt.Printf("[WARN] ERROR readOutscalePublicIPLink (%s)", err) return err } if err := d.Set("public_ip_id", address.GetPublicIpId()); err != nil { - fmt.Printf("[WARN] ERROR readOutscaleOAPIPublicIPLink (%s)", err) + fmt.Printf("[WARN] ERROR readOutscalePublicIPLink (%s)", err) return err } if err := d.Set("tags", tagsOSCAPIToMap(address.GetTags())); err != nil { - fmt.Printf("[WARN] ERROR readOutscaleOAPIPublicIPLink TAGS PROBLEME (%s)", err) + fmt.Printf("[WARN] ERROR readOutscalePublicIPLink TAGS PROBLEME (%s)", err) } return nil diff --git a/outscale/resource_outscale_public_ip_link_test.go b/outscale/resource_outscale_public_ip_link_test.go index 55cb450b7..f5b5d201e 100644 --- a/outscale/resource_outscale_public_ip_link_test.go +++ b/outscale/resource_outscale_public_ip_link_test.go @@ -25,14 +25,14 @@ func TestAccVM_WithPublicIPLink_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIPublicIPLinkDestroy, + CheckDestroy: testAccCheckOutscalePublicIPLinkDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIPublicIPLinkConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), + Config: testAccOutscalePublicIPLinkConfig(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIPublicIPLExists( + testAccCheckOutscalePublicIPLExists( "outscale_public_ip.ip_link", &a), - testAccCheckOutscaleOAPIPublicIPLinkExists( + testAccCheckOutscalePublicIPLinkExists( "outscale_public_ip_link.by_public_ip", &a), ), }, @@ -40,7 +40,7 @@ func TestAccVM_WithPublicIPLink_basic(t *testing.T) { }) } -func testAccCheckOutscaleOAPIPublicIPLinkExists(name string, res *oscgo.PublicIp) resource.TestCheckFunc { +func testAccCheckOutscalePublicIPLinkExists(name string, res *oscgo.PublicIp) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] if !ok { @@ -69,7 +69,7 @@ func testAccCheckOutscaleOAPIPublicIPLinkExists(name string, res *oscgo.PublicIp }) if err != nil { - log.Printf("[DEBUG] ERROR testAccCheckOutscaleOAPIPublicIPLinkExists (%s)", err) + log.Printf("[DEBUG] ERROR testAccCheckOutscalePublicIPLinkExists (%s)", err) return err } @@ -87,7 +87,7 @@ func testAccCheckOutscaleOAPIPublicIPLinkExists(name string, res *oscgo.PublicIp } } -func testAccCheckOutscaleOAPIPublicIPLinkDestroy(s *terraform.State) error { +func testAccCheckOutscalePublicIPLinkDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "outscale_public_ip_link" { continue @@ -117,7 +117,7 @@ func testAccCheckOutscaleOAPIPublicIPLinkDestroy(s *terraform.State) error { }) if err != nil { - log.Printf("[DEBUG] ERROR testAccCheckOutscaleOAPIPublicIPLinkDestroy (%s)", err) + log.Printf("[DEBUG] ERROR testAccCheckOutscalePublicIPLinkDestroy (%s)", err) return err } @@ -128,7 +128,7 @@ func testAccCheckOutscaleOAPIPublicIPLinkDestroy(s *terraform.State) error { return nil } -func testAccCheckOutscaleOAPIPublicIPLExists(n string, res *oscgo.PublicIp) resource.TestCheckFunc { +func testAccCheckOutscalePublicIPLExists(n string, res *oscgo.PublicIp) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -210,7 +210,7 @@ func testAccCheckOutscaleOAPIPublicIPLExists(n string, res *oscgo.PublicIp) reso } } -func testAccOutscaleOAPIPublicIPLinkConfig(omi, vmType, region, keypair string) string { +func testAccOutscalePublicIPLinkConfig(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_link" { security_group_name = "%[4]s" diff --git a/outscale/resource_outscale_public_ip_test.go b/outscale/resource_outscale_public_ip_test.go index 2df5d8b5d..d90530a93 100644 --- a/outscale/resource_outscale_public_ip_test.go +++ b/outscale/resource_outscale_public_ip_test.go @@ -24,13 +24,13 @@ func TestAccOthers_PublicIP_basic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_public_ip.bar", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIPublicIPDestroy, + CheckDestroy: testAccCheckOutscalePublicIPDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIPublicIPConfig, + Config: testAccOutscalePublicIPConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIPublicIPExists("outscale_public_ip.bar", &conf), - testAccCheckOutscaleOAPIPublicIPAttributes(&conf), + testAccCheckOutscalePublicIPExists("outscale_public_ip.bar", &conf), + testAccCheckOutscalePublicIPAttributes(&conf), ), }, }, @@ -49,13 +49,13 @@ func TestAccVM_PublicIP_instance(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_public_ip.bar1", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIPublicIPDestroy, + CheckDestroy: testAccCheckOutscalePublicIPDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIPublicIPInstanceConfig(omi, "tinav4.c2r2p2", region, keypair), + Config: testAccOutscalePublicIPInstanceConfig(omi, "tinav4.c2r2p2", region, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIPublicIPExists("outscale_public_ip.bar1", &conf), - testAccCheckOutscaleOAPIPublicIPAttributes(&conf), + testAccCheckOutscalePublicIPExists("outscale_public_ip.bar1", &conf), + testAccCheckOutscalePublicIPAttributes(&conf), ), }, }, @@ -74,27 +74,27 @@ func TestAccNet_PublicIP_associated_user_private_ip(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "outscale_public_ip.bar", Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIPublicIPDestroy, + CheckDestroy: testAccCheckOutscalePublicIPDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIPublicIPInstanceConfigAssociated(omi, "tinav4.c2r2p2", region, keypair), + Config: testAccOutscalePublicIPInstanceConfigAssociated(omi, "tinav4.c2r2p2", region, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIPublicIPExists("outscale_public_ip.bar", &one), - testAccCheckOutscaleOAPIPublicIPAttributes(&one), + testAccCheckOutscalePublicIPExists("outscale_public_ip.bar", &one), + testAccCheckOutscalePublicIPAttributes(&one), ), }, { - Config: testAccOutscaleOAPIPublicIPInstanceConfigAssociatedSwitch(omi, "tinav4.c2r2p2", region, keypair), + Config: testAccOutscalePublicIPInstanceConfigAssociatedSwitch(omi, "tinav4.c2r2p2", region, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIPublicIPExists("outscale_public_ip.bar", &one), - testAccCheckOutscaleOAPIPublicIPAttributes(&one), + testAccCheckOutscalePublicIPExists("outscale_public_ip.bar", &one), + testAccCheckOutscalePublicIPAttributes(&one), ), }, }, }) } -func testAccCheckOutscaleOAPIPublicIPDestroy(s *terraform.State) error { +func testAccCheckOutscalePublicIPDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient) for _, rs := range s.RootModule().Resources { @@ -165,7 +165,7 @@ func testAccCheckOutscaleOAPIPublicIPDestroy(s *terraform.State) error { return nil } -func testAccCheckOutscaleOAPIPublicIPAttributes(conf *oscgo.PublicIp) resource.TestCheckFunc { +func testAccCheckOutscalePublicIPAttributes(conf *oscgo.PublicIp) resource.TestCheckFunc { return func(s *terraform.State) error { if conf.GetPublicIp() == "" { return fmt.Errorf("empty public_ip") @@ -175,7 +175,7 @@ func testAccCheckOutscaleOAPIPublicIPAttributes(conf *oscgo.PublicIp) resource.T } } -func testAccCheckOutscaleOAPIPublicIPExists(n string, res *oscgo.PublicIp) resource.TestCheckFunc { +func testAccCheckOutscalePublicIPExists(n string, res *oscgo.PublicIp) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -249,7 +249,7 @@ func testAccCheckOutscaleOAPIPublicIPExists(n string, res *oscgo.PublicIp) resou } } -const testAccOutscaleOAPIPublicIPConfig = ` +const testAccOutscalePublicIPConfig = ` resource "outscale_public_ip" "bar" { tags { key = "Name" @@ -258,7 +258,7 @@ resource "outscale_public_ip" "bar" { } ` -func testAccOutscaleOAPIPublicIPInstanceConfig(omi, vmType, region, keypair string) string { +func testAccOutscalePublicIPInstanceConfig(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_ip" { security_group_name = "sg_publicIp" @@ -287,7 +287,7 @@ func testAccOutscaleOAPIPublicIPInstanceConfig(omi, vmType, region, keypair stri `, omi, vmType, region, keypair) } -func testAccOutscaleOAPIPublicIPInstanceConfigAssociated(omi, vmType, region, keypair string) string { +func testAccOutscalePublicIPInstanceConfigAssociated(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_security_group" "sgIP" { security_group_name = "%[4]s" @@ -319,7 +319,7 @@ func testAccOutscaleOAPIPublicIPInstanceConfigAssociated(omi, vmType, region, ke `, omi, vmType, region, keypair) } -func testAccOutscaleOAPIPublicIPInstanceConfigAssociatedSwitch(omi, vmType, region, keypair string) string { +func testAccOutscalePublicIPInstanceConfigAssociatedSwitch(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_security_group" "sgIP" { security_group_name = "%[4]s" diff --git a/outscale/resource_outscale_route.go b/outscale/resource_outscale_route.go index 50743f111..e51181918 100644 --- a/outscale/resource_outscale_route.go +++ b/outscale/resource_outscale_route.go @@ -27,15 +27,15 @@ var allowedTargets = []string{ "net_peering_id", } -func ResourceOutscaleOAPIRoute() *schema.Resource { +func ResourceOutscaleRoute() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIRouteCreate, - Read: ResourceOutscaleOAPIRouteRead, - Update: ResourceOutscaleOAPIRouteUpdate, - Delete: ResourceOutscaleOAPIRouteDelete, - Exists: ResourceOutscaleOAPIRouteExists, + Create: ResourceOutscaleRouteCreate, + Read: ResourceOutscaleRouteRead, + Update: ResourceOutscaleRouteUpdate, + Delete: ResourceOutscaleRouteDelete, + Exists: ResourceOutscaleRouteExists, Importer: &schema.ResourceImporter{ - State: ResourceOutscaleOAPIRouteImportState, + State: ResourceOutscaleRouteImportState, }, Schema: map[string]*schema.Schema{ "creation_method": { @@ -107,7 +107,7 @@ func ResourceOutscaleOAPIRoute() *schema.Resource { } } -func ResourceOutscaleOAPIRouteCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI numTargets, target := getTarget(d) awaitActiveState := d.Get("await_active_state").(bool) @@ -178,10 +178,10 @@ func ResourceOutscaleOAPIRouteCreate(d *schema.ResourceData, meta interface{}) e } } d.SetId(d.Get("route_table_id").(string) + "_" + d.Get("destination_ip_range").(string)) - return ResourceOutscaleOAPIRouteSetResourceData(d, route, requestID) + return ResourceOutscaleRouteSetResourceData(d, route, requestID) } -func ResourceOutscaleOAPIRouteRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI routeTableID := d.Get("route_table_id").(string) @@ -197,10 +197,10 @@ func ResourceOutscaleOAPIRouteRead(d *schema.ResourceData, meta interface{}) err d.SetId("") return nil } - return ResourceOutscaleOAPIRouteSetResourceData(d, route, requestID) + return ResourceOutscaleRouteSetResourceData(d, route, requestID) } -func ResourceOutscaleOAPIRouteSetResourceData(d *schema.ResourceData, route *oscgo.Route, requestID string) error { +func ResourceOutscaleRouteSetResourceData(d *schema.ResourceData, route *oscgo.Route, requestID string) error { if err := d.Set("destination_service_id", route.GetDestinationServiceId()); err != nil { return err } @@ -249,7 +249,7 @@ func getTarget(d *schema.ResourceData) (n int, target string) { return } -func ResourceOutscaleOAPIRouteUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI nothingToDo := true o, n := d.GetChange("") @@ -326,10 +326,10 @@ func ResourceOutscaleOAPIRouteUpdate(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("error updating route: %s", utils.GetErrorResponse(err)) } - return ResourceOutscaleOAPIRouteRead(d, meta) + return ResourceOutscaleRouteRead(d, meta) } -func ResourceOutscaleOAPIRouteDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI deleteOpts := oscgo.DeleteRouteRequest{ @@ -361,7 +361,7 @@ func ResourceOutscaleOAPIRouteDelete(d *schema.ResourceData, meta interface{}) e return nil } -func ResourceOutscaleOAPIRouteExists(d *schema.ResourceData, meta interface{}) (bool, error) { +func ResourceOutscaleRouteExists(d *schema.ResourceData, meta interface{}) (bool, error) { conn := meta.(*OutscaleClient).OSCAPI routeTableID := d.Get("route_table_id").(string) @@ -463,7 +463,7 @@ func findResourceOAPIRoute(conn *oscgo.APIClient, rtbid string, cidr string) (*o } -func ResourceOutscaleOAPIRouteImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { +func ResourceOutscaleRouteImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { conn := meta.(*OutscaleClient).OSCAPI parts := strings.SplitN(d.Id(), "_", 2) diff --git a/outscale/resource_outscale_route_table.go b/outscale/resource_outscale_route_table.go index a3e177994..e23d542dc 100644 --- a/outscale/resource_outscale_route_table.go +++ b/outscale/resource_outscale_route_table.go @@ -14,12 +14,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIRouteTable() *schema.Resource { +func ResourceOutscaleRouteTable() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIRouteTableCreate, - Read: ResourceOutscaleOAPIRouteTableRead, - Update: ResourceOutscaleOAPIRouteTableUpdate, - Delete: ResourceOutscaleOAPIRouteTableDelete, + Create: ResourceOutscaleRouteTableCreate, + Read: ResourceOutscaleRouteTableRead, + Update: ResourceOutscaleRouteTableUpdate, + Delete: ResourceOutscaleRouteTableDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -136,7 +136,7 @@ func ResourceOutscaleOAPIRouteTable() *schema.Resource { } } -func ResourceOutscaleOAPIRouteTableCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteTableCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI createOpts := oscgo.CreateRouteTableRequest{ @@ -168,7 +168,7 @@ func ResourceOutscaleOAPIRouteTableCreate(d *schema.ResourceData, meta interface stateConf := &resource.StateChangeConf{ Pending: []string{"pending"}, Target: []string{"ready"}, - Refresh: ResourceOutscaleOAPIRouteTableStateRefreshFunc(conn, d.Id()), + Refresh: ResourceOutscaleRouteTableStateRefreshFunc(conn, d.Id()), Timeout: 5 * time.Minute, } if _, err := stateConf.WaitForState(); err != nil { @@ -193,10 +193,10 @@ func ResourceOutscaleOAPIRouteTableCreate(d *schema.ResourceData, meta interface return err } - return ResourceOutscaleOAPIRouteTableRead(d, meta) + return ResourceOutscaleRouteTableRead(d, meta) } -func ResourceOutscaleOAPIRouteTableRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteTableRead(d *schema.ResourceData, meta interface{}) error { rtRaw, _, err := readOAPIRouteTable(meta.(*OutscaleClient).OSCAPI, d.Id()) if err != nil { return err @@ -230,16 +230,16 @@ func ResourceOutscaleOAPIRouteTableRead(d *schema.ResourceData, meta interface{} return nil } -func ResourceOutscaleOAPIRouteTableUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteTableUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPIRouteTableRead(d, meta) + return ResourceOutscaleRouteTableRead(d, meta) } -func ResourceOutscaleOAPIRouteTableDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleRouteTableDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI rtRaw, _, err := readOAPIRouteTable(meta.(*OutscaleClient).OSCAPI, d.Id()) @@ -303,7 +303,7 @@ func ResourceOutscaleOAPIRouteTableDelete(d *schema.ResourceData, meta interface stateConf := &resource.StateChangeConf{ Pending: []string{"ready"}, Target: []string{}, - Refresh: ResourceOutscaleOAPIRouteTableStateRefreshFunc(conn, d.Id()), + Refresh: ResourceOutscaleRouteTableStateRefreshFunc(conn, d.Id()), Timeout: 5 * time.Minute, } if _, err := stateConf.WaitForState(); err != nil { @@ -356,7 +356,7 @@ func readOAPIRouteTable(conn *oscgo.APIClient, routeTableID string, linkIds ...s return resp.GetRouteTables()[0], resp.ResponseContext.GetRequestId(), err } -func ResourceOutscaleOAPIRouteTableStateRefreshFunc(conn *oscgo.APIClient, routeTableID string, linkIds ...string) resource.StateRefreshFunc { +func ResourceOutscaleRouteTableStateRefreshFunc(conn *oscgo.APIClient, routeTableID string, linkIds ...string) resource.StateRefreshFunc { return func() (interface{}, string, error) { rtRaw, _, err := readOAPIRouteTable(conn, routeTableID, linkIds...) if rtRaw == nil { diff --git a/outscale/resource_outscale_route_table_link.go b/outscale/resource_outscale_route_table_link.go index 4090f6a60..31ea79428 100644 --- a/outscale/resource_outscale_route_table_link.go +++ b/outscale/resource_outscale_route_table_link.go @@ -18,13 +18,13 @@ const ( errorLinkRouteTableSetting = "error setting `%s` for Link Route Table (%s): %s" ) -func ResourceOutscaleOAPILinkRouteTable() *schema.Resource { +func ResourceOutscaleLinkRouteTable() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPILinkRouteTableCreate, - Read: ResourceOutscaleOAPILinkRouteTableRead, - Delete: ResourceOutscaleOAPILinkRouteTableDelete, + Create: ResourceOutscaleLinkRouteTableCreate, + Read: ResourceOutscaleLinkRouteTableRead, + Delete: ResourceOutscaleLinkRouteTableDelete, Importer: &schema.ResourceImporter{ - State: ResourceOutscaleOAPILinkRouteTableImportState, + State: ResourceOutscaleLinkRouteTableImportState, }, Schema: map[string]*schema.Schema{ "subnet_id": { @@ -53,7 +53,7 @@ func ResourceOutscaleOAPILinkRouteTable() *schema.Resource { } } -func ResourceOutscaleOAPILinkRouteTableCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinkRouteTableCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var resp oscgo.LinkRouteTableResponse var err error @@ -85,10 +85,10 @@ func ResourceOutscaleOAPILinkRouteTableCreate(d *schema.ResourceData, meta inter d.SetId(resp.GetLinkRouteTableId()) - return ResourceOutscaleOAPILinkRouteTableRead(d, meta) + return ResourceOutscaleLinkRouteTableRead(d, meta) } -func ResourceOutscaleOAPILinkRouteTableRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinkRouteTableRead(d *schema.ResourceData, meta interface{}) error { routeTableID := d.Get("route_table_id").(string) linkRTable, err := readOutscaleLinkRouteTable(meta.(*OutscaleClient), routeTableID, d.Id()) if err != nil { @@ -112,7 +112,7 @@ func ResourceOutscaleOAPILinkRouteTableRead(d *schema.ResourceData, meta interfa return nil } -func ResourceOutscaleOAPILinkRouteTableDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleLinkRouteTableDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI err := resource.Retry(5*time.Minute, func() *resource.RetryError { @@ -131,7 +131,7 @@ func ResourceOutscaleOAPILinkRouteTableDelete(d *schema.ResourceData, meta inter return nil } -func ResourceOutscaleOAPILinkRouteTableImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { +func ResourceOutscaleLinkRouteTableImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.SplitN(d.Id(), "_", 2) if len(parts) != 2 { return nil, errors.New("import format error: to import a Link Route Table, use the format {route_table_id}_{link_route_table_id}") diff --git a/outscale/resource_outscale_route_test.go b/outscale/resource_outscale_route_test.go index 106297980..8ac59b55b 100644 --- a/outscale/resource_outscale_route_test.go +++ b/outscale/resource_outscale_route_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccNet_OutscaleOAPIRoute_noopdiff(t *testing.T) { +func TestAccNet_OutscaleRoute_noopdiff(t *testing.T) { var route oscgo.Route resource.Test(t, resource.TestCase{ @@ -24,15 +24,15 @@ func TestAccNet_OutscaleOAPIRoute_noopdiff(t *testing.T) { CheckDestroy: testAccCheckOAPIOutscaleRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIRouteNoopChange, + Config: testAccOutscaleRouteNoopChange, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIRouteExists("outscale_route.test", &route), + testAccCheckOutscaleRouteExists("outscale_route.test", &route), ), }, { - Config: testAccOutscaleOAPIRouteNoopChange, + Config: testAccOutscaleRouteNoopChange, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIRouteExists("outscale_route.test", &route), + testAccCheckOutscaleRouteExists("outscale_route.test", &route), ), }, }, @@ -49,11 +49,11 @@ func TestAccNet_ImportRoute_Basic(t *testing.T) { CheckDestroy: testAccCheckOAPIOutscaleRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIRouteNoopChange, + Config: testAccOutscaleRouteNoopChange, }, { ResourceName: resourceName, - ImportStateIdFunc: testAccCheckOutscaleOAPIRouteImportStateIDFunc(resourceName), + ImportStateIdFunc: testAccCheckOutscaleRouteImportStateIDFunc(resourceName), ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"request_id", "await_active_state"}, @@ -71,11 +71,11 @@ func TestAccNet_Route_importWithNatService(t *testing.T) { CheckDestroy: testAccCheckOAPIOutscaleRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIRouteWithNatService, + Config: testAccOutscaleRouteWithNatService, }, { ResourceName: resourceName, - ImportStateIdFunc: testAccCheckOutscaleOAPIRouteImportStateIDFunc(resourceName), + ImportStateIdFunc: testAccCheckOutscaleRouteImportStateIDFunc(resourceName), ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"request_id", "await_active_state", "routes"}, /*we will remove 'routes' when autorefresh after link resources Ok*/ @@ -98,13 +98,13 @@ func TestAccNet_Route_changeTarget(t *testing.T) { { Config: computeConfigTestChangeTarget([]string{"nat_service_id"}), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIRouteExists("outscale_route.rtnatdef", &route), + testAccCheckOutscaleRouteExists("outscale_route.rtnatdef", &route), ), }, { Config: computeConfigTestChangeTarget([]string{"gateway_id"}), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIRouteExists("outscale_route.rtnatdef", &route), + testAccCheckOutscaleRouteExists("outscale_route.rtnatdef", &route), ), }, }, @@ -204,7 +204,7 @@ func TestAccNet_Route_onlyOneTarget(t *testing.T) { }) } -func testAccCheckOutscaleOAPIRouteImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { +func testAccCheckOutscaleRouteImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -214,7 +214,7 @@ func testAccCheckOutscaleOAPIRouteImportStateIDFunc(resourceName string) resourc } } -func testAccCheckOutscaleOAPIRouteExists(n string, res *oscgo.Route) resource.TestCheckFunc { +func testAccCheckOutscaleRouteExists(n string, res *oscgo.Route) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -267,7 +267,7 @@ func testAccCheckOAPIOutscaleRouteDestroy(s *terraform.State) error { return nil } -var testAccOutscaleOAPIRouteNoopChange = fmt.Sprint(` +var testAccOutscaleRouteNoopChange = fmt.Sprint(` resource "outscale_net" "test" { ip_range = "10.0.0.0/24" } @@ -290,7 +290,7 @@ var testAccOutscaleOAPIRouteNoopChange = fmt.Sprint(` } `) -var testAccOutscaleOAPIRouteWithNatService = fmt.Sprint(` +var testAccOutscaleRouteWithNatService = fmt.Sprint(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" tags { @@ -382,10 +382,10 @@ func computeConfigTestChangeTarget(targets []string) string { } } - return fmt.Sprintf(testAccOutscaleOAPIRouteTemplateChangeTarget, strings.Join(extra_configs, "\n")) + return fmt.Sprintf(testAccOutscaleRouteTemplateChangeTarget, strings.Join(extra_configs, "\n")) } -var testAccOutscaleOAPIRouteTemplateChangeTarget = ` +var testAccOutscaleRouteTemplateChangeTarget = ` resource "outscale_net" "net" { ip_range = "10.0.0.0/16" tags { diff --git a/outscale/resource_outscale_security_group.go b/outscale/resource_outscale_security_group.go index fdb488dcb..0ed5d3571 100644 --- a/outscale/resource_outscale_security_group.go +++ b/outscale/resource_outscale_security_group.go @@ -14,12 +14,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPISecurityGroup() *schema.Resource { +func ResourceOutscaleSecurityGroup() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPISecurityGroupCreate, - Read: ResourceOutscaleOAPISecurityGroupRead, - Delete: ResourceOutscaleOAPISecurityGroupDelete, - Update: ResourceOutscaleOAPISecurityGroupUpdate, + Create: ResourceOutscaleSecurityGroupCreate, + Read: ResourceOutscaleSecurityGroupRead, + Delete: ResourceOutscaleSecurityGroupDelete, + Update: ResourceOutscaleSecurityGroupUpdate, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -114,7 +114,7 @@ func getOAPIIPPerms() *schema.Schema { } } -func ResourceOutscaleOAPISecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI securityGroupOpts := oscgo.CreateSecurityGroupRequest{} @@ -216,10 +216,10 @@ func ResourceOutscaleOAPISecurityGroupCreate(d *schema.ResourceData, meta interf return err } } - return ResourceOutscaleOAPISecurityGroupRead(d, meta) + return ResourceOutscaleSecurityGroupRead(d, meta) } -func ResourceOutscaleOAPISecurityGroupRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSecurityGroupRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI sg, _, err := readSecurityGroups(conn, d.Id()) @@ -262,7 +262,7 @@ func ResourceOutscaleOAPISecurityGroupRead(d *schema.ResourceData, meta interfac return d.Set("outbound_rules", flattenOAPISecurityGroupRule(sg.GetOutboundRules())) } -func ResourceOutscaleOAPISecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSecurityGroupDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI log.Printf("[DEBUG] Security Group destroy: %v", d.Id()) @@ -294,13 +294,13 @@ func SGOAPIStateRefreshFunc(conn *oscgo.APIClient, id string) resource.StateRefr } } -func ResourceOutscaleOAPISecurityGroupUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPISecurityGroupRead(d, meta) + return ResourceOutscaleSecurityGroupRead(d, meta) } func readSecurityGroups(client *oscgo.APIClient, securityGroupID string) (*oscgo.SecurityGroup, *oscgo.ReadSecurityGroupsResponse, error) { diff --git a/outscale/resource_outscale_security_group_rule.go b/outscale/resource_outscale_security_group_rule.go index a5c0c78ba..4efd0c839 100644 --- a/outscale/resource_outscale_security_group_rule.go +++ b/outscale/resource_outscale_security_group_rule.go @@ -18,13 +18,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) -func ResourceOutscaleOAPIOutboundRule() *schema.Resource { +func ResourceOutscaleOutboundRule() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIOutboundRuleCreate, - Read: ResourceOutscaleOAPIOutboundRuleRead, - Delete: ResourceOutscaleOAPIOutboundRuleDelete, + Create: ResourceOutscaleOutboundRuleCreate, + Read: ResourceOutscaleOutboundRuleRead, + Delete: ResourceOutscaleOutboundRuleDelete, Importer: &schema.ResourceImporter{ - State: ResourceOutscaleOAPISecurityGroupRuleImportState, + State: ResourceOutscaleSecurityGroupRuleImportState, }, Schema: map[string]*schema.Schema{ "flow": { @@ -87,7 +87,7 @@ func ResourceOutscaleOAPIOutboundRule() *schema.Resource { } } -func ResourceOutscaleOAPIOutboundRuleCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleOutboundRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.CreateSecurityGroupRuleRequest{ @@ -133,10 +133,10 @@ func ResourceOutscaleOAPIOutboundRuleCreate(d *schema.ResourceData, meta interfa d.SetId(*resp.GetSecurityGroup().SecurityGroupId) - return ResourceOutscaleOAPIOutboundRuleRead(d, meta) + return ResourceOutscaleOutboundRuleRead(d, meta) } -func ResourceOutscaleOAPIOutboundRuleRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleOutboundRuleRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI sg, _, err := readSecurityGroups(conn, d.Id()) @@ -159,7 +159,7 @@ func ResourceOutscaleOAPIOutboundRuleRead(d *schema.ResourceData, meta interface return nil } -func ResourceOutscaleOAPIOutboundRuleDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleOutboundRuleDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.DeleteSecurityGroupRuleRequest{ @@ -391,7 +391,7 @@ func getRulesSchema(isForAttr bool) *schema.Schema { } } -func ResourceOutscaleOAPISecurityGroupRuleImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { +func ResourceOutscaleSecurityGroupRuleImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { // example: sg-53173ec7_inbound_tcp_80_80_80.14.129.222/32 // example: sg-53173ec7_inbound_tcp_80_80_sg-53173ec7 diff --git a/outscale/resource_outscale_security_group_rule_test.go b/outscale/resource_outscale_security_group_rule_test.go index 882a0e5ca..c406c845b 100644 --- a/outscale/resource_outscale_security_group_rule_test.go +++ b/outscale/resource_outscale_security_group_rule_test.go @@ -27,19 +27,19 @@ func TestAccOthers_SecurityGroupRule_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPISecurityGroupRuleDestroy, + CheckDestroy: testAccCheckOutscaleSecurityGroupRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISecurityGroupRuleEgressConfig(rInt), + Config: testAccOutscaleSecurityGroupRuleEgressConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIRuleExists(resourceName, &group), - testAccCheckOutscaleOAPIRuleAttributes(resourceName, &group, nil, "Inbound"), + testAccCheckOutscaleRuleExists(resourceName, &group), + testAccCheckOutscaleRuleAttributes(resourceName, &group, nil, "Inbound"), ), }, { ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccCheckOutscaleOAPIRuleImportStateIDFunc(resourceName), + ImportStateIdFunc: testAccCheckOutscaleRuleImportStateIDFunc(resourceName), ImportStateVerify: true, ImportStateVerifyIgnore: []string{"request_id"}, }, @@ -74,16 +74,16 @@ func TestAccOthers_SecurityGroupRule_withSecurityGroupMember(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPISecurityGroupRuleDestroy, + CheckDestroy: testAccCheckOutscaleSecurityGroupRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISecurityGroupRuleWithGroupMembers(rInt, accountID), + Config: testAccOutscaleSecurityGroupRuleWithGroupMembers(rInt, accountID), }, }, }) } -func testAccCheckOutscaleOAPISecurityGroupRuleDestroy(s *terraform.State) error { +func testAccCheckOutscaleSecurityGroupRuleDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI for _, rs := range s.RootModule().Resources { @@ -99,7 +99,7 @@ func testAccCheckOutscaleOAPISecurityGroupRuleDestroy(s *terraform.State) error return nil } -func testAccCheckOutscaleOAPIRuleAttributes(n string, group *oscgo.SecurityGroup, p *oscgo.SecurityGroupRule, ruleType string) resource.TestCheckFunc { +func testAccCheckOutscaleRuleAttributes(n string, group *oscgo.SecurityGroup, p *oscgo.SecurityGroupRule, ruleType string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -197,7 +197,7 @@ func testAccCheckOutscaleOAPIRuleAttributes(n string, group *oscgo.SecurityGroup } } -func testAccCheckOutscaleOAPIRuleExists(n string, group *oscgo.SecurityGroup) resource.TestCheckFunc { +func testAccCheckOutscaleRuleExists(n string, group *oscgo.SecurityGroup) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -239,7 +239,7 @@ func testAccCheckOutscaleOAPIRuleExists(n string, group *oscgo.SecurityGroup) re } } -func testAccCheckOutscaleOAPIRuleImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { +func testAccCheckOutscaleRuleImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -249,7 +249,7 @@ func testAccCheckOutscaleOAPIRuleImportStateIDFunc(resourceName string) resource } } -func testAccOutscaleOAPISecurityGroupRuleEgressConfig(rInt int) string { +func testAccOutscaleSecurityGroupRuleEgressConfig(rInt int) string { return fmt.Sprintf(` resource "outscale_security_group_rule" "outscale_security_group_rule" { flow = "Inbound" @@ -276,7 +276,7 @@ func testAccOutscaleOAPISecurityGroupRuleEgressConfig(rInt int) string { `, rInt) } -func testAccOutscaleOAPISecurityGroupRuleWithGroupMembers(rInt int, accountID string) string { +func testAccOutscaleSecurityGroupRuleWithGroupMembers(rInt int, accountID string) string { return fmt.Sprintf(` resource "outscale_security_group" "outscale_security_group" { description = "test group" diff --git a/outscale/resource_outscale_security_group_test.go b/outscale/resource_outscale_security_group_test.go index 9b56b9144..738505d5f 100644 --- a/outscale/resource_outscale_security_group_test.go +++ b/outscale/resource_outscale_security_group_test.go @@ -18,12 +18,12 @@ func TestAccNet_WithSecurityGroup(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPISGRuleDestroy, + CheckDestroy: testAccCheckOutscaleSGRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISecurityGroupConfig(rInt), + Config: testAccOutscaleSecurityGroupConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISecurityGroupRuleExists("outscale_security_group.web", &group), + testAccCheckOutscaleSecurityGroupRuleExists("outscale_security_group.web", &group), resource.TestCheckResourceAttr( "outscale_security_group.web", "security_group_name", fmt.Sprintf("terraform_test_%d", rInt)), ), @@ -32,7 +32,7 @@ func TestAccNet_WithSecurityGroup(t *testing.T) { }) } -func testAccCheckOutscaleOAPISGRuleDestroy(s *terraform.State) error { +func testAccCheckOutscaleSGRuleDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI for _, rs := range s.RootModule().Resources { @@ -48,7 +48,7 @@ func testAccCheckOutscaleOAPISGRuleDestroy(s *terraform.State) error { return nil } -func testAccCheckOutscaleOAPISecurityGroupRuleExists(n string, group *oscgo.SecurityGroup) resource.TestCheckFunc { +func testAccCheckOutscaleSecurityGroupRuleExists(n string, group *oscgo.SecurityGroup) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI @@ -69,7 +69,7 @@ func testAccCheckOutscaleOAPISecurityGroupRuleExists(n string, group *oscgo.Secu } } -func testAccOutscaleOAPISecurityGroupConfig(rInt int) string { +func testAccOutscaleSecurityGroupConfig(rInt int) string { return fmt.Sprintf(` resource "outscale_net" "net" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_server_certificate.go b/outscale/resource_outscale_server_certificate.go index 1dd6ed1db..ed14daac0 100644 --- a/outscale/resource_outscale_server_certificate.go +++ b/outscale/resource_outscale_server_certificate.go @@ -13,12 +13,12 @@ import ( "github.com/spf13/cast" ) -func ResourceOutscaleOAPIServerCertificate() *schema.Resource { +func ResourceOutscaleServerCertificate() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIServerCertificateCreate, - Read: ResourceOutscaleOAPIServerCertificateRead, - Update: ResourceOutscaleOAPIServerCertificateUpdate, - Delete: ResourceOutscaleOAPIServerCertificateDelete, + Create: ResourceOutscaleServerCertificateCreate, + Read: ResourceOutscaleServerCertificateRead, + Update: ResourceOutscaleServerCertificateUpdate, + Delete: ResourceOutscaleServerCertificateDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -70,7 +70,7 @@ func ResourceOutscaleOAPIServerCertificate() *schema.Resource { } } -func ResourceOutscaleOAPIServerCertificateCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleServerCertificateCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.CreateServerCertificateRequest{ @@ -112,10 +112,10 @@ func ResourceOutscaleOAPIServerCertificateCreate(d *schema.ResourceData, meta in d.SetId(cast.ToString(resp.ServerCertificate.Id)) - return ResourceOutscaleOAPIServerCertificateRead(d, meta) + return ResourceOutscaleServerCertificateRead(d, meta) } -func ResourceOutscaleOAPIServerCertificateRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleServerCertificateRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Id() @@ -164,7 +164,7 @@ func ResourceOutscaleOAPIServerCertificateRead(d *schema.ResourceData, meta inte return nil } -func ResourceOutscaleOAPIServerCertificateUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleServerCertificateUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI oldName, _ := d.GetChange("name") @@ -191,10 +191,10 @@ func ResourceOutscaleOAPIServerCertificateUpdate(d *schema.ResourceData, meta in return fmt.Errorf("[DEBUG] Error update Server Certificate: %s", utils.GetErrorResponse(err)) } - return ResourceOutscaleOAPIServerCertificateRead(d, meta) + return ResourceOutscaleServerCertificateRead(d, meta) } -func ResourceOutscaleOAPIServerCertificateDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleServerCertificateDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.DeleteServerCertificateRequest{ diff --git a/outscale/resource_outscale_server_certificate_test.go b/outscale/resource_outscale_server_certificate_test.go index f04a096f7..ad9d87254 100644 --- a/outscale/resource_outscale_server_certificate_test.go +++ b/outscale/resource_outscale_server_certificate_test.go @@ -108,13 +108,13 @@ kbcI5Y2wveEgMqPSRya2OapYGiPeqYhg6JAGPRXtOfOq9IUDcPuc2emnihNpSa8y CheckDestroy: testAccCheckOutscaleServerCertificateDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIServerCertificateConfig(rName, body, private), + Config: testAccOutscaleServerCertificateConfig(rName, body, private), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleServerCertificateExists(resourceName), ), }, { - Config: testAccOutscaleOAPIServerCertificateConfig(rNameUpdated, body, private), + Config: testAccOutscaleServerCertificateConfig(rNameUpdated, body, private), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleServerCertificateExists(resourceName), ), @@ -208,7 +208,7 @@ func testAccCheckOutscaleServerCertificateDestroy(s *terraform.State) error { return nil } -func testAccOutscaleOAPIServerCertificateConfig(name, body, privateKey string) string { +func testAccOutscaleServerCertificateConfig(name, body, privateKey string) string { return fmt.Sprintf(` resource "outscale_server_certificate" "test" { name = %[1]q diff --git a/outscale/resource_outscale_snapshot.go b/outscale/resource_outscale_snapshot.go index 6085a6a81..bb9048c4a 100644 --- a/outscale/resource_outscale_snapshot.go +++ b/outscale/resource_outscale_snapshot.go @@ -14,12 +14,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPISnapshot() *schema.Resource { +func ResourceOutscaleSnapshot() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPISnapshotCreate, - Read: ResourceOutscaleOAPISnapshotRead, - Update: ResourceOutscaleOAPISnapshotUpdate, - Delete: ResourceOutscaleOAPISnapshotDelete, + Create: ResourceOutscaleSnapshotCreate, + Read: ResourceOutscaleSnapshotRead, + Update: ResourceOutscaleSnapshotUpdate, + Delete: ResourceOutscaleSnapshotDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -115,7 +115,7 @@ func ResourceOutscaleOAPISnapshot() *schema.Resource { } } -func ResourceOutscaleOAPISnapshotCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSnapshotCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI v, ok := d.GetOk("volume_id") @@ -191,10 +191,10 @@ func ResourceOutscaleOAPISnapshotCreate(d *schema.ResourceData, meta interface{} d.SetId(resp.Snapshot.GetSnapshotId()) - return ResourceOutscaleOAPISnapshotRead(d, meta) + return ResourceOutscaleSnapshotRead(d, meta) } -func ResourceOutscaleOAPISnapshotRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSnapshotRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.ReadSnapshotsRequest{ @@ -259,16 +259,16 @@ func ResourceOutscaleOAPISnapshotRead(d *schema.ResourceData, meta interface{}) }) } -func ResourceOutscaleOAPISnapshotUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSnapshotUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { return err } - return ResourceOutscaleOAPISnapshotRead(d, meta) + return ResourceOutscaleSnapshotRead(d, meta) } -func ResourceOutscaleOAPISnapshotDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSnapshotDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI return resource.Retry(5*time.Minute, func() *resource.RetryError { diff --git a/outscale/resource_outscale_snapshot_attributes.go b/outscale/resource_outscale_snapshot_attributes.go index 5775d8443..f8ade8604 100644 --- a/outscale/resource_outscale_snapshot_attributes.go +++ b/outscale/resource_outscale_snapshot_attributes.go @@ -12,11 +12,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func resourcedOutscaleOAPISnapshotAttributes() *schema.Resource { +func resourcedOutscaleSnapshotAttributes() *schema.Resource { return &schema.Resource{ - Create: resourcedOutscaleOAPISnapshotAttributesCreate, - Read: resourcedOutscaleOAPISnapshotAttributesRead, - Delete: resourcedOutscaleOAPISnapshotAttributesDelete, + Create: resourcedOutscaleSnapshotAttributesCreate, + Read: resourcedOutscaleSnapshotAttributesRead, + Delete: resourcedOutscaleSnapshotAttributesDelete, Schema: map[string]*schema.Schema{ "permissions_to_create_volume_additions": { @@ -73,7 +73,7 @@ func resourcedOutscaleOAPISnapshotAttributes() *schema.Resource { } } -func resourcedOutscaleOAPISnapshotAttributesCreate(d *schema.ResourceData, meta interface{}) error { +func resourcedOutscaleSnapshotAttributesCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI snapshotID := d.Get("snapshot_id").(string) @@ -148,10 +148,10 @@ func resourcedOutscaleOAPISnapshotAttributesCreate(d *schema.ResourceData, meta } d.SetId(snapshotID) - return resourcedOutscaleOAPISnapshotAttributesRead(d, meta) + return resourcedOutscaleSnapshotAttributesRead(d, meta) } -func resourcedOutscaleOAPISnapshotAttributesRead(d *schema.ResourceData, meta interface{}) error { +func resourcedOutscaleSnapshotAttributesRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var resp oscgo.ReadSnapshotsResponse @@ -190,7 +190,7 @@ func resourcedOutscaleOAPISnapshotAttributesRead(d *schema.ResourceData, meta in return nil } -func resourcedOutscaleOAPISnapshotAttributesDelete(d *schema.ResourceData, meta interface{}) error { +func resourcedOutscaleSnapshotAttributesDelete(d *schema.ResourceData, meta interface{}) error { d.SetId("") return nil diff --git a/outscale/resource_outscale_snapshot_attributes_test.go b/outscale/resource_outscale_snapshot_attributes_test.go index 6709947fe..32e4bb97e 100644 --- a/outscale/resource_outscale_snapshot_attributes_test.go +++ b/outscale/resource_outscale_snapshot_attributes_test.go @@ -9,7 +9,7 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func TestAccOutscaleOAPISnapshotAttributes_Basic(t *testing.T) { +func TestAccOutscaleSnapshotAttributes_Basic(t *testing.T) { t.Skip() var snapshotID string accountID := os.Getenv("OUTSCALE_ACCOUNT") @@ -19,13 +19,13 @@ func TestAccOutscaleOAPISnapshotAttributes_Basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotAttributesConfig(true, false, accountID, utils.GetRegion()), + Config: testAccOutscaleSnapshotAttributesConfig(true, false, accountID, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testCheckResourceGetAttr("outscale_snapshot.test", "id", &snapshotID), ), }, { - Config: testAccOutscaleOAPISnapshotAttributesConfig(true, true, accountID, utils.GetRegion()), + Config: testAccOutscaleSnapshotAttributesConfig(true, true, accountID, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testCheckResourceGetAttr("outscale_snapshot.test", "id", &snapshotID), ), @@ -34,7 +34,7 @@ func TestAccOutscaleOAPISnapshotAttributes_Basic(t *testing.T) { }) } -func testAccOutscaleOAPISnapshotAttributesConfig(includeAddition, includeRemoval bool, aid, region string) string { +func testAccOutscaleSnapshotAttributesConfig(includeAddition, includeRemoval bool, aid, region string) string { base := fmt.Sprintf(` resource "outscale_volume" "description_test" { subregion_name = "%[2]sa" diff --git a/outscale/resource_outscale_snapshot_export_task.go b/outscale/resource_outscale_snapshot_export_task.go index cb65572b2..a0c150edf 100644 --- a/outscale/resource_outscale_snapshot_export_task.go +++ b/outscale/resource_outscale_snapshot_export_task.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPISnapshotExportTask() *schema.Resource { +func ResourceOutscaleSnapshotExportTask() *schema.Resource { return &schema.Resource{ Create: resourceOAPISnapshotExportTaskCreate, Read: resourceOAPISnapshotExportTaskRead, diff --git a/outscale/resource_outscale_snapshot_export_task_test.go b/outscale/resource_outscale_snapshot_export_task_test.go index 6946d8c1f..5d9cea04b 100644 --- a/outscale/resource_outscale_snapshot_export_task_test.go +++ b/outscale/resource_outscale_snapshot_export_task_test.go @@ -30,22 +30,22 @@ func TestAccOthers_SnapshotExportTask_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotExportTaskConfig("", osuBucketNames[0], utils.GetRegion()), + Config: testAccOutscaleSnapshotExportTaskConfig("", osuBucketNames[0], utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISnapshotExportTaskExists("outscale_snapshot_export_task.outscale_snapshot_export_task"), + testAccCheckOutscaleSnapshotExportTaskExists("outscale_snapshot_export_task.outscale_snapshot_export_task"), ), }, { - Config: testAccOutscaleOAPISnapshotExportTaskConfig(tags, osuBucketNames[1], utils.GetRegion()), + Config: testAccOutscaleSnapshotExportTaskConfig(tags, osuBucketNames[1], utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISnapshotExportTaskExists("outscale_snapshot_export_task.outscale_snapshot_export_task"), + testAccCheckOutscaleSnapshotExportTaskExists("outscale_snapshot_export_task.outscale_snapshot_export_task"), ), }, }, }) } -func testAccCheckOutscaleOAPISnapshotExportTaskExists(n string) resource.TestCheckFunc { +func testAccCheckOutscaleSnapshotExportTaskExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -60,7 +60,7 @@ func testAccCheckOutscaleOAPISnapshotExportTaskExists(n string) resource.TestChe } } -func testAccOutscaleOAPISnapshotExportTaskConfig(tags, osuBucketName, region string) string { +func testAccOutscaleSnapshotExportTaskConfig(tags, osuBucketName, region string) string { return fmt.Sprintf(` resource "outscale_volume" "outscale_volume_snap" { subregion_name = "%[3]sa" diff --git a/outscale/resource_outscale_snapshot_test.go b/outscale/resource_outscale_snapshot_test.go index 0c9985985..adf642fc5 100644 --- a/outscale/resource_outscale_snapshot_test.go +++ b/outscale/resource_outscale_snapshot_test.go @@ -22,7 +22,7 @@ func TestAccOthers_Snapshot_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotConfig(utils.GetRegion()), + Config: testAccOutscaleSnapshotConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testAccCheckOAPISnapshotExists("outscale_snapshot.outscale_snapshot", &v), ), @@ -40,7 +40,7 @@ func TestAccOthers_Snapshot_withDescription(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotConfigWithDescription(utils.GetRegion()), + Config: testAccOutscaleSnapshotConfigWithDescription(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testAccCheckOAPISnapshotExists("outscale_snapshot.test", &v), resource.TestCheckResourceAttr("outscale_snapshot.test", "description", "Snapshot Acceptance Test"), @@ -59,7 +59,7 @@ func TestAccOthers_Snapshot_CopySnapshot(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotConfigCopySnapshot(utils.GetRegion()), + Config: testAccOutscaleSnapshotConfigCopySnapshot(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testAccCheckOAPISnapshotExists("outscale_snapshot.test", &v), resource.TestCheckResourceAttr("outscale_snapshot.test", "description", "Target Snapshot Acceptance Test"), @@ -79,11 +79,11 @@ func TestAccOthers_Snapshot_UpdateTags(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotConfigUpdateTags(region, "Terraform-Snapshot"), + Config: testAccOutscaleSnapshotConfigUpdateTags(region, "Terraform-Snapshot"), Check: resource.ComposeTestCheckFunc(), }, { - Config: testAccOutscaleOAPISnapshotConfigUpdateTags(region, "Terraform-Snapshot-2"), + Config: testAccOutscaleSnapshotConfigUpdateTags(region, "Terraform-Snapshot-2"), Check: resource.ComposeTestCheckFunc(), }, }, @@ -99,7 +99,7 @@ func TestAccOthers_Snapshot_importBasic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISnapshotConfig(utils.GetRegion()), + Config: testAccOutscaleSnapshotConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testAccCheckOAPISnapshotExists("outscale_snapshot.outscale_snapshot", &v), ), @@ -152,7 +152,7 @@ func testAccCheckOAPISnapshotExists(n string, v *oscgo.Snapshot) resource.TestCh } } -func testAccOutscaleOAPISnapshotConfig(region string) string { +func testAccOutscaleSnapshotConfig(region string) string { return fmt.Sprintf(` resource "outscale_volume" "outscale_volume" { subregion_name = "%sa" @@ -170,7 +170,7 @@ resource "outscale_snapshot_attributes" "outscale_snapshot_attributes" { `, region) } -func testAccOutscaleOAPISnapshotConfigWithDescription(region string) string { +func testAccOutscaleSnapshotConfigWithDescription(region string) string { return fmt.Sprintf(` resource "outscale_volume" "description_test" { subregion_name = "%sa" @@ -184,7 +184,7 @@ func testAccOutscaleOAPISnapshotConfigWithDescription(region string) string { `, region) } -func testAccOutscaleOAPISnapshotConfigCopySnapshot(region string) string { +func testAccOutscaleSnapshotConfigCopySnapshot(region string) string { return fmt.Sprintf(` resource "outscale_volume" "description_test" { subregion_name = "%[1]sb" @@ -204,7 +204,7 @@ func testAccOutscaleOAPISnapshotConfigCopySnapshot(region string) string { `, region) } -func testAccOutscaleOAPISnapshotConfigUpdateTags(region, value string) string { +func testAccOutscaleSnapshotConfigUpdateTags(region, value string) string { return fmt.Sprintf(` resource "outscale_volume" "outscale_volume" { subregion_name = "%sa" diff --git a/outscale/resource_outscale_subnet.go b/outscale/resource_outscale_subnet.go index 049bd7231..c4fbeedef 100644 --- a/outscale/resource_outscale_subnet.go +++ b/outscale/resource_outscale_subnet.go @@ -12,12 +12,12 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPISubNet() *schema.Resource { +func ResourceOutscaleSubNet() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPISubNetCreate, - Read: ResourceOutscaleOAPISubNetRead, - Update: ResourceOutscaleOAPISubNetUpdate, - Delete: ResourceOutscaleOAPISubNetDelete, + Create: ResourceOutscaleSubNetCreate, + Read: ResourceOutscaleSubNetRead, + Update: ResourceOutscaleSubNetUpdate, + Delete: ResourceOutscaleSubNetDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -30,7 +30,7 @@ func ResourceOutscaleOAPISubNet() *schema.Resource { } // Create SubNet -func ResourceOutscaleOAPISubNetCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSubNetCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI req := oscgo.CreateSubnetRequest{ IpRange: d.Get("ip_range").(string), @@ -96,11 +96,11 @@ func ResourceOutscaleOAPISubNetCreate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Failure updating MapPublicIpOnLaunch: %s", err) } } - return ResourceOutscaleOAPISubNetRead(d, meta) + return ResourceOutscaleSubNetRead(d, meta) } // Read SubNet -func ResourceOutscaleOAPISubNetRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSubNetRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Id() log.Printf("[DEBUG] Reading Subnet(%s)", id) @@ -126,9 +126,9 @@ func ResourceOutscaleOAPISubNetRead(d *schema.ResourceData, meta interface{}) er d.SetId("") return nil } - return readOutscaleOAPISubNet(d, &resp.GetSubnets()[0]) + return readOutscaleSubNet(d, &resp.GetSubnets()[0]) } -func ResourceOutscaleOAPISubNetUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSubNetUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { @@ -156,10 +156,10 @@ func ResourceOutscaleOAPISubNetUpdate(d *schema.ResourceData, meta interface{}) } } - return ResourceOutscaleOAPISubNetRead(d, meta) + return ResourceOutscaleSubNetRead(d, meta) } -func ResourceOutscaleOAPISubNetDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleSubNetDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI id := d.Id() log.Printf("[DEBUG] Deleting Subnet (%s)", id) @@ -193,7 +193,7 @@ func ResourceOutscaleOAPISubNetDelete(d *schema.ResourceData, meta interface{}) d.SetId("") return nil } -func readOutscaleOAPISubNet(d *schema.ResourceData, subnet *oscgo.Subnet) error { +func readOutscaleSubNet(d *schema.ResourceData, subnet *oscgo.Subnet) error { if err := d.Set("subregion_name", subnet.GetSubregionName()); err != nil { fmt.Printf("[WARN] ERROR readOutscaleSubNet1 (%s)", err) return err diff --git a/outscale/resource_outscale_subnet_test.go b/outscale/resource_outscale_subnet_test.go index 7bfb72afe..003c9d0a3 100644 --- a/outscale/resource_outscale_subnet_test.go +++ b/outscale/resource_outscale_subnet_test.go @@ -22,19 +22,19 @@ func TestAccNet_WithSubNet_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPISubNetDestroyed, // we need to create the destroyed test case + CheckDestroy: testAccCheckOutscaleSubNetDestroyed, // we need to create the destroyed test case Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPISubnetConfig(utils.GetRegion(), false), + Config: testAccOutscaleSubnetConfig(utils.GetRegion(), false), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISubNetExists(resourceName, &conf), + testAccCheckOutscaleSubNetExists(resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "map_public_ip_on_launch", "false"), ), }, { - Config: testAccOutscaleOAPISubnetConfig(utils.GetRegion(), true), + Config: testAccOutscaleSubnetConfig(utils.GetRegion(), true), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPISubNetExists(resourceName, &conf), + testAccCheckOutscaleSubNetExists(resourceName, &conf), resource.TestCheckResourceAttr(resourceName, "map_public_ip_on_launch", "true"), ), }, @@ -42,7 +42,7 @@ func TestAccNet_WithSubNet_basic(t *testing.T) { }) } -func testAccCheckOutscaleOAPISubNetExists(n string, res *oscgo.Subnet) resource.TestCheckFunc { +func testAccCheckOutscaleSubNetExists(n string, res *oscgo.Subnet) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -85,7 +85,7 @@ func testAccCheckOutscaleOAPISubNetExists(n string, res *oscgo.Subnet) resource. } } -func testAccCheckOutscaleOAPISubNetDestroyed(s *terraform.State) error { +func testAccCheckOutscaleSubNetDestroyed(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "outscale_subnet" { continue @@ -122,7 +122,7 @@ func testAccCheckOutscaleOAPISubNetDestroyed(s *terraform.State) error { return nil } -func testAccOutscaleOAPISubnetConfig(region string, mapPublicIpOnLaunch bool) string { +func testAccOutscaleSubnetConfig(region string, mapPublicIpOnLaunch bool) string { return fmt.Sprintf(` resource "outscale_net" "net" { ip_range = "10.0.0.0/16" diff --git a/outscale/resource_outscale_tags.go b/outscale/resource_outscale_tags.go index 88dbfd805..437c724df 100644 --- a/outscale/resource_outscale_tags.go +++ b/outscale/resource_outscale_tags.go @@ -13,11 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPITags() *schema.Resource { +func ResourceOutscaleTags() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPITagsCreate, - Read: ResourceOutscaleOAPITagsRead, - Delete: ResourceOutscaleOAPITagsDelete, + Create: ResourceOutscaleTagsCreate, + Read: ResourceOutscaleTagsRead, + Delete: ResourceOutscaleTagsDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -31,7 +31,7 @@ func ResourceOutscaleOAPITags() *schema.Resource { } } -func ResourceOutscaleOAPITagsCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleTagsCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI request := oscgo.CreateTagsRequest{} @@ -72,10 +72,10 @@ func ResourceOutscaleOAPITagsCreate(d *schema.ResourceData, meta interface{}) er d.SetId(resource.UniqueId()) - return ResourceOutscaleOAPITagsRead(d, meta) + return ResourceOutscaleTagsRead(d, meta) } -func ResourceOutscaleOAPITagsRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleTagsRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI // Build up search parameters @@ -136,7 +136,7 @@ func ResourceOutscaleOAPITagsRead(d *schema.ResourceData, meta interface{}) erro return err } -func ResourceOutscaleOAPITagsDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleTagsDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI request := oscgo.DeleteTagsRequest{} diff --git a/outscale/resource_outscale_tags_test.go b/outscale/resource_outscale_tags_test.go index 29f4deb9a..f874bbf43 100644 --- a/outscale/resource_outscale_tags_test.go +++ b/outscale/resource_outscale_tags_test.go @@ -26,7 +26,7 @@ func TestAccVM_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { Config: testAccCheckOAPIInstanceConfigTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "keyOriginal", "valueOriginal"), diff --git a/outscale/resource_outscale_virtual_gateway.go b/outscale/resource_outscale_virtual_gateway.go index 3978ae262..ebb2ee393 100644 --- a/outscale/resource_outscale_virtual_gateway.go +++ b/outscale/resource_outscale_virtual_gateway.go @@ -14,12 +14,12 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIVirtualGateway() *schema.Resource { +func ResourceOutscaleVirtualGateway() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIVirtualGatewayCreate, - Read: ResourceOutscaleOAPIVirtualGatewayRead, - Update: ResourceOutscaleOAPIVirtualGatewayUpdate, - Delete: ResourceOutscaleOAPIVirtualGatewayDelete, + Create: ResourceOutscaleVirtualGatewayCreate, + Read: ResourceOutscaleVirtualGatewayRead, + Update: ResourceOutscaleVirtualGatewayUpdate, + Delete: ResourceOutscaleVirtualGatewayDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -67,7 +67,7 @@ func ResourceOutscaleOAPIVirtualGateway() *schema.Resource { } } -func ResourceOutscaleOAPIVirtualGatewayCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVirtualGatewayCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI connectType, connecTypeOk := d.GetOk("connection_type") createOpts := oscgo.CreateVirtualGatewayRequest{} @@ -112,10 +112,10 @@ func ResourceOutscaleOAPIVirtualGatewayCreate(d *schema.ResourceData, meta inter return err } } - return ResourceOutscaleOAPIVirtualGatewayRead(d, meta) + return ResourceOutscaleVirtualGatewayRead(d, meta) } -func ResourceOutscaleOAPIVirtualGatewayRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVirtualGatewayRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI var resp oscgo.ReadVirtualGatewaysResponse @@ -171,7 +171,7 @@ func ResourceOutscaleOAPIVirtualGatewayRead(d *schema.ResourceData, meta interfa return nil } -func ResourceOutscaleOAPIVirtualGatewayUpdate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVirtualGatewayUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI if err := setOSCAPITags(conn, d); err != nil { return err @@ -179,7 +179,7 @@ func ResourceOutscaleOAPIVirtualGatewayUpdate(d *schema.ResourceData, meta inter return nil } -func ResourceOutscaleOAPIVirtualGatewayDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVirtualGatewayDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI return resource.Retry(5*time.Minute, func() *resource.RetryError { diff --git a/outscale/resource_outscale_virtual_gateway_link.go b/outscale/resource_outscale_virtual_gateway_link.go index 89f7ab722..6ff0bbe17 100644 --- a/outscale/resource_outscale_virtual_gateway_link.go +++ b/outscale/resource_outscale_virtual_gateway_link.go @@ -14,11 +14,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIVirtualGatewayLink() *schema.Resource { +func ResourceOutscaleVirtualGatewayLink() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIVirtualGatewayLinkCreate, - Read: ResourceOutscaleOAPIVirtualGatewayLinkRead, - Delete: ResourceOutscaleOAPIVirtualGatewayLinkDelete, + Create: ResourceOutscaleVirtualGatewayLinkCreate, + Read: ResourceOutscaleVirtualGatewayLinkRead, + Delete: ResourceOutscaleVirtualGatewayLinkDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -64,7 +64,7 @@ func ResourceOutscaleOAPIVirtualGatewayLink() *schema.Resource { } } -func ResourceOutscaleOAPIVirtualGatewayLinkCreate(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVirtualGatewayLinkCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI netID := d.Get("net_id").(string) @@ -113,10 +113,10 @@ func ResourceOutscaleOAPIVirtualGatewayLinkCreate(d *schema.ResourceData, meta i d.SetId(vgwID) - return ResourceOutscaleOAPIVirtualGatewayLinkRead(d, meta) + return ResourceOutscaleVirtualGatewayLinkRead(d, meta) } -func ResourceOutscaleOAPIVirtualGatewayLinkRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVirtualGatewayLinkRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI vgwID := d.Id() @@ -187,7 +187,7 @@ func flattenNetToVirtualGatewayLinks(netToVirtualGatewayLinks *[]oscgo.NetToVirt return res } -func ResourceOutscaleOAPIVirtualGatewayLinkDelete(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVirtualGatewayLinkDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI // Get the old VPC ID to detach from diff --git a/outscale/resource_outscale_virtual_gateway_link_test.go b/outscale/resource_outscale_virtual_gateway_link_test.go index 826b14903..825567665 100644 --- a/outscale/resource_outscale_virtual_gateway_link_test.go +++ b/outscale/resource_outscale_virtual_gateway_link_test.go @@ -28,7 +28,7 @@ func TestAccNet_withpnGatewayAttachment_basic(t *testing.T) { { Config: testAccOAPIVpnGatewayAttachmentConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILinExists( + testAccCheckOutscaleLinExists( "outscale_net.test", &vpc), testAccCheckOAPIVirtualGatewayExists( @@ -100,7 +100,7 @@ func TestAccNet_WithVpnGatewayAttachment_deleted(t *testing.T) { { Config: testAccOAPIVpnGatewayAttachmentConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILinExists( + testAccCheckOutscaleLinExists( "outscale_net.test", &vpc), testAccCheckOAPIVirtualGatewayExists( diff --git a/outscale/resource_outscale_virtual_gateway_route_propagation.go b/outscale/resource_outscale_virtual_gateway_route_propagation.go index fa152ca11..41346ea93 100644 --- a/outscale/resource_outscale_virtual_gateway_route_propagation.go +++ b/outscale/resource_outscale_virtual_gateway_route_propagation.go @@ -12,11 +12,11 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIVirtualGatewayRoutePropagation() *schema.Resource { +func ResourceOutscaleVirtualGatewayRoutePropagation() *schema.Resource { return &schema.Resource{ - Create: ResourceOutscaleOAPIVpnGatewayRoutePropagationEnable, - Read: ResourceOutscaleOAPIVpnGatewayRoutePropagationRead, - Delete: ResourceOutscaleOAPIVpnGatewayRoutePropagationDisable, + Create: ResourceOutscaleVpnGatewayRoutePropagationEnable, + Read: ResourceOutscaleVpnGatewayRoutePropagationRead, + Delete: ResourceOutscaleVpnGatewayRoutePropagationDisable, Schema: map[string]*schema.Schema{ "virtual_gateway_id": { @@ -42,7 +42,7 @@ func ResourceOutscaleOAPIVirtualGatewayRoutePropagation() *schema.Resource { } } -func ResourceOutscaleOAPIVpnGatewayRoutePropagationEnable(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVpnGatewayRoutePropagationEnable(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI gwID := d.Get("virtual_gateway_id").(string) @@ -74,7 +74,7 @@ func ResourceOutscaleOAPIVpnGatewayRoutePropagationEnable(d *schema.ResourceData return nil } -func ResourceOutscaleOAPIVpnGatewayRoutePropagationDisable(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVpnGatewayRoutePropagationDisable(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI gwID := d.Get("virtual_gateway_id").(string) @@ -105,7 +105,7 @@ func ResourceOutscaleOAPIVpnGatewayRoutePropagationDisable(d *schema.ResourceDat return nil } -func ResourceOutscaleOAPIVpnGatewayRoutePropagationRead(d *schema.ResourceData, meta interface{}) error { +func ResourceOutscaleVpnGatewayRoutePropagationRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI gwID := d.Get("virtual_gateway_id").(string) diff --git a/outscale/resource_outscale_virtual_gateway_route_propagation_test.go b/outscale/resource_outscale_virtual_gateway_route_propagation_test.go index 861bd6f71..bf3a06869 100644 --- a/outscale/resource_outscale_virtual_gateway_route_propagation_test.go +++ b/outscale/resource_outscale_virtual_gateway_route_propagation_test.go @@ -25,9 +25,9 @@ func TestAccNet_WithVirtualRoutePropagation_basic(t *testing.T) { CheckDestroy: testAccCheckOAPIVirtualRoutePropagationDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIVpnRoutePropagationConfig(rBgpAsn), + Config: testAccOutscaleVpnRoutePropagationConfig(rBgpAsn), Check: resource.ComposeTestCheckFunc( - testAccOutscaleOAPIVpnRoutePropagation( + testAccOutscaleVpnRoutePropagation( "outscale_virtual_gateway_route_propagation.outscale_virtual_gateway_route_propagation", ), ), @@ -82,7 +82,7 @@ func testAccCheckOAPIVirtualRoutePropagationDestroy(s *terraform.State) error { return nil } -func testAccOutscaleOAPIVpnRoutePropagation(routeProp string) resource.TestCheckFunc { +func testAccOutscaleVpnRoutePropagation(routeProp string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[routeProp] if !ok { @@ -97,7 +97,7 @@ func testAccOutscaleOAPIVpnRoutePropagation(routeProp string) resource.TestCheck } } -func testAccOutscaleOAPIVpnRoutePropagationConfig(rBgpAsn int) string { +func testAccOutscaleVpnRoutePropagationConfig(rBgpAsn int) string { return fmt.Sprintf(` resource "outscale_virtual_gateway" "outscale_virtual_gateway" { connection_type = "ipsec.1" diff --git a/outscale/resource_outscale_virtual_gateway_test.go b/outscale/resource_outscale_virtual_gateway_test.go index bc028730b..965ed4585 100644 --- a/outscale/resource_outscale_virtual_gateway_test.go +++ b/outscale/resource_outscale_virtual_gateway_test.go @@ -118,7 +118,7 @@ func TestAccNet_ImportVirtualGateway_Basic(t *testing.T) { }) } -func testAccOutscaleOAPIVirtualGatewayDisappears(gateway *oscgo.VirtualGateway) resource.TestCheckFunc { +func testAccOutscaleVirtualGatewayDisappears(gateway *oscgo.VirtualGateway) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI var err error diff --git a/outscale/resource_outscale_vm.go b/outscale/resource_outscale_vm.go index 26996d193..ea253bfcc 100644 --- a/outscale/resource_outscale_vm.go +++ b/outscale/resource_outscale_vm.go @@ -17,7 +17,7 @@ import ( "github.com/spf13/cast" ) -func ResourceOutscaleOApiVM() *schema.Resource { +func ResourceOutscaleVM() *schema.Resource { return &schema.Resource{ Create: resourceOAPIVMCreate, Read: resourceOAPIVMRead, diff --git a/outscale/resource_outscale_vm_test.go b/outscale/resource_outscale_vm_test.go index 429d0ec5e..18d29ede9 100644 --- a/outscale/resource_outscale_vm_test.go +++ b/outscale/resource_outscale_vm_test.go @@ -29,13 +29,13 @@ func TestAccVM_Basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVMConfigBasic(omi, "tinav4.c2r2p2", region, keypair), + Config: testAccCheckOutscaleVMConfigBasic(omi, "tinav4.c2r2p2", region, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists(resourceName, &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists(resourceName, &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr(resourceName, "image_id", omi), resource.TestCheckResourceAttr(resourceName, "vm_type", "tinav4.c2r2p2"), @@ -56,13 +56,13 @@ func TestAccVM_Behavior_Basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVMBehaviorConfigBasic(omi, "tinav4.c2r2p2", region, keypair, "high", "stop"), + Config: testAccCheckOutscaleVMBehaviorConfigBasic(omi, "tinav4.c2r2p2", region, keypair, "high", "stop"), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basicr1", &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists("outscale_vm.basicr1", &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( "outscale_vm.basicr1", "image_id", omi), resource.TestCheckResourceAttr( @@ -70,10 +70,10 @@ func TestAccVM_Behavior_Basic(t *testing.T) { ), }, { - Config: testAccCheckOutscaleOAPIVMBehaviorConfigBasic(omi, "tinav4.c2r2p2", region, keypair, "high", "restart"), + Config: testAccCheckOutscaleVMBehaviorConfigBasic(omi, "tinav4.c2r2p2", region, keypair, "high", "restart"), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basicr1", &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists("outscale_vm.basicr1", &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( "outscale_vm.basicr1", "image_id", omi), resource.TestCheckResourceAttr( @@ -96,12 +96,12 @@ func TestAccVM_importBasic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVMConfigImport(omi, "tinav4.c2r2p2", region, keypair), + Config: testAccCheckOutscaleVMConfigImport(omi, "tinav4.c2r2p2", region, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists(resourceName, &server), + testAccCheckOutscaleVMExists(resourceName, &server), resource.TestCheckResourceAttr(resourceName, "image_id", omi), resource.TestCheckResourceAttr(resourceName, "vm_type", "tinav4.c2r2p2"), resource.TestCheckResourceAttr(resourceName, "keypair_name", keypair), @@ -139,13 +139,13 @@ func TestAccNet_VM_withNicAttached(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVMConfigBasicWithNicAttached(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), + Config: testAccCheckOutscaleVMConfigBasicWithNicAttached(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists(resourceName, &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists(resourceName, &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr(resourceName, "image_id", omi), resource.TestCheckResourceAttr(resourceName, "vm_type", "tinav4.c2r2p2"), ), @@ -164,13 +164,13 @@ func TestAccVM_withTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists("outscale_vm.basic", &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( "outscale_vm.basic", "image_id", omi), resource.TestCheckResourceAttr( @@ -189,13 +189,13 @@ func TestAccNet_VM_withNics(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVMConfigBasicWithNics(omi, "tinav4.c2r2p2", keypair, utils.GetRegion()), + Config: testAccCheckOutscaleVMConfigBasicWithNics(omi, "tinav4.c2r2p2", keypair, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists("outscale_vm.basic", &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( "outscale_vm.basic", "image_id", omi), resource.TestCheckResourceAttr( @@ -218,13 +218,13 @@ func TestAccVM_UpdateKeypair(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { Config: testAccVmsConfigUpdateOAPIVMKey(omi, "tinav4.c2r2p2", region), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &before), - testAccCheckOutscaleOAPIVMAttributes(t, &before, omi), + testAccCheckOutscaleVMExists("outscale_vm.basic", &before), + testAccCheckOutscaleVMAttributes(t, &before, omi), resource.TestCheckResourceAttr("outscale_vm.basic", "image_id", omi), resource.TestCheckResourceAttr("outscale_vm.basic", "vm_type", "tinav4.c2r2p2"), ), @@ -249,13 +249,13 @@ func TestAccNet_VM_WithSubnet(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVMConfigWithSubnet(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), + Config: testAccCheckOutscaleVMConfigWithSubnet(omi, "tinav4.c2r2p2", utils.GetRegion(), keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists("outscale_vm.basic", &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( "outscale_vm.basic", "image_id", omi), resource.TestCheckResourceAttr( @@ -274,7 +274,7 @@ func TestAccVM_UpdateDeletionProtection(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { Config: testAccCheckOutscaleDeletionProtectionUpdateBasic(omi, keypair, true), @@ -302,7 +302,7 @@ func TestAccVM_UpdateTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, keypair), @@ -325,13 +325,13 @@ func TestAccNet_WithVM_PublicIp_Link(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckOutscaleOAPIVMConfigWithNet(omi, vmType, utils.GetRegion(), keypair), + Config: testAccCheckOutscaleVMConfigWithNet(omi, vmType, utils.GetRegion(), keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.outscale_vmnet", &server), - testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), + testAccCheckOutscaleVMExists("outscale_vm.outscale_vmnet", &server), + testAccCheckOutscaleVMAttributes(t, &server, omi), resource.TestCheckResourceAttr( "outscale_vm.outscale_vmnet", "image_id", omi), resource.TestCheckResourceAttr( @@ -351,12 +351,12 @@ func TestAccVM_multiBlockDeviceMapping(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheckValues(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, + CheckDestroy: testAccCheckOutscaleVMDestroy, Steps: []resource.TestStep{ { Config: testAccCheckOutscaleVMWithMultiBlockDeviceMapping(utils.GetRegion(), omi, keypair), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPIVMExists("outscale_vm.outscale_vm", &server), + testAccCheckOutscaleVMExists("outscale_vm.outscale_vm", &server), resource.TestCheckResourceAttr("outscale_vm.outscale_vm", "image_id", omi), resource.TestCheckResourceAttr("outscale_vm.outscale_vm", "vm_type", "tinav4.c2r2p2"), ), @@ -524,18 +524,18 @@ func testAccCheckOAPIVMNotRecreated(t *testing.T, before, after *oscgo.Vm) resou } } -func testAccCheckOutscaleOAPIVMDestroy(s *terraform.State) error { - return testAccCheckOutscaleOAPIVMDestroyWithProvider(s, testAccProvider) +func testAccCheckOutscaleVMDestroy(s *terraform.State) error { + return testAccCheckOutscaleVMDestroyWithProvider(s, testAccProvider) } //TODO: check if it is needed -// func testAccCheckOutscaleOAPIVMDestroyWithProviders(providers *[]*schema.Provider) resource.TestCheckFunc { +// func testAccCheckOutscaleVMDestroyWithProviders(providers *[]*schema.Provider) resource.TestCheckFunc { // return func(s *terraform.State) error { // for _, provider := range *providers { // if provider.Meta() == nil { // continue // } -// if err := testAccCheckOutscaleOAPIVMDestroyWithProvider(s, provider); err != nil { +// if err := testAccCheckOutscaleVMDestroyWithProvider(s, provider); err != nil { // return err // } // } @@ -543,7 +543,7 @@ func testAccCheckOutscaleOAPIVMDestroy(s *terraform.State) error { // } // } -func testAccCheckOutscaleOAPIVMDestroyWithProvider(s *terraform.State, provider *schema.Provider) error { +func testAccCheckOutscaleVMDestroyWithProvider(s *terraform.State, provider *schema.Provider) error { conn := provider.Meta().(*OutscaleClient) for _, rs := range s.RootModule().Resources { @@ -587,12 +587,12 @@ func testAccCheckOutscaleOAPIVMDestroyWithProvider(s *terraform.State, provider return nil } -func testAccCheckOutscaleOAPIVMExists(n string, i *oscgo.Vm) resource.TestCheckFunc { +func testAccCheckOutscaleVMExists(n string, i *oscgo.Vm) resource.TestCheckFunc { providers := []*schema.Provider{testAccProvider} - return testAccCheckOutscaleOAPIVMExistsWithProviders(n, i, &providers) + return testAccCheckOutscaleVMExistsWithProviders(n, i, &providers) } -func testAccCheckOutscaleOAPIVMExistsWithProviders(n string, i *oscgo.Vm, providers *[]*schema.Provider) resource.TestCheckFunc { +func testAccCheckOutscaleVMExistsWithProviders(n string, i *oscgo.Vm, providers *[]*schema.Provider) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -640,14 +640,14 @@ func testAccCheckOutscaleOAPIVMExistsWithProviders(n string, i *oscgo.Vm, provid } } -func testAccCheckOutscaleOAPIVMAttributes(t *testing.T, server *oscgo.Vm, omi string) resource.TestCheckFunc { +func testAccCheckOutscaleVMAttributes(t *testing.T, server *oscgo.Vm, omi string) resource.TestCheckFunc { return func(s *terraform.State) error { assertEqual(t, omi, server.GetImageId(), "Bad image_id.") return nil } } -func testAccCheckOutscaleOAPIVMConfigBasic(omi, vmType, region, keypair string) string { +func testAccCheckOutscaleVMConfigBasic(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_basicVvm" { description = "testAcc Terraform security group" @@ -666,7 +666,7 @@ func testAccCheckOutscaleOAPIVMConfigBasic(omi, vmType, region, keypair string) }`, omi, vmType, region, keypair) } -func testAccCheckOutscaleOAPIVMConfigImport(omi, vmType, region, keypair string) string { +func testAccCheckOutscaleVMConfigImport(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_import_vm" { description = "testAcc Terraform security group" @@ -686,7 +686,7 @@ func testAccCheckOutscaleOAPIVMConfigImport(omi, vmType, region, keypair string) }`, omi, vmType, region, keypair) } -func testAccCheckOutscaleOAPIVMConfigBasicWithNicAttached(omi, vmType, region, keypair string) string { +func testAccCheckOutscaleVMConfigBasicWithNicAttached(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" @@ -743,7 +743,7 @@ func testAccCheckOutscaleOAPIVMConfigBasicWithNicAttached(omi, vmType, region, k }`, omi, vmType, region, keypair) } -func testAccCheckOutscaleOAPIVMConfigBasicWithNics(omi, vmType, keypair, region string) string { +func testAccCheckOutscaleVMConfigBasicWithNics(omi, vmType, keypair, region string) string { return fmt.Sprintf(`resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" } @@ -856,7 +856,7 @@ func testAccVmsConfigUpdateOAPIVMTags(omi, vmType, region, value, keypair string `, omi, vmType, region, value, keypair) } -func testAccCheckOutscaleOAPIVMConfigWithSubnet(omi, vmType, region, keypair string) string { +func testAccCheckOutscaleVMConfigWithSubnet(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" @@ -891,7 +891,7 @@ func testAccCheckOutscaleOAPIVMConfigWithSubnet(omi, vmType, region, keypair str `, omi, vmType, region, keypair) } -func testAccCheckOutscaleOAPIVMConfigWithBlockDeviceMappings(omi, vmType, region, keypair string) string { +func testAccCheckOutscaleVMConfigWithBlockDeviceMappings(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_volume" "external1" { subregion_name = "%[3]sa" @@ -931,7 +931,7 @@ func testAccCheckOutscaleOAPIVMConfigWithBlockDeviceMappings(omi, vmType, region `, omi, vmType, region, keypair) } -func testAccCheckOutscaleOAPIVMConfigWithNet(omi, vmType, region, keypair string) string { +func testAccCheckOutscaleVMConfigWithNet(omi, vmType, region, keypair string) string { return fmt.Sprintf(` resource "outscale_net" "outscale_net" { ip_range = "10.0.0.0/16" @@ -1014,7 +1014,7 @@ func assertEqual(t *testing.T, a interface{}, b interface{}, message string) { } } -func testAccCheckOutscaleOAPIVMBehaviorConfigBasic(omi, vmType, region, keypair, perfomance, vmBehavior string) string { +func testAccCheckOutscaleVMBehaviorConfigBasic(omi, vmType, region, keypair, perfomance, vmBehavior string) string { return fmt.Sprintf(` resource "outscale_security_group" "sg_behavior_vm" { description = "testAcc Terraform security group" diff --git a/outscale/resource_outscale_volume.go b/outscale/resource_outscale_volume.go index 3e53313b9..365079849 100644 --- a/outscale/resource_outscale_volume.go +++ b/outscale/resource_outscale_volume.go @@ -15,7 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -func ResourceOutscaleOAPIVolume() *schema.Resource { +func ResourceOutscaleVolume() *schema.Resource { return &schema.Resource{ Create: resourceOAPIVolumeCreate, Read: resourceOAPIVolumeRead, diff --git a/outscale/resource_outscale_volume_test.go b/outscale/resource_outscale_volume_test.go index 81b89f15b..d174a512b 100644 --- a/outscale/resource_outscale_volume_test.go +++ b/outscale/resource_outscale_volume_test.go @@ -24,7 +24,7 @@ func TestAccOthers_Volume_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIVolumeConfig(utils.GetRegion()), + Config: testAccOutscaleVolumeConfig(utils.GetRegion()), Check: resource.ComposeTestCheckFunc( testAccCheckOAPIVolumeExists("outscale_volume.test", &v), ), @@ -52,14 +52,14 @@ func TestAccOthers_Volume_updateSize(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIVolumeConfig(region), + Config: testAccOutscaleVolumeConfig(region), Check: resource.ComposeTestCheckFunc( testAccCheckOAPIVolumeExists("outscale_volume.test", &v), resource.TestCheckResourceAttr("outscale_volume.test", "size", "1"), ), }, { - Config: testOutscaleOAPIVolumeConfigUpdateSize(region), + Config: testOutscaleVolumeConfigUpdateSize(region), Check: resource.ComposeTestCheckFunc( testAccCheckOAPIVolumeExists("outscale_volume.test", &v), resource.TestCheckResourceAttr("outscale_volume.test", "size", "10"), @@ -153,7 +153,7 @@ func testAccCheckOAPIVolumeExists(n string, v *oscgo.Volume) resource.TestCheckF } } -func testAccOutscaleOAPIVolumeConfig(region string) string { +func testAccOutscaleVolumeConfig(region string) string { return fmt.Sprintf(` resource "outscale_volume" "test" { subregion_name = "%sa" @@ -168,7 +168,7 @@ func testAccOutscaleOAPIVolumeConfig(region string) string { `, region) } -func testOutscaleOAPIVolumeConfigUpdateSize(region string) string { +func testOutscaleVolumeConfigUpdateSize(region string) string { return fmt.Sprintf(` resource "outscale_volume" "test" { subregion_name = "%sa" diff --git a/outscale/resource_outscale_volumes_link.go b/outscale/resource_outscale_volumes_link.go index 9d9e194d2..265dd2350 100644 --- a/outscale/resource_outscale_volumes_link.go +++ b/outscale/resource_outscale_volumes_link.go @@ -13,7 +13,7 @@ import ( "github.com/outscale/terraform-provider-outscale/utils" ) -func ResourceOutscaleOAPIVolumeLink() *schema.Resource { +func ResourceOutscaleVolumeLink() *schema.Resource { return &schema.Resource{ Create: resourceOAPIVolumeLinkCreate, Read: resourceOAPIVolumeLinkRead, diff --git a/outscale/resource_outscale_volumes_link_test.go b/outscale/resource_outscale_volumes_link_test.go index c9a7843cd..1714944e5 100644 --- a/outscale/resource_outscale_volumes_link_test.go +++ b/outscale/resource_outscale_volumes_link_test.go @@ -33,7 +33,7 @@ func TestAccVM_WithVolumeAttachment_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "outscale_volumes_link.ebs_att", "device_name", "/dev/sdh"), - testAccCheckOutscaleOAPIVMExists("outscale_vm.web", &i), + testAccCheckOutscaleVMExists("outscale_vm.web", &i), testAccCheckOAPIVolumeAttachmentExists( "outscale_volumes_link.ebs_att", &i, &v), ), diff --git a/outscale/resource_outscale_vpn_connection_route.go b/outscale/resource_outscale_vpn_connection_route.go index d62baa706..9ce2c78d6 100644 --- a/outscale/resource_outscale_vpn_connection_route.go +++ b/outscale/resource_outscale_vpn_connection_route.go @@ -21,7 +21,7 @@ func ResourceOutscaleVPNConnectionRoute() *schema.Resource { Read: ResourceOutscaleVPNConnectionRouteRead, Delete: ResourceOutscaleVPNConnectionRouteDelete, Importer: &schema.ResourceImporter{ - State: ResourceOutscaleOAPIVPNConnectionRouteImportState, + State: ResourceOutscaleVPNConnectionRouteImportState, }, Schema: map[string]*schema.Schema{ @@ -178,7 +178,7 @@ func ResourceOutscaleVPNConnectionRouteParseID(ID string) (string, string) { return parts[0], parts[1] } -func ResourceOutscaleOAPIVPNConnectionRouteImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { +func ResourceOutscaleVPNConnectionRouteImportState(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { conn := meta.(*OutscaleClient).OSCAPI parts := strings.SplitN(d.Id(), "_", 2) diff --git a/outscale/resource_outscale_vpn_connection_route_test.go b/outscale/resource_outscale_vpn_connection_route_test.go index 2e171e5e8..e9734bf0b 100644 --- a/outscale/resource_outscale_vpn_connection_route_test.go +++ b/outscale/resource_outscale_vpn_connection_route_test.go @@ -62,7 +62,7 @@ func TestAccOthers_ImportVPNConnectionRoute_basic(t *testing.T) { { ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccCheckOutscaleOAPIRouteImportStateIDFunc(resourceName), + ImportStateIdFunc: testAccCheckOutscaleRouteImportStateIDFunc(resourceName), ImportStateVerify: true, ImportStateVerifyIgnore: []string{"request_id"}, },