Skip to content

Commit

Permalink
Merge pull request #2604 from terraform-providers/refactor/create-update
Browse files Browse the repository at this point in the history
Ensure create & update functions have create & update in the name
  • Loading branch information
katbyte authored Jan 6, 2019
2 parents ba0bb15 + ac5f488 commit 32ea940
Show file tree
Hide file tree
Showing 26 changed files with 78 additions and 78 deletions.
6 changes: 3 additions & 3 deletions azurerm/resource_arm_app_service_active_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

func resourceArmAppServiceActiveSlot() *schema.Resource {
return &schema.Resource{
Create: resourceArmAppServiceActiveSlotCreate,
Create: resourceArmAppServiceActiveSlotCreateUpdate,
Read: resourceArmAppServiceActiveSlotRead,
Update: resourceArmAppServiceActiveSlotCreate,
Update: resourceArmAppServiceActiveSlotCreateUpdate,
Delete: resourceArmAppServiceActiveSlotDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand All @@ -36,7 +36,7 @@ func resourceArmAppServiceActiveSlot() *schema.Resource {
}
}

func resourceArmAppServiceActiveSlotCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmAppServiceActiveSlotCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).appServicesClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_availability_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

func resourceArmAvailabilitySet() *schema.Resource {
return &schema.Resource{
Create: resourceArmAvailabilitySetCreate,
Create: resourceArmAvailabilitySetCreateUpdate,
Read: resourceArmAvailabilitySetRead,
Update: resourceArmAvailabilitySetCreate,
Update: resourceArmAvailabilitySetCreateUpdate,
Delete: resourceArmAvailabilitySetDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -61,7 +61,7 @@ func resourceArmAvailabilitySet() *schema.Resource {
}
}

func resourceArmAvailabilitySetCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmAvailabilitySetCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).availSetClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_container_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

func resourceArmContainerService() *schema.Resource {
return &schema.Resource{
Create: resourceArmContainerServiceCreate,
Create: resourceArmContainerServiceCreateUpdate,
Read: resourceArmContainerServiceRead,
Update: resourceArmContainerServiceCreate,
Update: resourceArmContainerServiceCreateUpdate,
Delete: resourceArmContainerServiceDelete,

DeprecationMessage: `Azure Container Service (ACS) has been deprecated in favour of Azure (Managed) Kubernetes Service (AKS).
Expand Down Expand Up @@ -191,7 +191,7 @@ More information can be found here: https://azure.microsoft.com/en-us/updates/az
}
}

func resourceArmContainerServiceCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmContainerServiceCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient)
ctx := meta.(*ArmClient).StopContext
containerServiceClient := client.containerServicesClient
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_eventhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

func resourceArmEventHub() *schema.Resource {
return &schema.Resource{
Create: resourceArmEventHubCreate,
Create: resourceArmEventHubCreateUpdate,
Read: resourceArmEventHubRead,
Update: resourceArmEventHubCreate,
Update: resourceArmEventHubCreateUpdate,
Delete: resourceArmEventHubDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -136,7 +136,7 @@ func resourceArmEventHub() *schema.Resource {
}
}

func resourceArmEventHubCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmEventHubCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).eventHubClient
ctx := meta.(*ArmClient).StopContext
log.Printf("[INFO] preparing arguments for Azure ARM EventHub creation.")
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_eventhub_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ var eventHubNamespaceDefaultAuthorizationRule = "RootManageSharedAccessKey"

func resourceArmEventHubNamespace() *schema.Resource {
return &schema.Resource{
Create: resourceArmEventHubNamespaceCreate,
Create: resourceArmEventHubNamespaceCreateUpdate,
Read: resourceArmEventHubNamespaceRead,
Update: resourceArmEventHubNamespaceCreate,
Update: resourceArmEventHubNamespaceCreateUpdate,
Delete: resourceArmEventHubNamespaceDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -103,7 +103,7 @@ func resourceArmEventHubNamespace() *schema.Resource {
}
}

func resourceArmEventHubNamespaceCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmEventHubNamespaceCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).eventHubNamespacesClient
ctx := meta.(*ArmClient).StopContext
log.Printf("[INFO] preparing arguments for AzureRM EventHub Namespace creation.")
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

func resourceArmLoadBalancer() *schema.Resource {
return &schema.Resource{
Create: resourceArmLoadBalancerCreate,
Create: resourceArmLoadBalancerCreateUpdate,
Read: resourceArmLoadBalancerRead,
Update: resourceArmLoadBalancerCreate,
Update: resourceArmLoadBalancerCreateUpdate,
Delete: resourceArmLoadBalancerDelete,

Importer: &schema.ResourceImporter{
Expand Down Expand Up @@ -136,7 +136,7 @@ func resourceArmLoadBalancer() *schema.Resource {
}
}

func resourceArmLoadBalancerCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmLoadBalancerCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).loadBalancerClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_loadbalancer_nat_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

func resourceArmLoadBalancerNatPool() *schema.Resource {
return &schema.Resource{
Create: resourceArmLoadBalancerNatPoolCreate,
Create: resourceArmLoadBalancerNatPoolCreateUpdate,
Read: resourceArmLoadBalancerNatPoolRead,
Update: resourceArmLoadBalancerNatPoolCreate,
Update: resourceArmLoadBalancerNatPoolCreateUpdate,
Delete: resourceArmLoadBalancerNatPoolDelete,
Importer: &schema.ResourceImporter{
State: loadBalancerSubResourceStateImporter,
Expand Down Expand Up @@ -88,7 +88,7 @@ func resourceArmLoadBalancerNatPool() *schema.Resource {
}
}

func resourceArmLoadBalancerNatPoolCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmLoadBalancerNatPoolCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).loadBalancerClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_loadbalancer_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

func resourceArmLoadBalancerRule() *schema.Resource {
return &schema.Resource{
Create: resourceArmLoadBalancerRuleCreate,
Create: resourceArmLoadBalancerRuleCreateUpdate,
Read: resourceArmLoadBalancerRuleRead,
Update: resourceArmLoadBalancerRuleCreate,
Update: resourceArmLoadBalancerRuleCreateUpdate,
Delete: resourceArmLoadBalancerRuleDelete,

Importer: &schema.ResourceImporter{
Expand Down Expand Up @@ -115,7 +115,7 @@ func resourceArmLoadBalancerRule() *schema.Resource {
}
}

func resourceArmLoadBalancerRuleCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmLoadBalancerRuleCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).loadBalancerClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_local_network_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

func resourceArmLocalNetworkGateway() *schema.Resource {
return &schema.Resource{
Create: resourceArmLocalNetworkGatewayCreate,
Create: resourceArmLocalNetworkGatewayCreateUpdate,
Read: resourceArmLocalNetworkGatewayRead,
Update: resourceArmLocalNetworkGatewayCreate,
Update: resourceArmLocalNetworkGatewayCreateUpdate,
Delete: resourceArmLocalNetworkGatewayDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -73,7 +73,7 @@ func resourceArmLocalNetworkGateway() *schema.Resource {
}
}

func resourceArmLocalNetworkGatewayCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmLocalNetworkGatewayCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).localNetConnClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_managed_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (

func resourceArmManagedDisk() *schema.Resource {
return &schema.Resource{
Create: resourceArmManagedDiskCreate,
Create: resourceArmManagedDiskCreateUpdate,
Read: resourceArmManagedDiskRead,
Update: resourceArmManagedDiskCreate,
Update: resourceArmManagedDiskCreateUpdate,
Delete: resourceArmManagedDiskDelete,

Importer: &schema.ResourceImporter{
Expand Down Expand Up @@ -112,7 +112,7 @@ func validateDiskSizeGB(v interface{}, _ string) (warnings []string, errors []er
return warnings, errors
}

func resourceArmManagedDiskCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmManagedDiskCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).diskClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_mssql_elasticpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (

func resourceArmMsSqlElasticPool() *schema.Resource {
return &schema.Resource{
Create: resourceArmMsSqlElasticPoolCreate,
Create: resourceArmMsSqlElasticPoolCreateUpdate,
Read: resourceArmMsSqlElasticPoolRead,
Update: resourceArmMsSqlElasticPoolCreate,
Update: resourceArmMsSqlElasticPoolCreateUpdate,
Delete: resourceArmMsSqlElasticPoolDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -254,7 +254,7 @@ func resourceArmMsSqlElasticPool() *schema.Resource {
}
}

func resourceArmMsSqlElasticPoolCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmMsSqlElasticPoolCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).msSqlElasticPoolsClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_network_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var networkSecurityGroupResourceName = "azurerm_network_security_group"

func resourceArmNetworkSecurityGroup() *schema.Resource {
return &schema.Resource{
Create: resourceArmNetworkSecurityGroupCreate,
Create: resourceArmNetworkSecurityGroupCreateUpdate,
Read: resourceArmNetworkSecurityGroupRead,
Update: resourceArmNetworkSecurityGroupCreate,
Update: resourceArmNetworkSecurityGroupCreateUpdate,
Delete: resourceArmNetworkSecurityGroupDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -158,7 +158,7 @@ func resourceArmNetworkSecurityGroup() *schema.Resource {
}
}

func resourceArmNetworkSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmNetworkSecurityGroupCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).secGroupClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_network_security_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

func resourceArmNetworkSecurityRule() *schema.Resource {
return &schema.Resource{
Create: resourceArmNetworkSecurityRuleCreate,
Create: resourceArmNetworkSecurityRuleCreateUpdate,
Read: resourceArmNetworkSecurityRuleRead,
Update: resourceArmNetworkSecurityRuleCreate,
Update: resourceArmNetworkSecurityRuleCreateUpdate,
Delete: resourceArmNetworkSecurityRuleDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -152,7 +152,7 @@ func resourceArmNetworkSecurityRule() *schema.Resource {
}
}

func resourceArmNetworkSecurityRuleCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmNetworkSecurityRuleCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).secRuleClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_public_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (

func resourceArmPublicIp() *schema.Resource {
return &schema.Resource{
Create: resourceArmPublicIpCreate,
Create: resourceArmPublicIpCreateUpdate,
Read: resourceArmPublicIpRead,
Update: resourceArmPublicIpCreate,
Update: resourceArmPublicIpCreateUpdate,
Delete: resourceArmPublicIpDelete,

Importer: &schema.ResourceImporter{
Expand Down Expand Up @@ -117,7 +117,7 @@ func resourceArmPublicIp() *schema.Resource {
}
}

func resourceArmPublicIpCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmPublicIpCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).publicIPClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_servicebus_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ var serviceBusNamespaceDefaultAuthorizationRule = "RootManageSharedAccessKey"

func resourceArmServiceBusNamespace() *schema.Resource {
return &schema.Resource{
Create: resourceArmServiceBusNamespaceCreate,
Create: resourceArmServiceBusNamespaceCreateUpdate,
Read: resourceArmServiceBusNamespaceRead,
Update: resourceArmServiceBusNamespaceCreate,
Update: resourceArmServiceBusNamespaceCreateUpdate,
Delete: resourceArmServiceBusNamespaceDelete,

Importer: &schema.ResourceImporter{
Expand Down Expand Up @@ -108,7 +108,7 @@ func resourceArmServiceBusNamespace() *schema.Resource {
}
}

func resourceArmServiceBusNamespaceCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmServiceBusNamespaceCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).serviceBusNamespacesClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_servicebus_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

func resourceArmServiceBusSubscription() *schema.Resource {
return &schema.Resource{
Create: resourceArmServiceBusSubscriptionCreate,
Create: resourceArmServiceBusSubscriptionCreateUpdate,
Read: resourceArmServiceBusSubscriptionRead,
Update: resourceArmServiceBusSubscriptionCreate,
Update: resourceArmServiceBusSubscriptionCreateUpdate,
Delete: resourceArmServiceBusSubscriptionDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -101,7 +101,7 @@ func resourceArmServiceBusSubscription() *schema.Resource {
}
}

func resourceArmServiceBusSubscriptionCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmServiceBusSubscriptionCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).serviceBusSubscriptionsClient
ctx := meta.(*ArmClient).StopContext
log.Printf("[INFO] preparing arguments for Azure ARM ServiceBus Subscription creation.")
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_servicebus_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

func resourceArmServiceBusTopic() *schema.Resource {
return &schema.Resource{
Create: resourceArmServiceBusTopicCreate,
Create: resourceArmServiceBusTopicCreateUpdate,
Read: resourceArmServiceBusTopicRead,
Update: resourceArmServiceBusTopicCreate,
Update: resourceArmServiceBusTopicCreateUpdate,
Delete: resourceArmServiceBusTopicDelete,

Importer: &schema.ResourceImporter{
Expand Down Expand Up @@ -116,7 +116,7 @@ func resourceArmServiceBusTopic() *schema.Resource {
}
}

func resourceArmServiceBusTopicCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmServiceBusTopicCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).serviceBusTopicsClient
ctx := meta.(*ArmClient).StopContext
log.Printf("[INFO] preparing arguments for Azure ServiceBus Topic creation.")
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ var subnetResourceName = "azurerm_subnet"

func resourceArmSubnet() *schema.Resource {
return &schema.Resource{
Create: resourceArmSubnetCreate,
Create: resourceArmSubnetCreateUpdate,
Read: resourceArmSubnetRead,
Update: resourceArmSubnetCreate,
Update: resourceArmSubnetCreateUpdate,
Delete: resourceArmSubnetDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -70,7 +70,7 @@ func resourceArmSubnet() *schema.Resource {
}
}

func resourceArmSubnetCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmSubnetCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).subnetClient
ctx := meta.(*ArmClient).StopContext

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_template_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

func resourceArmTemplateDeployment() *schema.Resource {
return &schema.Resource{
Create: resourceArmTemplateDeploymentCreate,
Create: resourceArmTemplateDeploymentCreateUpdate,
Read: resourceArmTemplateDeploymentRead,
Update: resourceArmTemplateDeploymentCreate,
Update: resourceArmTemplateDeploymentCreateUpdate,
Delete: resourceArmTemplateDeploymentDelete,

Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -70,7 +70,7 @@ func resourceArmTemplateDeployment() *schema.Resource {
}
}

func resourceArmTemplateDeploymentCreate(d *schema.ResourceData, meta interface{}) error {
func resourceArmTemplateDeploymentCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient)
deployClient := client.deploymentsClient
ctx := client.StopContext
Expand Down
Loading

0 comments on commit 32ea940

Please sign in to comment.