openstudio-analysis 1.3.4 → 1.3.5
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/CHANGELOG.md +4 -0
- data/lib/openstudio/analysis/server_api.rb +30 -14
- data/lib/openstudio/analysis/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2b3fab59aeec813435361079d2ce2453b30c3a21d4c3d13addfede64fc944bb
|
4
|
+
data.tar.gz: 20c2f50da2c0f0e34076ad11680e584fd35f79bb688d5224b4fa5783173df77e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d34d8ea49de5a7f248643209d6c8d1942996dfedc91a57801faf2f664d0a04b06930d58f2bfbc3d2034a22f5bb637f06a759e0dd67524dd060c7c8d95fb93ba
|
7
|
+
data.tar.gz: 9a334296581594e233cca22f651da024be123696dab49d592d2a38bc29857585bed08ce1f8afa8c3bfc5f517632d5918bb0b9c5f02e70970473c5f525748bb5f
|
data/CHANGELOG.md
CHANGED
@@ -31,6 +31,9 @@ module OpenStudio
|
|
31
31
|
# create connection with basic capabilities
|
32
32
|
@conn = Faraday.new(url: @hostname) do |faraday|
|
33
33
|
faraday.request :url_encoded # form-encode POST params
|
34
|
+
faraday.options.timeout = 300
|
35
|
+
faraday.options.open_timeout = 300
|
36
|
+
faraday.options.write_timeout = 1800
|
34
37
|
faraday.use Faraday::Response::Logger, @logger
|
35
38
|
# faraday.response @logger # log requests to STDOUT
|
36
39
|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
@@ -40,6 +43,9 @@ module OpenStudio
|
|
40
43
|
@conn_multipart = Faraday.new(url: @hostname) do |faraday|
|
41
44
|
faraday.request :multipart
|
42
45
|
faraday.request :url_encoded # form-encode POST params
|
46
|
+
faraday.options.timeout = 300
|
47
|
+
faraday.options.open_timeout = 300
|
48
|
+
faraday.options.write_timeout = 1800
|
43
49
|
faraday.use Faraday::Response::Logger, @logger
|
44
50
|
# faraday.response :logger # log requests to STDOUT
|
45
51
|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
@@ -97,13 +103,17 @@ module OpenStudio
|
|
97
103
|
|
98
104
|
# TODO: make this a display name and a machine name
|
99
105
|
project_hash = { project: { name: (options[:project_name]).to_s } }
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
106
|
+
begin
|
107
|
+
response = @conn.post do |req|
|
108
|
+
req.url '/projects.json'
|
109
|
+
req.headers['Content-Type'] = 'application/json'
|
110
|
+
req.body = project_hash.to_json
|
111
|
+
end
|
112
|
+
puts "response.status: #{response.status}"
|
113
|
+
puts response.inspect
|
114
|
+
rescue Net::OpenTimeout => e
|
115
|
+
puts "new_project OpenTimeout: #{e.message}"
|
105
116
|
end
|
106
|
-
|
107
117
|
if response.status == 201
|
108
118
|
project_id = JSON.parse(response.body)['_id']
|
109
119
|
|
@@ -204,16 +214,19 @@ module OpenStudio
|
|
204
214
|
begin
|
205
215
|
resp = @conn.get do |req|
|
206
216
|
req.url 'status.json'
|
207
|
-
req.options.timeout =
|
208
|
-
req.options.open_timeout =
|
217
|
+
req.options.timeout = 300
|
218
|
+
req.options.open_timeout = 300
|
209
219
|
end
|
210
|
-
|
220
|
+
puts "machine_status resp.status: #{resp.status}"
|
221
|
+
puts resp.inspect
|
211
222
|
if resp.status == 200
|
212
223
|
j = JSON.parse resp.body, symbolize_names: true
|
213
224
|
status = j if j
|
214
225
|
end
|
215
|
-
rescue Faraday::ConnectionFailed
|
216
|
-
|
226
|
+
rescue Faraday::ConnectionFailed => e
|
227
|
+
puts "machine_Status ConnectionFailed: #{e.message}"
|
228
|
+
rescue Net::ReadTimeout => e
|
229
|
+
puts "machine_Status ReadTimeout: #{e.message}"
|
217
230
|
end
|
218
231
|
|
219
232
|
status
|
@@ -466,7 +479,8 @@ module OpenStudio
|
|
466
479
|
req.url "projects/#{project_id}/analyses.json"
|
467
480
|
req.headers['Content-Type'] = 'application/json'
|
468
481
|
req.body = formulation_json.to_json
|
469
|
-
req.options
|
482
|
+
req.options.timeout = 600 # seconds
|
483
|
+
req.options.write_timeout = 1800
|
470
484
|
end
|
471
485
|
|
472
486
|
if response.status == 201
|
@@ -486,7 +500,8 @@ module OpenStudio
|
|
486
500
|
|
487
501
|
payload = { file: Faraday::UploadIO.new(options[:upload_file], 'application/zip') }
|
488
502
|
response = @conn_multipart.post "analyses/#{analysis_id}/upload.json", payload do |req|
|
489
|
-
req.options
|
503
|
+
req.options.timeout = 1800 # seconds
|
504
|
+
req.options.write_timeout = 1800
|
490
505
|
end
|
491
506
|
|
492
507
|
if response.status == 201
|
@@ -632,7 +647,8 @@ module OpenStudio
|
|
632
647
|
req.url "analyses/#{analysis_id}/action.json"
|
633
648
|
req.headers['Content-Type'] = 'application/json'
|
634
649
|
req.body = options.to_json
|
635
|
-
req.options
|
650
|
+
req.options.timeout = 1800 # seconds
|
651
|
+
req.options.write_timeout = 1800
|
636
652
|
end
|
637
653
|
|
638
654
|
if response.status == 200
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstudio-analysis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Long
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcl
|
@@ -202,7 +202,7 @@ homepage: http://openstudio.nrel.gov
|
|
202
202
|
licenses:
|
203
203
|
- BSD
|
204
204
|
metadata: {}
|
205
|
-
post_install_message:
|
205
|
+
post_install_message:
|
206
206
|
rdoc_options: []
|
207
207
|
require_paths:
|
208
208
|
- lib
|
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
218
|
version: '0'
|
219
219
|
requirements: []
|
220
220
|
rubygems_version: 3.1.4
|
221
|
-
signing_key:
|
221
|
+
signing_key:
|
222
222
|
specification_version: 4
|
223
223
|
summary: Create JSON, ZIP to communicate with OpenStudio Distributed Analysis in the
|
224
224
|
Cloud
|