github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/provider/azure/clients.go (about) 1 // Copyright 2022 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package azure 5 6 import ( 7 "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" 8 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v2" 9 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" 10 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork" 11 "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" 12 ) 13 14 func (env *azureEnviron) deployClient() (*armresources.DeploymentsClient, error) { 15 return armresources.NewDeploymentsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 16 ClientOptions: env.clientOptions, 17 }) 18 } 19 20 func (env *azureEnviron) computeClient() (*armcompute.VirtualMachinesClient, error) { 21 return armcompute.NewVirtualMachinesClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 22 ClientOptions: env.clientOptions, 23 }) 24 } 25 26 func (env *azureEnviron) resourceGroupsClient() (*armresources.ResourceGroupsClient, error) { 27 return armresources.NewResourceGroupsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 28 ClientOptions: env.clientOptions, 29 }) 30 } 31 32 func (env *azureEnviron) disksClient() (*armcompute.DisksClient, error) { 33 return armcompute.NewDisksClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 34 ClientOptions: env.clientOptions, 35 }) 36 } 37 38 func (env *azureEnviron) encryptionSetsClient() (*armcompute.DiskEncryptionSetsClient, error) { 39 return armcompute.NewDiskEncryptionSetsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 40 ClientOptions: env.clientOptions, 41 }) 42 } 43 44 func (env *azureEnviron) imagesClient() (*armcompute.VirtualMachineImagesClient, error) { 45 return armcompute.NewVirtualMachineImagesClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 46 ClientOptions: env.clientOptions, 47 }) 48 } 49 50 func (env *azureEnviron) availabilitySetsClient() (*armcompute.AvailabilitySetsClient, error) { 51 return armcompute.NewAvailabilitySetsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 52 ClientOptions: env.clientOptions, 53 }) 54 } 55 56 func (env *azureEnviron) resourceSKUsClient() (*armcompute.ResourceSKUsClient, error) { 57 return armcompute.NewResourceSKUsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 58 ClientOptions: env.clientOptions, 59 }) 60 } 61 62 func (env *azureEnviron) resourcesClient() (*armresources.Client, error) { 63 return armresources.NewClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 64 ClientOptions: env.clientOptions, 65 }) 66 } 67 68 func (env *azureEnviron) providersClient() (*armresources.ProvidersClient, error) { 69 return armresources.NewProvidersClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 70 ClientOptions: env.clientOptions, 71 }) 72 } 73 74 func (env *azureEnviron) vaultsClient() (*armkeyvault.VaultsClient, error) { 75 return armkeyvault.NewVaultsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 76 ClientOptions: env.clientOptions, 77 }) 78 79 } 80 81 func (env *azureEnviron) publicAddressesClient() (*armnetwork.PublicIPAddressesClient, error) { 82 return armnetwork.NewPublicIPAddressesClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 83 ClientOptions: env.clientOptions, 84 }) 85 } 86 87 func (env *azureEnviron) interfacesClient() (*armnetwork.InterfacesClient, error) { 88 return armnetwork.NewInterfacesClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 89 ClientOptions: env.clientOptions, 90 }) 91 } 92 93 func (env *azureEnviron) subnetsClient() (*armnetwork.SubnetsClient, error) { 94 return armnetwork.NewSubnetsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 95 ClientOptions: env.clientOptions, 96 }) 97 } 98 99 func (env *azureEnviron) securityRulesClient() (*armnetwork.SecurityRulesClient, error) { 100 return armnetwork.NewSecurityRulesClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 101 ClientOptions: env.clientOptions, 102 }) 103 } 104 105 func (env *azureEnviron) securityGroupsClient() (*armnetwork.SecurityGroupsClient, error) { 106 return armnetwork.NewSecurityGroupsClient(env.subscriptionId, env.credential, &arm.ClientOptions{ 107 ClientOptions: env.clientOptions, 108 }) 109 }