Skip to content

Commit

Permalink
remove OAPI/Oapi from functions name
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Apr 4, 2024
1 parent b0a5742 commit 21d7730
Show file tree
Hide file tree
Showing 183 changed files with 986 additions and 986 deletions.
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_api_access_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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" {}
`)
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_api_access_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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),
),
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_api_access_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -21,7 +21,7 @@ func TestAccDataOutscaleOAPIApiAccessRules_basic(t *testing.T) {
CheckDestroy: testAccDataCheckOutscaleApiAccessRuleDestroy,
Steps: []resource.TestStep{
{
Config: testAccDataOutscaleOAPIApiAccessRulesConfig(),
Config: testAccDataOutscaleApiAccessRulesConfig(),
Check: resource.ComposeTestCheckFunc(
testAccCheckOutscaleApiAccessRuleExists(resourceName),
),
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{})
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_cas.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_cas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_flexible_gpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{})
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_flexible_gpu_catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" { }
`)
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_flexible_gpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_flexible_gpus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_flexible_gpus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_image_export_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_image_export_tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions outscale/data_source_outscale_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down Expand Up @@ -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{})
Expand Down
8 changes: 4 additions & 4 deletions outscale/data_source_outscale_images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_internet_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_internet_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
Expand All @@ -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" {
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_internet_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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")
Expand Down
Loading

0 comments on commit 21d7730

Please sign in to comment.