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
-
#ca_file ⇒ Object
Public: Get/Set path of a CA certification directory containing certifications in PEM format.
-
#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
#ca_file ⇒ Object
Public: Get/Set path of a CA certification directory containing certifications in PEM format.
For example:
config.ca_file = 'ca_cert.pem'
74 75 76 |
# File 'lib/azure/core/configuration.rb', line 74 def ca_file @ca_file end |
#http_certificate_key ⇒ Object
Public: Set the certificate key for SSL/HTTPS request with PEM certificate
175 176 177 |
# File 'lib/azure/core/configuration.rb', line 175 def http_certificate_key @http_certificate_key end |
#http_private_key ⇒ Object
Public: Set the private key for SSL/HTTPS request with PEM certificate
172 173 174 |
# File 'lib/azure/core/configuration.rb', line 172 def http_private_key @http_private_key end |
#management_certificate ⇒ Object
Public: Get the Subscription Id and certificate key for the management API.
163 164 165 |
# File 'lib/azure/core/configuration.rb', line 163 def management_certificate @management_certificate end |
#management_endpoint ⇒ Object
180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/azure/core/configuration.rb', line 180 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”
78 79 80 |
# File 'lib/azure/core/configuration.rb', line 78 def sb_issuer @sb_issuer || "owner" end |
#sb_namespace ⇒ Object
Public: Get/Set the Service Bus Namespace for this service.
83 84 85 |
# File 'lib/azure/core/configuration.rb', line 83 def sb_namespace @sb_namespace end |
#sql_database_authentication_mode ⇒ Object
Public: Set this to enable Management certificate authentication or SQL Server authentication
205 206 207 |
# File 'lib/azure/core/configuration.rb', line 205 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)
178 179 180 |
# File 'lib/azure/core/configuration.rb', line 178 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.
117 118 119 |
# File 'lib/azure/core/configuration.rb', line 117 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.
135 136 137 |
# File 'lib/azure/core/configuration.rb', line 135 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.
99 100 101 |
# File 'lib/azure/core/configuration.rb', line 99 def storage_table_host @storage_table_host || default_host(:table) end |
#subscription_id ⇒ Object
Public: Get/Set the Subscription Id for the management API.
166 167 168 |
# File 'lib/azure/core/configuration.rb', line 166 def subscription_id @subscription_id end |
Instance Method Details
#acs_host ⇒ Object
Public: Get the host for the ACS service.
140 141 142 |
# File 'lib/azure/core/configuration.rb', line 140 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.
154 155 156 |
# File 'lib/azure/core/configuration.rb', line 154 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.
145 146 147 |
# File 'lib/azure/core/configuration.rb', line 145 def service_bus_host "https://#{sb_namespace}.servicebus.windows.net" end |