Class: Chef::Provisioning::AzureRM::AzureProvider
- Inherits:
-
Chef::Provider::LWRPBase
- Object
- Chef::Provider::LWRPBase
- Chef::Provisioning::AzureRM::AzureProvider
show all
- Defined in:
- lib/chef/provisioning/azurerm/azure_provider.rb
Instance Method Summary
collapse
Instance Method Details
#action_handler ⇒ Object
11
12
13
|
# File 'lib/chef/provisioning/azurerm/azure_provider.rb', line 11
def action_handler
@action_handler ||= Chef::Provisioning::ChefProviderActionHandler.new(self)
end
|
#compute_management_client ⇒ Object
29
30
31
32
33
34
|
# File 'lib/chef/provisioning/azurerm/azure_provider.rb', line 29
def compute_management_client
credentials = Credentials.new.azure_credentials_for_subscription(new_resource.subscription_id)
client = Azure::ARM::Compute::ComputeManagementClient.new(credentials)
client.subscription_id = new_resource.subscription_id
client
end
|
#network_management_client ⇒ Object
36
37
38
39
40
41
|
# File 'lib/chef/provisioning/azurerm/azure_provider.rb', line 36
def network_management_client
credentials = Credentials.new.azure_credentials_for_subscription(new_resource.subscription_id)
client = Azure::ARM::Network::NetworkResourceProviderClient.new(credentials)
client.subscription_id = new_resource.subscription_id
client
end
|
#resource_management_client ⇒ Object
15
16
17
18
19
20
|
# File 'lib/chef/provisioning/azurerm/azure_provider.rb', line 15
def resource_management_client
credentials = Credentials.new.azure_credentials_for_subscription(new_resource.subscription_id)
client = Azure::ARM::Resources::ResourceManagementClient.new(credentials)
client.subscription_id = new_resource.subscription_id
client
end
|
#storage_management_client ⇒ Object
22
23
24
25
26
27
|
# File 'lib/chef/provisioning/azurerm/azure_provider.rb', line 22
def storage_management_client
credentials = Credentials.new.azure_credentials_for_subscription(new_resource.subscription_id)
client = Azure::ARM::Storage::StorageManagementClient.new(credentials)
client.subscription_id = new_resource.subscription_id
client
end
|
#try_azure_operation(description, silently_continue_on_error = false) ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/chef/provisioning/azurerm/azure_provider.rb', line 43
def try_azure_operation(description, silently_continue_on_error = false)
begin
result = yield
rescue MsRestAzure::AzureOperationError => operation_error
unless silently_continue_on_error
error = operation_error.body['error']
Chef::Log.error "ERROR #{description} - #{error}"
raise operation_error
end
end
result
end
|