Class: Azure::Core::Configuration
- Inherits:
-
Object
- Object
- Azure::Core::Configuration
- Includes:
- Singleton
- Defined in:
- lib/azure/core/configuration.rb
Overview
Singleton that keeps the configuration of the system.
Instance Attribute Summary collapse
-
#http_certificate_key ⇒ Object
Public: Set the certificate key for SSL/HTTPS request with PEM certificate.
-
#http_private_key ⇒ Object
Public: Set the private key for SSL/HTTPS request with PEM certificate.
-
#management_certificate ⇒ Object
Public: Get the Subscription Id and certificate key for the management API.
- #management_endpoint ⇒ Object
-
#sb_access_key ⇒ Object
Public: Get/Set the Service Bus Access Key (Issuer Secret) for this service.
-
#sb_issuer ⇒ Object
Public: Get the issuer for the service bus.
-
#sb_namespace ⇒ Object
Public: Get/Set the Service Bus Namespace for this service.
-
#sql_database_authentication_mode ⇒ Object
Public: Set this to enable Management certificate authentication or SQL Server authentication.
-
#sql_database_management_endpoint ⇒ Object
Public: Set the host for SQL Management API (SQL Server authentication Endpoint).
-
#storage_access_key ⇒ Object
Public: Get/Set the Access Key for this service.
-
#storage_account_name ⇒ Object
Public: Get/Set the Account Name for this service.
-
#storage_blob_host ⇒ Object
Public: Get the host for this service.
-
#storage_queue_host ⇒ Object
Public: Get the host for this service.
-
#storage_table_host ⇒ Object
Public: Get the host for this service.
-
#subscription_id ⇒ Object
Public: Get/Set the Subscription Id for the management API.
Instance Method Summary collapse
-
#acs_host ⇒ Object
Public: Get the host for the ACS service.
-
#default_host(service) ⇒ Object
Calculate the default host for a given service in the cloud.
-
#service_bus_host ⇒ Object
Public: Get the host for the Service Bus service.
Instance Attribute Details
#http_certificate_key ⇒ Object
Public: Set the certificate key for SSL/HTTPS request with PEM certificate
168 169 170 |
# File 'lib/azure/core/configuration.rb', line 168 def http_certificate_key @http_certificate_key end |
#http_private_key ⇒ Object
Public: Set the private key for SSL/HTTPS request with PEM certificate
165 166 167 |
# File 'lib/azure/core/configuration.rb', line 165 def http_private_key @http_private_key end |
#management_certificate ⇒ Object
Public: Get the Subscription Id and certificate key for the management API.
156 157 158 |
# File 'lib/azure/core/configuration.rb', line 156 def management_certificate @management_certificate end |
#management_endpoint ⇒ Object
173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/azure/core/configuration.rb', line 173 def management_endpoint if @management_endpoint.nil? or @management_endpoint.empty? "https://management.core.windows.net/" elsif !@management_endpoint.end_with?('/') @management_endpoint += '/' elsif URI(@management_endpoint).scheme.nil? "https://#{@management_endpoint}" else @management_endpoint end end |
#sb_access_key ⇒ Object
Public: Get/Set the Service Bus Access Key (Issuer Secret) for this service.
64 65 66 |
# File 'lib/azure/core/configuration.rb', line 64 def sb_access_key @sb_access_key end |
#sb_issuer ⇒ Object
Public: Get the issuer for the service bus. If you set something using #sb_issuer=, then we use that. Otherwise, we default to the default issuer: “owner”
71 72 73 |
# File 'lib/azure/core/configuration.rb', line 71 def sb_issuer @sb_issuer || "owner" end |
#sb_namespace ⇒ Object
Public: Get/Set the Service Bus Namespace for this service.
76 77 78 |
# File 'lib/azure/core/configuration.rb', line 76 def sb_namespace @sb_namespace end |
#sql_database_authentication_mode ⇒ Object
Public: Set this to enable Management certificate authentication or SQL Server authentication
198 199 200 |
# File 'lib/azure/core/configuration.rb', line 198 def sql_database_authentication_mode @sql_database_authentication_mode end |
#sql_database_management_endpoint ⇒ Object
Public: Set the host for SQL Management API (SQL Server authentication Endpoint)
171 172 173 |
# File 'lib/azure/core/configuration.rb', line 171 def sql_database_management_endpoint @sql_database_management_endpoint end |
#storage_access_key ⇒ Object
Public: Get/Set the Access Key for this service.
58 59 60 |
# File 'lib/azure/core/configuration.rb', line 58 def storage_access_key @storage_access_key end |
#storage_account_name ⇒ Object
Public: Get/Set the Account Name for this service.
61 62 63 |
# File 'lib/azure/core/configuration.rb', line 61 def storage_account_name @storage_account_name end |
#storage_blob_host ⇒ Object
Public: Get the host for this service. If you set something using #storage_blob_host=, then we use that. Else we default to Azure’s default hosts, based on your account name.
110 111 112 |
# File 'lib/azure/core/configuration.rb', line 110 def storage_blob_host @storage_blob_host || default_host(:blob) end |
#storage_queue_host ⇒ Object
Public: Get the host for this service. If you set something using #storage_queue_host=, then we use that. Else we default to Azure’s default hosts, based on your account name.
128 129 130 |
# File 'lib/azure/core/configuration.rb', line 128 def storage_queue_host @storage_queue_host || default_host(:queue) end |
#storage_table_host ⇒ Object
Public: Get the host for this service. If you set something using #storage_table_host=, then we use that. Else we default to Azure’s default hosts, based on your account name.
92 93 94 |
# File 'lib/azure/core/configuration.rb', line 92 def storage_table_host @storage_table_host || default_host(:table) end |
#subscription_id ⇒ Object
Public: Get/Set the Subscription Id for the management API.
159 160 161 |
# File 'lib/azure/core/configuration.rb', line 159 def subscription_id @subscription_id end |
Instance Method Details
#acs_host ⇒ Object
Public: Get the host for the ACS service.
133 134 135 |
# File 'lib/azure/core/configuration.rb', line 133 def acs_host "https://#{sb_namespace}-sb.accesscontrol.windows.net" end |
#default_host(service) ⇒ Object
Calculate the default host for a given service in the cloud.
service - One of :table, :blob, :queue, etc.
Returns a String with the hostname, including your account name.
147 148 149 |
# File 'lib/azure/core/configuration.rb', line 147 def default_host(service) "http://#{storage_account_name}.#{service}.core.windows.net" end |
#service_bus_host ⇒ Object
Public: Get the host for the Service Bus service.
138 139 140 |
# File 'lib/azure/core/configuration.rb', line 138 def service_bus_host "https://#{sb_namespace}.servicebus.windows.net" end |