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/azurerm: Bump AzureRM SDK to v8.0.1-beta #11866

Merged
merged 3 commits into from
Feb 23, 2017
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
12 changes: 6 additions & 6 deletions builtin/providers/azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type ArmClient struct {
rivieraClient *riviera.Client

availSetClient compute.AvailabilitySetsClient
usageOpsClient compute.UsageOperationsClient
usageOpsClient compute.UsageClient
vmExtensionImageClient compute.VirtualMachineExtensionImagesClient
vmExtensionClient compute.VirtualMachineExtensionsClient
vmScaleSetClient compute.VirtualMachineScaleSetsClient
Expand Down Expand Up @@ -74,7 +74,7 @@ type ArmClient struct {
providers resources.ProvidersClient
resourceGroupClient resources.GroupsClient
tagsClient resources.TagsClient
resourceFindClient resources.Client
resourceFindClient resources.GroupClient

jobsClient scheduler.JobsClient
jobsCollectionsClient scheduler.JobCollectionsClient
Expand All @@ -84,7 +84,7 @@ type ArmClient struct {

deploymentsClient resources.DeploymentsClient

redisClient redis.Client
redisClient redis.GroupClient

trafficManagerProfilesClient trafficmanager.ProfilesClient
trafficManagerEndpointsClient trafficmanager.EndpointsClient
Expand Down Expand Up @@ -189,7 +189,7 @@ func (c *Config) getArmClient() (*ArmClient, error) {
asc.Sender = autorest.CreateSender(withRequestLogging())
client.availSetClient = asc

uoc := compute.NewUsageOperationsClientWithBaseURI(endpoint, c.SubscriptionID)
uoc := compute.NewUsageClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&uoc.Client)
uoc.Authorizer = spt
uoc.Sender = autorest.CreateSender(withRequestLogging())
Expand Down Expand Up @@ -351,7 +351,7 @@ func (c *Config) getArmClient() (*ArmClient, error) {
tc.Sender = autorest.CreateSender(withRequestLogging())
client.tagsClient = tc

rf := resources.NewClientWithBaseURI(endpoint, c.SubscriptionID)
rf := resources.NewGroupClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&rf.Client)
rf.Authorizer = spt
rf.Sender = autorest.CreateSender(withRequestLogging())
Expand Down Expand Up @@ -411,7 +411,7 @@ func (c *Config) getArmClient() (*ArmClient, error) {
tmec.Sender = autorest.CreateSender(withRequestLogging())
client.trafficManagerEndpointsClient = tmec

rdc := redis.NewClientWithBaseURI(endpoint, c.SubscriptionID)
rdc := redis.NewGroupClientWithBaseURI(endpoint, c.SubscriptionID)
setUserAgent(&rdc.Client)
rdc.Authorizer = spt
rdc.Sender = autorest.CreateSender(withRequestLogging())
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/azurerm/resource_arm_key_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func expandKeyVaultAccessPolicies(d *schema.ResourceData) *[]keyvault.AccessPoli

tenantUUID := uuid.FromStringOrNil(policyRaw["tenant_id"].(string))
policy.TenantID = &tenantUUID
objectUUID := uuid.FromStringOrNil(policyRaw["object_id"].(string))
objectUUID := policyRaw["object_id"].(string)
policy.ObjectID = &objectUUID

result = append(result, policy)
Expand Down Expand Up @@ -313,7 +313,7 @@ func flattenKeyVaultAccessPolicies(policies *[]keyvault.AccessPolicyEntry) []int
}

policyRaw["tenant_id"] = policy.TenantID.String()
policyRaw["object_id"] = policy.ObjectID.String()
policyRaw["object_id"] = policy.ObjectID
policyRaw["key_permissions"] = keyPermissionsRaw
policyRaw["secret_permissions"] = secretPermissionsRaw

Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/azurerm/resource_arm_redis_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func resourceArmRedisCacheUpdate(d *schema.ResourceData, meta interface{}) error
parameters.RedisConfiguration = redisConfiguration
}

_, err := client.Update(resGroup, name, parameters, make(chan struct{}))
_, err := client.Update(resGroup, name, parameters)
if err != nil {
return err
}
Expand Down Expand Up @@ -344,7 +344,7 @@ func resourceArmRedisCacheDelete(d *schema.ResourceData, meta interface{}) error
return nil
}

func redisStateRefreshFunc(client redis.Client, resourceGroupName string, sgName string) resource.StateRefreshFunc {
func redisStateRefreshFunc(client redis.GroupClient, resourceGroupName string, sgName string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
res, err := client.Get(resourceGroupName, sgName)
if err != nil {
Expand Down
26 changes: 18 additions & 8 deletions builtin/providers/azurerm/resource_arm_storage_share.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package azurerm
import (
"fmt"
"log"
// "strings"
"regexp"
"strconv"

"github.com/Azure/azure-sdk-for-go/storage"
"github.com/hashicorp/terraform/helper/schema"
Expand Down Expand Up @@ -66,10 +64,18 @@ func resourceArmStorageShareCreate(d *schema.ResourceData, meta interface{}) err
metaData := make(map[string]string) // TODO: support MetaData

log.Printf("[INFO] Creating share %q in storage account %q", name, storageAccountName)
err = fileClient.CreateShare(name, metaData)
reference := fileClient.GetShareReference(name)
err = reference.Create()

log.Printf("[INFO] Setting share %q metadata in storage account %q", name, storageAccountName)
reference.Metadata = metaData
reference.SetMetadata()

log.Printf("[INFO] Setting share %q properties in storage account %q", name, storageAccountName)
fileClient.SetShareProperties(name, storage.ShareHeaders{Quota: strconv.Itoa(d.Get("quota").(int))})
reference.Properties = storage.ShareProperties{
Quota: d.Get("quota").(int),
}
reference.SetProperties()

d.SetId(name)
return resourceArmStorageShareRead(d, meta)
Expand Down Expand Up @@ -103,7 +109,8 @@ func resourceArmStorageShareRead(d *schema.ResourceData, meta interface{}) error

name := d.Get("name").(string)

url := fileClient.GetShareURL(name)
reference := fileClient.GetShareReference(name)
url := reference.URL()
if url == "" {
log.Printf("[INFO] URL for %q is empty", name)
}
Expand Down Expand Up @@ -131,7 +138,8 @@ func resourceArmStorageShareExists(d *schema.ResourceData, meta interface{}) (bo
name := d.Get("name").(string)

log.Printf("[INFO] Checking for existence of share %q.", name)
exists, err := fileClient.ShareExists(name)
reference := fileClient.GetShareReference(name)
exists, err := reference.Exists()
if err != nil {
return false, fmt.Errorf("Error testing existence of share %q: %s", name, err)
}
Expand Down Expand Up @@ -161,8 +169,10 @@ func resourceArmStorageShareDelete(d *schema.ResourceData, meta interface{}) err

name := d.Get("name").(string)

log.Printf("[INFO] Deleting storage file %q", name)
if _, err = fileClient.DeleteShareIfExists(name); err != nil {
reference := fileClient.GetShareReference(name)
err = reference.Create()

if _, err = reference.DeleteIfExists(); err != nil {
return fmt.Errorf("Error deleting storage file %q: %s", name, err)
}

Expand Down
8 changes: 5 additions & 3 deletions builtin/providers/azurerm/resource_arm_storage_share_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ func testAccARMStorageShareDisappears(name string, sS *storage.Share) resource.T
return nil
}

_, err = fileClient.DeleteShareIfExists(sS.Name)
if err != nil {
return err
reference := fileClient.GetShareReference(sS.Name)
err = reference.Create()

if _, err = reference.DeleteIfExists(); err != nil {
return fmt.Errorf("Error deleting storage file %q: %s", name, err)
}

return nil
Expand Down
90 changes: 86 additions & 4 deletions vendor/github.com/Azure/azure-sdk-for-go/arm/cdn/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 27 additions & 27 deletions vendor/github.com/Azure/azure-sdk-for-go/arm/cdn/customdomains.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading