Method: Azure::Storage::Table::TableService#initialize
- Defined in:
- lib/azure/storage/table/table_service.rb
#initialize(options = {}, &block) ⇒ TableService
Public: Initializes an instance of [Azure::Storage::Table::TableService]
Attributes
-
options- Hash. Optional parameters.
Options
Accepted key/value pairs in options parameter are:
-
:use_development_storage- TrueClass|FalseClass. Whether to use storage emulator. -
:development_storage_proxy_uri- String. Used with:use_development_storageif emulator is hosted other than localhost. -
:storage_connection_string- String. The storage connection string. -
:storage_account_name- String. The name of the storage account. -
:storage_access_key- Base64 String. The access key of the storage account. -
:storage_sas_token- String. The signed access signature for the storage account or one of its service. -
:storage_table_host- String. Specified Table serivce endpoint or hostname -
:storage_dns_suffix- String. The suffix of a regional Storage Serivce, to -
:default_endpoints_protocol- String. http or https -
:use_path_style_uri- String. Whether use path style URI for specified endpoints -
:ca_file- String. File path of the CA file if having issue with SSL -
:user_agent_prefix- String. The user agent prefix that can identify the application calls the library -
:client- Azure::Storage::Common::Client. The common client used to initalize the service.
The valid set of options include:
-
Storage Emulator:
:use_development_storagerequired,:development_storage_proxy_urioptionally -
Storage account name and key:
:storage_account_nameand:storage_access_keyrequired, set:storage_dns_suffixnecessarily -
Storage account name and SAS token:
:storage_account_nameand:storage_sas_tokenrequired, set:storage_dns_suffixnecessarily -
Specified hosts and SAS token: At least one of the service host and SAS token. It’s up to user to ensure the SAS token is suitable for the serivce
-
Azure::Storage::Common::Client: The common client used to initalize the service. This client can be initalized and used repeatedly.
-
Anonymous Table: only
:storage_table_host, if it is to only access tables within a container
Additional notes:
-
Specified hosts can be set when use account name with access key or sas token
-
:default_endpoints_protocolcan be set if the scheme is not specified in hosts -
Storage emulator always use path style URI
-
:ca_fileis independent.
When empty options are given, it will try to read settings from Environment Variables. Refer to [Azure::Storage::Common::ClientOptions.env_vars_mapping] for the mapping relationship
154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/azure/storage/table/table_service.rb', line 154 def initialize( = {}, &block) = .clone client_config = [:client] ||= Azure::Storage::Common::Client::create(, &block) @user_agent_prefix = [:user_agent_prefix] if [:user_agent_prefix] @api_version = [:api_version] || Azure::Storage::Table::Default::STG_VERSION signer = [:signer] || client_config.signer || Auth::SharedKey.new(client_config.storage_account_name, client_config.storage_access_key) signer.api_ver = @api_version if signer.is_a? Azure::Storage::Common::Core::Auth::SharedAccessSignatureSigner super(signer, client_config.storage_account_name, , &block) @storage_service_host[:primary] = client.storage_table_host @storage_service_host[:secondary] = client.storage_table_host true end |