Skip to content

Commit

Permalink
rename most functions.
Browse files Browse the repository at this point in the history
So it follow the pulumi standart which require upper camel case.
otherwise polumi provider doesn't work.

Signed-off-by: Matthias Gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Apr 12, 2024
1 parent f876d06 commit e36e060
Show file tree
Hide file tree
Showing 228 changed files with 1,362 additions and 1,362 deletions.
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_access_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
)

func dataSourceOutscaleAccessKey() *schema.Resource {
func DataSourceOutscaleAccessKey() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleAccessKeyRead,
Read: DataSourceOutscaleAccessKeyRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"access_key_id": {
Expand Down Expand Up @@ -48,7 +48,7 @@ func dataSourceOutscaleAccessKey() *schema.Resource {
}
}

func dataSourceOutscaleAccessKeyRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleAccessKeyRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_access_keys.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/validation"
)

func dataSourceOutscaleAccessKeys() *schema.Resource {
func DataSourceOutscaleAccessKeys() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleAccessKeysRead,
Read: DataSourceOutscaleAccessKeysRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"access_key_ids": {
Expand Down Expand Up @@ -67,7 +67,7 @@ func dataSourceOutscaleAccessKeys() *schema.Resource {
}
}

func dataSourceOutscaleAccessKeysRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleAccessKeysRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceAccount() *schema.Resource {
func DataSourceAccount() *schema.Resource {
return &schema.Resource{
Read: dataSourceAccountRead,
Read: DataSourceAccountRead,
Schema: map[string]*schema.Schema{
"account_id": {
Type: schema.TypeString,
Expand Down Expand Up @@ -85,7 +85,7 @@ func dataSourceAccount() *schema.Resource {
}
}

func dataSourceAccountRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceAccountRead(d *schema.ResourceData, meta interface{}) error {

conn := meta.(*OutscaleClient).OSCAPI

Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceAccounts() *schema.Resource {
func DataSourceAccounts() *schema.Resource {
return &schema.Resource{
Read: dataSourceAccountsRead,
Read: DataSourceAccountsRead,
Schema: map[string]*schema.Schema{
"accounts": {
Type: schema.TypeList,
Expand Down Expand Up @@ -93,7 +93,7 @@ func dataSourceAccounts() *schema.Resource {
}
}

func dataSourceAccountsRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceAccountsRead(d *schema.ResourceData, meta interface{}) error {

conn := meta.(*OutscaleClient).OSCAPI

Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_api_access_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceOutscaleOAPIApiAccessPolicy() *schema.Resource {
func DataSourceOutscaleApiAccessPolicy() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleOAPIApiAccessPolicyRead,
Read: DataSourceOutscaleApiAccessPolicyRead,
Schema: map[string]*schema.Schema{
"max_access_key_expiration_seconds": {
Type: schema.TypeInt,
Expand All @@ -31,7 +31,7 @@ func dataSourceOutscaleOAPIApiAccessPolicy() *schema.Resource {
}
}

func dataSourceOutscaleOAPIApiAccessPolicyRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleApiAccessPolicyRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

req := oscgo.ReadApiAccessPolicyRequest{}
Expand Down
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.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceOutscaleOAPIApiAccessRule() *schema.Resource {
func DataSourceOutscaleApiAccessRule() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleOAPIApiAccessRuleRead,
Read: DataSourceOutscaleApiAccessRuleRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"api_access_rule_id": {
Expand Down Expand Up @@ -48,7 +48,7 @@ func dataSourceOutscaleOAPIApiAccessRule() *schema.Resource {
}
}

func dataSourceOutscaleOAPIApiAccessRuleRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleApiAccessRuleRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
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.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceOutscaleOAPIApiAccessRules() *schema.Resource {
func DataSourceOutscaleApiAccessRules() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleOAPIApiAccessRulesRead,
Read: DataSourceOutscaleApiAccessRulesRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"api_access_rules": {
Expand Down Expand Up @@ -55,7 +55,7 @@ func dataSourceOutscaleOAPIApiAccessRules() *schema.Resource {
}
}

func dataSourceOutscaleOAPIApiAccessRulesRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleApiAccessRulesRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
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
10 changes: 5 additions & 5 deletions outscale/data_source_outscale_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceOutscaleOAPICa() *schema.Resource {
func DataSourceOutscaleCa() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleOAPICaRead,
Read: DataSourceOutscaleCaRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"ca_pem": {
Expand All @@ -41,7 +41,7 @@ func dataSourceOutscaleOAPICa() *schema.Resource {
}
}

func dataSourceOutscaleOAPICaRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleCaRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
Expand All @@ -51,7 +51,7 @@ func dataSourceOutscaleOAPICaRead(d *schema.ResourceData, meta interface{}) erro

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 dataSourceOutscaleOAPICaRead(d *schema.ResourceData, meta interface{}) erro
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
8 changes: 4 additions & 4 deletions outscale/data_source_outscale_cas.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceOutscaleOAPICas() *schema.Resource {
func DataSourceOutscaleCas() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleOAPICasRead,
Read: DataSourceOutscaleCasRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"cas": {
Expand Down Expand Up @@ -44,14 +44,14 @@ func dataSourceOutscaleOAPICas() *schema.Resource {
}
}

func dataSourceOutscaleOAPICasRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleCasRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
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
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_client_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/outscale/terraform-provider-outscale/utils"
)

func dataSourceOutscaleClientGateway() *schema.Resource {
func DataSourceOutscaleClientGateway() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleClientGatewayRead,
Read: DataSourceOutscaleClientGatewayRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"bgp_asn": {
Expand Down Expand Up @@ -47,7 +47,7 @@ func dataSourceOutscaleClientGateway() *schema.Resource {
}
}

func dataSourceOutscaleClientGatewayRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleClientGatewayRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_client_gateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func dataSourceOutscaleClientGateways() *schema.Resource {
func DataSourceOutscaleClientGateways() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleClientGatewaysRead,
Read: DataSourceOutscaleClientGatewaysRead,
Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
"client_gateway_ids": {
Expand Down Expand Up @@ -61,7 +61,7 @@ func dataSourceOutscaleClientGateways() *schema.Resource {
}
}

func dataSourceOutscaleClientGatewaysRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleClientGatewaysRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_dhcp_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/spf13/cast"
)

func dataSourceOutscaleDHCPOption() *schema.Resource {
func DataSourceOutscaleDHCPOption() *schema.Resource {
return &schema.Resource{
Read: dataSourceOutscaleDHCPOptionRead,
Read: DataSourceOutscaleDHCPOptionRead,

Schema: map[string]*schema.Schema{
"filter": dataSourceFiltersSchema(),
Expand Down Expand Up @@ -61,7 +61,7 @@ func dataSourceOutscaleDHCPOption() *schema.Resource {
}
}

func dataSourceOutscaleDHCPOptionRead(d *schema.ResourceData, meta interface{}) error {
func DataSourceOutscaleDHCPOptionRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*OutscaleClient).OSCAPI

filters, filtersOk := d.GetOk("filter")
Expand Down
Loading

0 comments on commit e36e060

Please sign in to comment.