Class: LogStash::Outputs::Application_insights::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/application_insights/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(storage_account_name, force = nil) ⇒ Client

Returns a new instance of Client.



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/logstash/outputs/application_insights/client.rb', line 27

def initialize ( , force = nil )
   = 
   = Clients.instance.( , force )

  @tuple = [:clients_Q].pop
  ( , @current_azure_storage_auth_sas, @current_azure_storage_client) = @tuple
  if  != [:valid_index]
     = [:valid_index]
    
    @tuple = [ , @current_azure_storage_auth_sas, @current_azure_storage_client ]
  end 
   = 
end

Instance Method Details

#blobClientObject



56
57
58
59
60
61
62
# File 'lib/logstash/outputs/application_insights/client.rb', line 56

def blobClient
  raise UnexpectedBranchError, "client already disposed" unless @tuple
  @last_client_type = :blobClient
  # breaking change after azure-storage 0.10.1 

  # @current_azure_storage_client.blobClient

  @current_azure_storage_client.blob_client
end

#dispose(io_failed_reason = nil) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/logstash/outputs/application_insights/client.rb', line 41

def dispose ( io_failed_reason = nil )
  if @tuple 
    if   == 
      [:clients_Q] << @tuple
    else
      [:valid_index] = 
      [:clients_Q] << [ , @current_azure_storage_auth_sas, @current_azure_storage_client ]
    end
    @tuple = nil

    Clients.instance.( , io_failed_reason ) if io_failed_reason && :blobClient == @last_client_type
  end
  nil
end

#notifyClientObject



72
73
74
75
76
# File 'lib/logstash/outputs/application_insights/client.rb', line 72

def notifyClient
  raise UnexpectedBranchError, "client already disposed" unless @tuple
  @last_client_type = :notifyClient
  @current_azure_storage_client
end

#storage_auth_sasObject



78
79
80
81
# File 'lib/logstash/outputs/application_insights/client.rb', line 78

def storage_auth_sas
  raise UnexpectedBranchError, "client already disposed" unless @tuple
  @current_azure_storage_auth_sas
end

#switch_storage_account_key!Object



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/logstash/outputs/application_insights/client.rb', line 84

def 
  raise UnexpectedBranchError, "client already disposed" unless @tuple
   = (  + 1 ) % [:keys].length
  if  == 
    
    false
  else
    
    true
  end
end

#tableClientObject



64
65
66
67
68
69
70
# File 'lib/logstash/outputs/application_insights/client.rb', line 64

def tableClient
  raise UnexpectedBranchError, "client already disposed" unless @tuple
  @last_client_type = :blobClient
  # breaking change after azure-storage 0.10.1 

  # @current_azure_storage_client.tableClient

  @current_azure_storage_client.table_client
end