Module: Azure::Configurable
Overview
The Azure::Configurable module provides basic configuration for Azure activities.
Instance Attribute Summary collapse
-
#acs_host ⇒ String
readonly
Get the host for the ACS service.
-
#ca_file ⇒ String
Location of the Certificate Authority bundle to be used for HTTPS.
-
#http_certificate_key ⇒ Object
Public side of the management certificate.
-
#http_private_key ⇒ Object
Private side of the management certificate.
-
#management_certificate ⇒ String|File
Azure Service Management certificate (pfx or pem).
-
#management_endpoint ⇒ String
Azure Service Management Endpoint.
-
#sb_access_key ⇒ String
Azure Service Bus access key.
-
#sb_issuer ⇒ String
Azure Service Bus issuer.
-
#sb_namespace ⇒ String
Azure Service Bus namespace.
-
#sb_sas_key ⇒ String
Azure Service Bus Shared Access Signature key.
-
#sb_sas_key_name ⇒ String
Azure Service Bus Shared Access Signature key name.
-
#service_bus_host ⇒ String
readonly
Get the host for Service Bus based on the Service Bus Namespace.
-
#sql_database_management_endpoint ⇒ String
Azure SQL database management endpoint.
-
#storage_access_key ⇒ Object
Returns the value of attribute storage_access_key.
-
#storage_account_name ⇒ String
Azure Storage account name.
-
#storage_blob_host ⇒ String
Storage blob host.
-
#storage_queue_host ⇒ String
Storage queue host.
-
#storage_table_host ⇒ String
Storage table host.
-
#subscription_id ⇒ String
Azure Subscription ID.
Class Method Summary collapse
-
.keys ⇒ Array
List of configurable keys for Client.
Instance Method Summary collapse
- #config ⇒ Object
-
#configure {|_self| ... } ⇒ Object
Set configuration options using a block.
-
#reset!(options = {}) ⇒ Object
(also: #setup)
Reset configuration options to default values.
Instance Attribute Details
#acs_host ⇒ String (readonly)
Get the host for the ACS service.
241 242 243 |
# File 'lib/azure/configurable.rb', line 241 def acs_host @acs_host end |
#ca_file ⇒ String
Returns Location of the Certificate Authority bundle to be used for HTTPS.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#http_certificate_key ⇒ Object
Public side of the management certificate
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#http_private_key ⇒ Object
Private side of the management certificate
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#management_certificate ⇒ String|File
Returns Azure Service Management certificate (pfx or pem).
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#management_endpoint ⇒ String
Returns Azure Service Management Endpoint. default: management.core.windows.net.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#sb_access_key ⇒ String
Returns Azure Service Bus access key.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#sb_issuer ⇒ String
Returns Azure Service Bus issuer.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#sb_namespace ⇒ String
Returns Azure Service Bus namespace.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#sb_sas_key ⇒ String
Returns Azure Service Bus Shared Access Signature key.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#sb_sas_key_name ⇒ String
Returns Azure Service Bus Shared Access Signature key name.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#service_bus_host ⇒ String (readonly)
Get the host for Service Bus based on the Service Bus Namespace.
251 252 253 |
# File 'lib/azure/configurable.rb', line 251 def service_bus_host @service_bus_host end |
#sql_database_management_endpoint ⇒ String
Returns Azure SQL database management endpoint. default: management.core.windows.net:8443/.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#storage_access_key ⇒ Object
Returns the value of attribute storage_access_key.
65 66 67 |
# File 'lib/azure/configurable.rb', line 65 def storage_access_key @storage_access_key end |
#storage_account_name ⇒ String
Returns Azure Storage account name.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#storage_blob_host ⇒ String
Storage blob host
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#storage_queue_host ⇒ String
Storage queue host
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#storage_table_host ⇒ String
Storage table host
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
#subscription_id ⇒ String
Returns Azure Subscription ID.
65 66 67 68 69 70 71 72 73 |
# File 'lib/azure/configurable.rb', line 65 attr_accessor :storage_access_key, :storage_account_name, :sb_access_key, :sb_namespace, :sb_sas_key, :sb_sas_key_name, :sb_issuer, :ca_file, :subscription_id |
Class Method Details
.keys ⇒ Array
List of configurable keys for Azure::Client
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/azure/configurable.rb', line 90 def keys @keys ||= [ :storage_access_key, :storage_account_name, :sb_access_key, :sb_sas_key, :sb_sas_key_name, :ca_file, :sb_namespace, :management_certificate, :subscription_id, :sql_database_management_endpoint, :sb_issuer, :storage_table_host, :storage_blob_host, :storage_queue_host, :management_endpoint ] end |
Instance Method Details
#config ⇒ Object
259 260 261 |
# File 'lib/azure/configurable.rb', line 259 def config self end |
#configure {|_self| ... } ⇒ Object
Set configuration options using a block
112 113 114 |
# File 'lib/azure/configurable.rb', line 112 def configure yield self end |
#reset!(options = {}) ⇒ Object Also known as: setup
Reset configuration options to default values
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/azure/configurable.rb', line 117 def reset!( = {}) Azure::Configurable.keys.each do |key| value = if self == Azure Azure::Default.[key] else Azure.send(key) end if key == :management_certificate @certificate_key = nil @private_key = nil send(:"#{key.to_s + '='}", value) else instance_variable_set(:"@#{key}", .fetch(key, value)) end end self.send(:reset_agents!) if self.respond_to?(:reset_agents!) self end |