zuora_api 1.4.03 → 1.4.04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/insights_api/login.rb +4 -3
- data/lib/zuora_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af98f69ca6684441b7f56352718e38f0640652e8
|
|
4
|
+
data.tar.gz: 97245482d8621732fe096eaac8fcd58f0d88e5fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ac16c28f8c24b5da97c5e71a738bf51da72ff3cb8267b7f0d0654101f4abc6433d8dd016583e7d2dcb218c4f2829f44371fb77623bcf8c147093d8c5c2c771d
|
|
7
|
+
data.tar.gz: 72977137e6a136ee79412a1d1626f210a6953e6daefe50d047c892cbb0755cb19047625b11f48e75c871d3afe66d3a8122a135b7b1c3013f232eaa7a930dcd76
|
data/lib/insights_api/login.rb
CHANGED
|
@@ -107,11 +107,12 @@ module InsightsAPI
|
|
|
107
107
|
|
|
108
108
|
def upload_into_insights(dataSourceName, recordType, batchDate, filePath)
|
|
109
109
|
begin
|
|
110
|
+
temp_date = dateFormat(date: batchDate)
|
|
110
111
|
response = HTTParty.post(
|
|
111
112
|
"https://#{@url}/files/upload",
|
|
112
113
|
:basic_auth => { :username => @api_token }, :body => {
|
|
113
114
|
:dataSource => dataSourceName, :recordType => recordType,
|
|
114
|
-
:batchDate =>
|
|
115
|
+
:batchDate => temp_date})
|
|
115
116
|
parsed = JSON.parse(response.body)
|
|
116
117
|
signedUrl = parsed['signedUrl']
|
|
117
118
|
if !File.extname(filePath) == ".gz"
|
|
@@ -124,9 +125,9 @@ module InsightsAPI
|
|
|
124
125
|
post = HTTParty.put(signedUrl,
|
|
125
126
|
:body => gzippedFile.read)
|
|
126
127
|
if post.code == 200
|
|
127
|
-
return {"status"=>"COMPLETE", "signedUrl"=>"signedUrl", "response" => post.code}
|
|
128
|
+
return {"status"=>"COMPLETE", "signedUrl"=>"#{signedUrl}", "response" => post.code, "batchDate" => "#{temp_date}"}
|
|
128
129
|
else
|
|
129
|
-
return {"status"=>"Error", "signedUrl"=>"signedUrl", "response" => post.code}
|
|
130
|
+
return {"status"=>"Error", "signedUrl"=>"#{signedUrl}", "response" => post.code, "message"=> "#{post.message}", "batchDate" => "#{temp_date}"}
|
|
130
131
|
end
|
|
131
132
|
rescue Exception => e
|
|
132
133
|
Rails.logger.debug "[ZuoraGem]: While uploading to insights Error: #{e}"
|
data/lib/zuora_api/version.rb
CHANGED