fluent-plugin-azurestorage-gen2 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1f459cce5a616b607bcd07b2a0e60acb2b7f0e2
4
- data.tar.gz: 6c162b6991996a2fb61f7f3f8af87a3e74454b6f
3
+ metadata.gz: 2f30aa7c60fa869b86eb0d921aab12831c6355b6
4
+ data.tar.gz: 522010167e94cb9500e89b13aa68c4ec0bba1053
5
5
  SHA512:
6
- metadata.gz: 75e25084709b908aa16411d04262e828c52bbe367cc11d250ab8c9b7575cf819134b69aa0dc15c6c9ba8d902212c40bb79336ce9661378d4fc2968d87020f112
7
- data.tar.gz: 460b141c22880446e7a6a15990f5c7d753646c372aefb41a7b13ecb6fb270fe9fe44528cb985c54fde282adba39179ca42a86bbd6713b530d66703c6ba3e425f
6
+ metadata.gz: 5d40bc5c3964bd9187e6710dbda66f7e3556f310425120cf2c46da19a34c8905676278f4428d744a3255ce83e55bf8bdd2791dae755b25aefcf32d39e771c8b6
7
+ data.tar.gz: 149ee0c0ffc588e048fd0fa87cc343af153d6dc6de4132e9ace1d06f13b80e9d4f6ca60dba1892972693e6dfb37fc0dc649e233e538ccdcf982bbbc6540d1d1f
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  | fluent-plugin-azurestorage-gen2 | fluentd | ruby |
11
11
  |------------------------|---------|------|
12
- | >= 0.1.5 | >= v0.14.0 | >= 2.4 |
12
+ | >= 0.1.6 | >= v0.14.0 | >= 2.4 |
13
13
 
14
14
  ## Overview
15
15
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -89,11 +89,6 @@ module Fluent::Plugin
89
89
  @azure_storage_path = ''
90
90
  @last_azure_storage_path = ''
91
91
  @current_index = 0
92
- if @store_as.nil? || @store_as == "none" || @store_as == "text"
93
- @blob_content_type = "text/plain"
94
- else
95
- @blob_content_type = "application/octet-stream"
96
- end
97
92
 
98
93
  if @store_as.nil? || @store_as == "none"
99
94
  @final_file_extension = @file_extension
@@ -239,7 +234,7 @@ module Fluent::Plugin
239
234
  if response.success?
240
235
  data = JSON.parse(response.body)
241
236
  log.debug "azurestorage_gen2: Token response: #{data}"
242
- @azure_access_token = data["access_token"]
237
+ @azure_access_token = data["access_token"].chomp
243
238
  else
244
239
  raise Fluent::UnrecoverableError, "Failed to acquire access token. #{response.code}: #{response.body}"
245
240
  end
@@ -257,7 +252,7 @@ module Fluent::Plugin
257
252
  if response.success?
258
253
  data = JSON.parse(response.body)
259
254
  log.debug "azurestorage_gen2: Token response: #{data}"
260
- @azure_access_token = data["access_token"]
255
+ @azure_access_token = data["access_token"].chomp
261
256
  else
262
257
  raise Fluent::UnrecoverableError, "Failed to acquire access token. #{response.code}: #{response.body}"
263
258
  end
@@ -269,7 +264,7 @@ module Fluent::Plugin
269
264
  def acquire_access_token_by_az
270
265
  access_token=`az account get-access-token --resource https://storage.azure.com/ --query accessToken -o tsv`
271
266
  log.debug "azurestorage_gen2: Token response: #{access_token}"
272
- @azure_access_token = access_token
267
+ @azure_access_token = access_token.chomp
273
268
  end
274
269
 
275
270
  private
@@ -322,7 +317,7 @@ module Fluent::Plugin
322
317
  private
323
318
  def create_blob(blob_path)
324
319
  datestamp = create_request_date
325
- headers = {:"x-ms-version" => ABFS_API_VERSION, :"x-ms-date" => datestamp,:"Content-Length" => "0", :"Content-Type" => "#{@blob_content_type}"}
320
+ headers = {:"x-ms-version" => ABFS_API_VERSION, :"x-ms-date" => datestamp,:"Content-Length" => "0", :"Content-Type" => "text/plain"}
326
321
  params = {:resource => "file", :recursive => "false"}
327
322
  auth_header = create_auth_header("put", datestamp, "#{@azure_container}#{blob_path}", headers, params)
328
323
  headers[:Authorization] = auth_header
@@ -345,11 +340,11 @@ module Fluent::Plugin
345
340
  def append_blob_block(blob_path, content, position)
346
341
  log.debug "azurestorage_gen2: append_blob_block.start: Append blob ('#{blob_path}') called with position #{position}"
347
342
  datestamp = create_request_date
348
- headers = {:"x-ms-version" => ABFS_API_VERSION, :"x-ms-date" => datestamp, :"Content-Type" => "#{@blob_content_type}", :"Content-Length" => content.length}
343
+ headers = {:"x-ms-version" => ABFS_API_VERSION, :"x-ms-date" => datestamp, :"Content-Length" => content.length}
349
344
  params = {:action => "append", :position => "#{position}"}
350
345
  auth_header = create_auth_header("patch", datestamp, "#{@azure_container}#{blob_path}", headers, params)
351
346
  headers[:Authorization] = auth_header
352
- request = Typhoeus::Request.new("https://#{azure_storage_account}#{URL_DOMAIN_SUFFIX}/#{@azure_container}#{blob_path}", :method => :patch, :body => content, :params => params, :headers=> headers)
347
+ request = Typhoeus::Request.new("https://#{azure_storage_account}#{URL_DOMAIN_SUFFIX}/#{@azure_container}#{blob_path}", :method => :patch, :headers=> headers, :params => params, :body => content)
353
348
  request.on_complete do |response|
354
349
  if response.success?
355
350
  log.debug "azurestorage_gen2: Blob '#{blob_path}' has been appended, response code: #{response.code}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azurestorage-gen2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Szabo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-02 00:00:00.000000000 Z
11
+ date: 2020-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd