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

#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

#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

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