Class: Chef::Provider::AzureStorageAccount

Inherits:
Chef::Provisioning::AzureRM::AzureProvider show all
Defined in:
lib/chef/provider/azure_storage_account.rb

Instance Method Summary collapse

Methods inherited from Chef::Provisioning::AzureRM::AzureProvider

#action_handler, #compute_management_client, #network_management_client, #resource_management_client, #resource_manager_endpoint_url, #storage_management_client, #try_azure_operation

Instance Method Details

#create_storage_accountObject



51
52
53
54
55
56
57
58
59
60
# File 'lib/chef/provider/azure_storage_account.rb', line 51

def 
   = Azure::ARM::Storage::Models::StorageAccountCreateParameters.new
  .location = new_resource.location
  .tags = new_resource.tags
  .properties = Azure::ARM::Storage::Models::StorageAccountPropertiesCreateParameters.new
  .properties. = new_resource.
  action_handler.report_progress 'creating Storage Account'
  result = storage_management_client.storage_accounts.create(new_resource.resource_group, new_resource.name, )
  Chef::Log.debug(result)
end

#does_storage_account_existObject



43
44
45
46
47
48
49
# File 'lib/chef/provider/azure_storage_account.rb', line 43

def 
   = storage_management_client.storage_accounts.list_by_resource_group(new_resource.resource_group)
  .value.each do ||
    return true if .name == new_resource.name
  end
  false
end

#update_storage_accountObject



62
63
64
65
66
# File 'lib/chef/provider/azure_storage_account.rb', line 62

def 
  
  
  
end

#update_storage_account_account_typeObject



77
78
79
80
81
82
83
84
# File 'lib/chef/provider/azure_storage_account.rb', line 77

def 
   = Azure::ARM::Storage::Models::StorageAccountUpdateParameters.new
  .properties = Azure::ARM::Storage::Models::StorageAccountPropertiesUpdateParameters.new
  .properties. = new_resource.
  action_handler.report_progress 'updating Properties'
  result = storage_management_client.storage_accounts.update(new_resource.resource_group, new_resource.name, )
  Chef::Log.debug(result)
end

#update_storage_account_custom_domainObject



86
87
88
89
90
91
92
93
94
95
# File 'lib/chef/provider/azure_storage_account.rb', line 86

def 
   = Azure::ARM::Storage::Models::StorageAccountUpdateParameters.new
  .properties = Azure::ARM::Storage::Models::StorageAccountPropertiesUpdateParameters.new
  custom_domain = Azure::ARM::Storage::Models::CustomDomain.new
  custom_domain.name = new_resource.custom_domain
  .properties.custom_domain = custom_domain
  action_handler.report_progress 'updating Custom Domain'
  result = storage_management_client.storage_accounts.update(new_resource.resource_group, new_resource.name, )
  Chef::Log.debug(result)
end

#update_storage_account_tagsObject



68
69
70
71
72
73
74
75
# File 'lib/chef/provider/azure_storage_account.rb', line 68

def 
   = Azure::ARM::Storage::Models::StorageAccountUpdateParameters.new
  .tags = new_resource.tags
  .properties = Azure::ARM::Storage::Models::StorageAccountPropertiesUpdateParameters.new
  action_handler.report_progress 'updating Tags'
  result = storage_management_client.storage_accounts.update(new_resource.resource_group, new_resource.name, )
  Chef::Log.debug(result)
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/chef/provider/azure_storage_account.rb', line 8

def whyrun_supported?
  true
end