Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider: yet one more set of client registration changes #4050

Merged
merged 7 commits into from
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
468 changes: 51 additions & 417 deletions azurerm/config.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion azurerm/data_source_application_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceArmApplicationSecurityGroup() *schema.Resource {
}

func dataSourceArmApplicationSecurityGroupRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).applicationSecurityGroupsClient
client := meta.(*ArmClient).network.ApplicationSecurityGroupsClient
ctx := meta.(*ArmClient).StopContext

resourceGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_availability_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func dataSourceArmAvailabilitySet() *schema.Resource {
}

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

resGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_azuread_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ As such the Azure Active Directory resources within the AzureRM Provider are now
}

func dataSourceArmAzureADApplicationRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).applicationsClient
client := meta.(*ArmClient).graph.ApplicationsClient
ctx := meta.(*ArmClient).StopContext

var application graphrbac.Application
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_azuread_service_principal.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ As such the Azure Active Directory resources within the AzureRM Provider are now
}

func dataSourceArmActiveDirectoryServicePrincipalRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).servicePrincipalsClient
client := meta.(*ArmClient).graph.ServicePrincipalsClient
ctx := meta.(*ArmClient).StopContext

var servicePrincipal *graphrbac.ServicePrincipal
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_client_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func dataSourceArmClientConfigRead(d *schema.ResourceData, meta interface{}) err

var servicePrincipal *graphrbac.ServicePrincipal
if client.usingServicePrincipal {
spClient := client.servicePrincipalsClient
spClient := client.graph.ServicePrincipalsClient
// Application & Service Principal is 1:1 per tenant. Since we know the appId (client_id)
// here, we can query for the Service Principal whose appId matches.
filter := fmt.Sprintf("appId eq '%s'", client.clientId)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_data_lake_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func dataSourceArmDataLakeStoreAccount() *schema.Resource {
}

func dataSourceArmDateLakeStoreAccountRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).dataLakeStoreAccountClient
client := meta.(*ArmClient).datalake.StoreAccountsClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_dns_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func dataSourceArmDnsZoneRead(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error reading DNS Zone %q (Resource Group %q): %+v", name, resourceGroup, err)
}
} else {
rgClient := meta.(*ArmClient).resourceGroupsClient
rgClient := meta.(*ArmClient).resource.GroupsClient

resp, resourceGroup, err = findZone(client, rgClient, ctx, name)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_express_route_circuit.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func dataSourceArmExpressRouteCircuit() *schema.Resource {

func dataSourceArmExpressRouteCircuitRead(d *schema.ResourceData, meta interface{}) error {
ctx := meta.(*ArmClient).StopContext
client := meta.(*ArmClient).expressRouteCircuitClient
client := meta.(*ArmClient).network.ExpressRouteCircuitsClient

name := d.Get("name").(string)
resourceGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func dataSourceArmFirewall() *schema.Resource {
}

func dataSourceArmFirewallRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).azureFirewallsClient
client := meta.(*ArmClient).network.AzureFirewallsClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func dataSourceArmImage() *schema.Resource {
}

func dataSourceArmImageRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).imageClient
client := meta.(*ArmClient).compute.ImagesClient
ctx := meta.(*ArmClient).StopContext

resGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func dataSourceArmLoadBalancerRead(d *schema.ResourceData, meta interface{}) err
name := d.Get("name").(string)
resourceGroup := d.Get("resource_group_name").(string)

client := meta.(*ArmClient).loadBalancerClient
client := meta.(*ArmClient).network.LoadBalancersClient
ctx := meta.(*ArmClient).StopContext

resp, err := client.Get(ctx, resourceGroup, name, "")
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_managed_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func dataSourceArmManagedDisk() *schema.Resource {
}

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

resGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_monitor_action_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func dataSourceArmMonitorActionGroup() *schema.Resource {
}

func dataSourceArmMonitorActionGroupRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).monitorActionGroupsClient
client := meta.(*ArmClient).monitor.ActionGroupsClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_monitor_diagnostic_categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func dataSourceArmMonitorDiagnosticCategories() *schema.Resource {
}

func dataSourceArmMonitorDiagnosticCategoriesRead(d *schema.ResourceData, meta interface{}) error {
categoriesClient := meta.(*ArmClient).monitorDiagnosticSettingsCategoryClient
categoriesClient := meta.(*ArmClient).monitor.DiagnosticSettingsCategoryClient
ctx := meta.(*ArmClient).StopContext

actualResourceId := d.Get("resource_id").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_monitor_log_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func dataSourceArmMonitorLogProfile() *schema.Resource {
}

func dataSourceArmLogProfileRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).monitorLogProfilesClient
client := meta.(*ArmClient).monitor.LogProfilesClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_mssql_elasticpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func dataSourceArmMsSqlElasticpool() *schema.Resource {
}

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

resourceGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func dataSourceArmNetworkInterface() *schema.Resource {
}

func dataSourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).ifaceClient
client := meta.(*ArmClient).network.InterfacesClient
ctx := meta.(*ArmClient).StopContext

resGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_network_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func dataSourceArmNetworkSecurityGroup() *schema.Resource {
}

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

resourceGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_network_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceArmNetworkWatcher() *schema.Resource {
}

func dataSourceArmNetworkWatcherRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).watcherClient
client := meta.(*ArmClient).network.WatcherClient

name := d.Get("name").(string)
resourceGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_platform_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func dataSourceArmPlatformImage() *schema.Resource {
}

func dataSourceArmPlatformImageRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).vmImageClient
client := meta.(*ArmClient).compute.VMImageClient
ctx := meta.(*ArmClient).StopContext

location := azure.NormalizeLocation(d.Get("location").(string))
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_public_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func dataSourceArmPublicIP() *schema.Resource {
}

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

resGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_public_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func dataSourceArmPublicIPs() *schema.Resource {
}

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

resourceGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_resource_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func dataSourceArmResourceGroup() *schema.Resource {
}

func dataSourceArmResourceGroupRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).resourceGroupsClient
client := meta.(*ArmClient).resource.GroupsClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func dataSourceArmRouteTable() *schema.Resource {
}

func dataSourceArmRouteTableRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).routeTablesClient
client := meta.(*ArmClient).network.RouteTablesClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_shared_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func dataSourceArmSharedImage() *schema.Resource {
}
}
func dataSourceArmSharedImageRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).galleryImagesClient
client := meta.(*ArmClient).compute.GalleryImagesClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_shared_image_gallery.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func dataSourceArmSharedImageGallery() *schema.Resource {
}

func dataSourceArmSharedImageGalleryRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).galleriesClient
client := meta.(*ArmClient).compute.GalleriesClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_shared_image_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func dataSourceArmSharedImageVersion() *schema.Resource {
}

func dataSourceArmSharedImageVersionRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).galleryImageVersionsClient
client := meta.(*ArmClient).compute.GalleryImageVersionsClient
ctx := meta.(*ArmClient).StopContext

imageVersion := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func dataSourceArmSnapshot() *schema.Resource {
}

func dataSourceArmSnapshotRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).snapshotsClient
client := meta.(*ArmClient).compute.SnapshotsClient
ctx := meta.(*ArmClient).StopContext

resourceGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_sql_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func dataSourceSqlServer() *schema.Resource {
}

func dataSourceArmSqlServerRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).sqlServersClient
client := meta.(*ArmClient).sql.ServersClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func dataSourceArmSubnet() *schema.Resource {
}

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

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func dataSourceArmSubscription() *schema.Resource {

func dataSourceArmSubscriptionRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient)
groupClient := client.subscriptionsClient
groupClient := client.subscription.Client
ctx := client.StopContext

subscriptionId := d.Get("subscription_id").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func dataSourceArmSubscriptions() *schema.Resource {

func dataSourceArmSubscriptionsRead(d *schema.ResourceData, meta interface{}) error {
armClient := meta.(*ArmClient)
subClient := armClient.subscriptionsClient
subClient := armClient.subscription.Client
ctx := armClient.StopContext

displayNamePrefix := strings.ToLower(d.Get("display_name_prefix").(string))
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func dataSourceArmVirtualMachine() *schema.Resource {
}

func dataSourceArmVirtualMachineRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).vmClient
client := meta.(*ArmClient).compute.VMClient
ctx := meta.(*ArmClient).StopContext

resGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_virtual_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func dataSourceArmVirtualNetwork() *schema.Resource {
}

func dataSourceArmVnetRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).vnetClient
client := meta.(*ArmClient).network.VnetClient
ctx := meta.(*ArmClient).StopContext

resGroup := d.Get("resource_group_name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_virtual_network_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func dataSourceArmVirtualNetworkGateway() *schema.Resource {
}

func dataSourceArmVirtualNetworkGatewayRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).vnetGatewayClient
client := meta.(*ArmClient).network.VnetGatewayClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_virtual_network_gateway_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func dataSourceArmVirtualNetworkGatewayConnection() *schema.Resource {
}

func dataSourceArmVirtualNetworkGatewayConnectionRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient).vnetGatewayConnectionsClient
client := meta.(*ArmClient).network.VnetGatewayConnectionsClient
ctx := meta.(*ArmClient).StopContext

name := d.Get("name").(string)
Expand Down
19 changes: 11 additions & 8 deletions azurerm/internal/common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ import (
)

type ClientOptions struct {
GraphAuthorizer autorest.Authorizer
GraphEndpoint string
KeyVaultAuthorizer autorest.Authorizer
ResourceManagerAuthorizer autorest.Authorizer
ResourceManagerEndpoint string
StorageAuthorizer autorest.Authorizer
SubscriptionId string
PartnerId string
SubscriptionId string
TenantID string
PartnerId string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a blocker for this PR, but we should make these all Id or ID


GraphAuthorizer autorest.Authorizer
GraphEndpoint string
KeyVaultAuthorizer autorest.Authorizer
ResourceManagerAuthorizer autorest.Authorizer
ResourceManagerEndpoint string
StorageAuthorizer autorest.Authorizer

PollingDuration time.Duration
SkipProviderReg bool
DisableCorrelationRequestID bool
Expand Down
Loading