Class: Azure::Core::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/azure/core/configuration.rb

Overview

Singleton that keeps the configuration of the system.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#http_certificate_keyObject

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_keyObject

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_certificateObject

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_endpointObject



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_keyObject

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_issuerObject

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_namespaceObject

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_modeObject

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_endpointObject

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_keyObject

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_nameObject

Public: Get/Set the Account Name for this service.



61
62
63
# File 'lib/azure/core/configuration.rb', line 61

def 
  @storage_account_name
end

#storage_blob_hostObject

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_hostObject

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_hostObject

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_idObject

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_hostObject

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://#{}.#{service}.core.windows.net"
end

#service_bus_hostObject

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