Module: Azure::Configurable

Included in:
Azure, Client
Defined in:
lib/azure/configurable.rb

Overview

The Azure::Configurable module provides basic configuration for Azure activities.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#acs_hostString (readonly)

Get the host for the ACS service.

Returns:

  • (String)

241
242
243
# File 'lib/azure/configurable.rb', line 241

def acs_host
  @acs_host
end

#ca_fileString

Returns Location of the Certificate Authority bundle to be used for HTTPS.

Returns:

  • (String)

    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_keyObject

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_keyObject

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_certificateString|File

Returns Azure Service Management certificate (pfx or pem).

Returns:

  • (String|File)

    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_endpointString

Returns Azure Service Management Endpoint. default: management.core.windows.net.

Returns:


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_keyString

Returns Azure Service Bus access key.

Returns:

  • (String)

    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_issuerString

Returns Azure Service Bus issuer.

Returns:

  • (String)

    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_namespaceString

Returns Azure Service Bus namespace.

Returns:

  • (String)

    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_keyString

Returns Azure Service Bus Shared Access Signature key.

Returns:

  • (String)

    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_nameString

Returns Azure Service Bus Shared Access Signature key name.

Returns:

  • (String)

    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_hostString (readonly)

Get the host for Service Bus based on the Service Bus Namespace.

Returns:

  • (String)

251
252
253
# File 'lib/azure/configurable.rb', line 251

def service_bus_host
  @service_bus_host
end

#sql_database_management_endpointString

Returns Azure SQL database management endpoint. default: management.core.windows.net:8443/.

Returns:


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_keyObject

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_nameString

Returns Azure Storage account name.

Returns:

  • (String)

    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_hostString

Storage blob host

Returns:

  • (String)

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_hostString

Storage queue host

Returns:

  • (String)

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_hostString

Storage table host

Returns:

  • (String)

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_idString

Returns Azure Subscription ID.

Returns:

  • (String)

    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

.keysArray

List of configurable keys for Azure::Client

Returns:

  • (Array)

    of option keys


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

#configObject


259
260
261
# File 'lib/azure/configurable.rb', line 259

def config
  self
end

#configure {|_self| ... } ⇒ Object

Set configuration options using a block

Yields:

  • (_self)

Yield Parameters:


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!(options = {})
  Azure::Configurable.keys.each do |key|
    value = if self == Azure
              Azure::Default.options[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}", options.fetch(key, value))
    end
  end
  self.send(:reset_agents!) if self.respond_to?(:reset_agents!)
  self
end