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 +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_azurestorage_gen2.rb +6 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f30aa7c60fa869b86eb0d921aab12831c6355b6
|
4
|
+
data.tar.gz: 522010167e94cb9500e89b13aa68c4ec0bba1053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d40bc5c3964bd9187e6710dbda66f7e3556f310425120cf2c46da19a34c8905676278f4428d744a3255ce83e55bf8bdd2791dae755b25aefcf32d39e771c8b6
|
7
|
+
data.tar.gz: 149ee0c0ffc588e048fd0fa87cc343af153d6dc6de4132e9ace1d06f13b80e9d4f6ca60dba1892972693e6dfb37fc0dc649e233e538ccdcf982bbbc6540d1d1f
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
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" => "
|
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-
|
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, :
|
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.
|
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-
|
11
|
+
date: 2020-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|