batchly_api 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +44 -0
- data/lib/batchly_api.rb +21 -11
- data/lib/batchly_api/api_exception.rb +5 -11
- data/lib/batchly_api/api_helper.rb +1 -1
- data/lib/batchly_api/configuration.rb +1 -1
- data/lib/batchly_api/controllers/{account_controller.rb → accounts_controller.rb} +38 -37
- data/lib/batchly_api/controllers/{data_source_controller.rb → data_sources_controller.rb} +5 -5
- data/lib/batchly_api/controllers/{job_controller.rb → jobs_controller.rb} +62 -14
- data/lib/batchly_api/controllers/processors_controller.rb +225 -0
- data/lib/batchly_api/controllers/{project_controller.rb → projects_controller.rb} +46 -46
- data/lib/batchly_api/controllers/{run_controller.rb → runs_controller.rb} +23 -59
- data/lib/batchly_api/models/add_aws_account_request.rb +1 -1
- data/lib/batchly_api/models/add_parameter_group_request.rb +34 -0
- data/lib/batchly_api/models/add_processor_request.rb +74 -0
- data/lib/batchly_api/models/add_s_3_data_source_request.rb +1 -1
- data/lib/batchly_api/models/base_string_enum.rb +25 -0
- data/lib/batchly_api/models/create_job_request.rb +6 -11
- data/lib/batchly_api/models/create_project_request.rb +1 -1
- data/lib/batchly_api/models/custom_image.rb +39 -0
- data/lib/batchly_api/models/execute_job_request.rb +8 -8
- data/lib/batchly_api/models/key_value_pair_string_string.rb +34 -0
- data/lib/batchly_api/models/language_enum.rb +30 -0
- data/lib/batchly_api/models/operating_system_enum.rb +24 -0
- data/lib/batchly_api/models/parameter.rb +29 -0
- data/lib/batchly_api/models/request_type_enum.rb +24 -0
- data/lib/batchly_api/models/response_type_enum.rb +21 -0
- data/lib/batchly_api/models/update_project_request.rb +1 -1
- data/lib/batchly_api/models/vpc_details.rb +1 -1
- metadata +22 -12
- data/lib/batchly_api/models/job_schedule.rb +0 -36
@@ -0,0 +1,225 @@
|
|
1
|
+
# This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 12/05/2015
|
2
|
+
|
3
|
+
module BatchlyApi
|
4
|
+
class ProcessorsController
|
5
|
+
|
6
|
+
# TODO: type endpoint description here
|
7
|
+
# @return Array<ProcessorModel> response from the API call
|
8
|
+
def list_marketplace_processors
|
9
|
+
# the base uri for api requests
|
10
|
+
query_builder = Configuration.BASE_URI.dup
|
11
|
+
|
12
|
+
# prepare query string for API call
|
13
|
+
query_builder << "/api/Processors/Marketplace"
|
14
|
+
|
15
|
+
# validate and preprocess url
|
16
|
+
query_url = APIHelper.clean_url query_builder
|
17
|
+
|
18
|
+
# prepare headers
|
19
|
+
headers = {
|
20
|
+
"user-agent" => "batchly/1.0.1",
|
21
|
+
"accept" => "application/json"
|
22
|
+
}
|
23
|
+
|
24
|
+
# append custom auth authorization
|
25
|
+
CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
|
26
|
+
|
27
|
+
# invoke the API call request to fetch the response
|
28
|
+
response = Unirest.get query_url, headers:headers
|
29
|
+
|
30
|
+
#Error handling using HTTP status codes
|
31
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
32
|
+
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
33
|
+
end
|
34
|
+
|
35
|
+
response.body
|
36
|
+
end
|
37
|
+
|
38
|
+
# TODO: type endpoint description here
|
39
|
+
# @param [String] id Required parameter: TODO: type description here
|
40
|
+
# @return Array<ProcessorModel> response from the API call
|
41
|
+
def list_vault_processors id
|
42
|
+
# the base uri for api requests
|
43
|
+
query_builder = Configuration.BASE_URI.dup
|
44
|
+
|
45
|
+
# prepare query string for API call
|
46
|
+
query_builder << "/api/Processors/Vault/{id}"
|
47
|
+
|
48
|
+
# process optional query parameters
|
49
|
+
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
50
|
+
"id" => id,
|
51
|
+
}
|
52
|
+
|
53
|
+
# validate and preprocess url
|
54
|
+
query_url = APIHelper.clean_url query_builder
|
55
|
+
|
56
|
+
# prepare headers
|
57
|
+
headers = {
|
58
|
+
"user-agent" => "batchly/1.0.1",
|
59
|
+
"accept" => "application/json"
|
60
|
+
}
|
61
|
+
|
62
|
+
# append custom auth authorization
|
63
|
+
CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
|
64
|
+
|
65
|
+
# invoke the API call request to fetch the response
|
66
|
+
response = Unirest.get query_url, headers:headers
|
67
|
+
|
68
|
+
#Error handling using HTTP status codes
|
69
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
70
|
+
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
71
|
+
end
|
72
|
+
|
73
|
+
response.body
|
74
|
+
end
|
75
|
+
|
76
|
+
# TODO: type endpoint description here
|
77
|
+
# @param [String] id Required parameter: TODO: type description here
|
78
|
+
# @param [AddParameterGroupRequest] request Required parameter: TODO: type description here
|
79
|
+
# @return Array<DescribeParameterGroupResponse> response from the API call
|
80
|
+
def add_parameter_group id, request
|
81
|
+
# the base uri for api requests
|
82
|
+
query_builder = Configuration.BASE_URI.dup
|
83
|
+
|
84
|
+
# prepare query string for API call
|
85
|
+
query_builder << "/api/Processors/{id}/ParameterGroups"
|
86
|
+
|
87
|
+
# process optional query parameters
|
88
|
+
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
89
|
+
"id" => id,
|
90
|
+
}
|
91
|
+
|
92
|
+
# validate and preprocess url
|
93
|
+
query_url = APIHelper.clean_url query_builder
|
94
|
+
|
95
|
+
# prepare headers
|
96
|
+
headers = {
|
97
|
+
"user-agent" => "batchly/1.0.1",
|
98
|
+
"accept" => "application/json",
|
99
|
+
"content-type" => "application/json; charset=utf-8"
|
100
|
+
}
|
101
|
+
|
102
|
+
# append custom auth authorization
|
103
|
+
CustomAuthUtility.append_custom_auth_params query_url, "POST", headers
|
104
|
+
|
105
|
+
# invoke the API call request to fetch the response
|
106
|
+
response = Unirest.post query_url, headers:headers, parameters:request.to_json
|
107
|
+
|
108
|
+
#Error handling using HTTP status codes
|
109
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
110
|
+
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
111
|
+
end
|
112
|
+
|
113
|
+
response.body
|
114
|
+
end
|
115
|
+
|
116
|
+
# TODO: type endpoint description here
|
117
|
+
# @param [String] parameter_group_id Required parameter: TODO: type description here
|
118
|
+
# @param [String] processor_id Required parameter: TODO: type description here
|
119
|
+
# @return DescribeParameterGroupResponse response from the API call
|
120
|
+
def describe_parameter_group parameter_group_id, processor_id
|
121
|
+
# the base uri for api requests
|
122
|
+
query_builder = Configuration.BASE_URI.dup
|
123
|
+
|
124
|
+
# prepare query string for API call
|
125
|
+
query_builder << "/api/Processors/{processorId}/ParameterGroups/{parameterGroupId}"
|
126
|
+
|
127
|
+
# process optional query parameters
|
128
|
+
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
129
|
+
"parameterGroupId" => parameter_group_id,
|
130
|
+
"processorId" => processor_id,
|
131
|
+
}
|
132
|
+
|
133
|
+
# validate and preprocess url
|
134
|
+
query_url = APIHelper.clean_url query_builder
|
135
|
+
|
136
|
+
# prepare headers
|
137
|
+
headers = {
|
138
|
+
"user-agent" => "batchly/1.0.1",
|
139
|
+
"accept" => "application/json"
|
140
|
+
}
|
141
|
+
|
142
|
+
# append custom auth authorization
|
143
|
+
CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
|
144
|
+
|
145
|
+
# invoke the API call request to fetch the response
|
146
|
+
response = Unirest.get query_url, headers:headers
|
147
|
+
|
148
|
+
#Error handling using HTTP status codes
|
149
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
150
|
+
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
151
|
+
end
|
152
|
+
|
153
|
+
response.body
|
154
|
+
end
|
155
|
+
|
156
|
+
# TODO: type endpoint description here
|
157
|
+
# @param [AddProcessorRequest] request Required parameter: TODO: type description here
|
158
|
+
# @return Array<ProcessorModel> response from the API call
|
159
|
+
def add_processor_to_vault request
|
160
|
+
# the base uri for api requests
|
161
|
+
query_builder = Configuration.BASE_URI.dup
|
162
|
+
|
163
|
+
# prepare query string for API call
|
164
|
+
query_builder << "/api/Processors/Vault"
|
165
|
+
|
166
|
+
# validate and preprocess url
|
167
|
+
query_url = APIHelper.clean_url query_builder
|
168
|
+
|
169
|
+
# prepare headers
|
170
|
+
headers = {
|
171
|
+
"user-agent" => "batchly/1.0.1",
|
172
|
+
"accept" => "application/json",
|
173
|
+
"content-type" => "application/json; charset=utf-8"
|
174
|
+
}
|
175
|
+
|
176
|
+
# append custom auth authorization
|
177
|
+
CustomAuthUtility.append_custom_auth_params query_url, "POST", headers
|
178
|
+
|
179
|
+
# invoke the API call request to fetch the response
|
180
|
+
response = Unirest.post query_url, headers:headers, parameters:request.to_json
|
181
|
+
|
182
|
+
#Error handling using HTTP status codes
|
183
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
184
|
+
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
185
|
+
end
|
186
|
+
|
187
|
+
response.body
|
188
|
+
end
|
189
|
+
|
190
|
+
# TODO: type endpoint description here
|
191
|
+
# @param [AddProcessorRequest] request Required parameter: TODO: type description here
|
192
|
+
# @return Array<ProcessorModel> response from the API call
|
193
|
+
def add_processor_to_job request
|
194
|
+
# the base uri for api requests
|
195
|
+
query_builder = Configuration.BASE_URI.dup
|
196
|
+
|
197
|
+
# prepare query string for API call
|
198
|
+
query_builder << "/api/Processors"
|
199
|
+
|
200
|
+
# validate and preprocess url
|
201
|
+
query_url = APIHelper.clean_url query_builder
|
202
|
+
|
203
|
+
# prepare headers
|
204
|
+
headers = {
|
205
|
+
"user-agent" => "batchly/1.0.1",
|
206
|
+
"accept" => "application/json",
|
207
|
+
"content-type" => "application/json; charset=utf-8"
|
208
|
+
}
|
209
|
+
|
210
|
+
# append custom auth authorization
|
211
|
+
CustomAuthUtility.append_custom_auth_params query_url, "POST", headers
|
212
|
+
|
213
|
+
# invoke the API call request to fetch the response
|
214
|
+
response = Unirest.post query_url, headers:headers, parameters:request.to_json
|
215
|
+
|
216
|
+
#Error handling using HTTP status codes
|
217
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
218
|
+
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
219
|
+
end
|
220
|
+
|
221
|
+
response.body
|
222
|
+
end
|
223
|
+
|
224
|
+
end
|
225
|
+
end
|
@@ -1,9 +1,41 @@
|
|
1
|
-
# This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on
|
1
|
+
# This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 12/05/2015
|
2
2
|
|
3
3
|
module BatchlyApi
|
4
|
-
class
|
4
|
+
class ProjectsController
|
5
5
|
|
6
|
-
#
|
6
|
+
# Returns the active list of projects within batchly. The information includes the account information under which the project operates.
|
7
|
+
# @return Array<ProjectModel> response from the API call
|
8
|
+
def list_projects
|
9
|
+
# the base uri for api requests
|
10
|
+
query_builder = Configuration.BASE_URI.dup
|
11
|
+
|
12
|
+
# prepare query string for API call
|
13
|
+
query_builder << "/api/Projects"
|
14
|
+
|
15
|
+
# validate and preprocess url
|
16
|
+
query_url = APIHelper.clean_url query_builder
|
17
|
+
|
18
|
+
# prepare headers
|
19
|
+
headers = {
|
20
|
+
"user-agent" => "batchly/1.0.1",
|
21
|
+
"accept" => "application/json"
|
22
|
+
}
|
23
|
+
|
24
|
+
# append custom auth authorization
|
25
|
+
CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
|
26
|
+
|
27
|
+
# invoke the API call request to fetch the response
|
28
|
+
response = Unirest.get query_url, headers:headers
|
29
|
+
|
30
|
+
#Error handling using HTTP status codes
|
31
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
32
|
+
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
33
|
+
end
|
34
|
+
|
35
|
+
response.body
|
36
|
+
end
|
37
|
+
|
38
|
+
# Creates a new project from the request information. Account Identifier should be a valid value and can be obtained from the ListAccounts endpoint.
|
7
39
|
# @param [CreateProjectRequest] request Required parameter: Create Project Request
|
8
40
|
# @return ProjectModel response from the API call
|
9
41
|
def add_project request
|
@@ -11,14 +43,14 @@ module BatchlyApi
|
|
11
43
|
query_builder = Configuration.BASE_URI.dup
|
12
44
|
|
13
45
|
# prepare query string for API call
|
14
|
-
query_builder << "/api/
|
46
|
+
query_builder << "/api/Projects"
|
15
47
|
|
16
48
|
# validate and preprocess url
|
17
49
|
query_url = APIHelper.clean_url query_builder
|
18
50
|
|
19
51
|
# prepare headers
|
20
52
|
headers = {
|
21
|
-
"user-agent" => "batchly/0.
|
53
|
+
"user-agent" => "batchly/1.0.1",
|
22
54
|
"accept" => "application/json",
|
23
55
|
"content-type" => "application/json; charset=utf-8"
|
24
56
|
}
|
@@ -39,7 +71,7 @@ module BatchlyApi
|
|
39
71
|
response.body
|
40
72
|
end
|
41
73
|
|
42
|
-
#
|
74
|
+
# Returns the project information for the submitted identifier.
|
43
75
|
# @param [String] id Required parameter: Project Identifier
|
44
76
|
# @return ProjectModel response from the API call
|
45
77
|
def describe_project id
|
@@ -47,7 +79,7 @@ module BatchlyApi
|
|
47
79
|
query_builder = Configuration.BASE_URI.dup
|
48
80
|
|
49
81
|
# prepare query string for API call
|
50
|
-
query_builder << "/api/
|
82
|
+
query_builder << "/api/Projects/{id}"
|
51
83
|
|
52
84
|
# process optional query parameters
|
53
85
|
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
@@ -59,7 +91,7 @@ module BatchlyApi
|
|
59
91
|
|
60
92
|
# prepare headers
|
61
93
|
headers = {
|
62
|
-
"user-agent" => "batchly/0.
|
94
|
+
"user-agent" => "batchly/1.0.1",
|
63
95
|
"accept" => "application/json"
|
64
96
|
}
|
65
97
|
|
@@ -79,7 +111,7 @@ module BatchlyApi
|
|
79
111
|
response.body
|
80
112
|
end
|
81
113
|
|
82
|
-
#
|
114
|
+
# Updates the project with new details. Projects belong to an account when created and this association cannot be altered.
|
83
115
|
# @param [String] id Required parameter: Project Identifier
|
84
116
|
# @param [UpdateProjectRequest] request Required parameter: Update Project Request
|
85
117
|
# @return ProjectModel response from the API call
|
@@ -88,7 +120,7 @@ module BatchlyApi
|
|
88
120
|
query_builder = Configuration.BASE_URI.dup
|
89
121
|
|
90
122
|
# prepare query string for API call
|
91
|
-
query_builder << "/api/
|
123
|
+
query_builder << "/api/Projects/{id}"
|
92
124
|
|
93
125
|
# process optional query parameters
|
94
126
|
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
@@ -100,7 +132,7 @@ module BatchlyApi
|
|
100
132
|
|
101
133
|
# prepare headers
|
102
134
|
headers = {
|
103
|
-
"user-agent" => "batchly/0.
|
135
|
+
"user-agent" => "batchly/1.0.1",
|
104
136
|
"accept" => "application/json",
|
105
137
|
"content-type" => "application/json; charset=utf-8"
|
106
138
|
}
|
@@ -123,7 +155,7 @@ module BatchlyApi
|
|
123
155
|
response.body
|
124
156
|
end
|
125
157
|
|
126
|
-
#
|
158
|
+
# Removes the project and deactivates all the jobs currently active in it.
|
127
159
|
# @param [String] id Required parameter: Project Identifier
|
128
160
|
# @return void response from the API call
|
129
161
|
def delete_project id
|
@@ -131,7 +163,7 @@ module BatchlyApi
|
|
131
163
|
query_builder = Configuration.BASE_URI.dup
|
132
164
|
|
133
165
|
# prepare query string for API call
|
134
|
-
query_builder << "/api/
|
166
|
+
query_builder << "/api/Projects/{id}"
|
135
167
|
|
136
168
|
# process optional query parameters
|
137
169
|
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
@@ -143,7 +175,7 @@ module BatchlyApi
|
|
143
175
|
|
144
176
|
# prepare headers
|
145
177
|
headers = {
|
146
|
-
"user-agent" => "batchly/0.
|
178
|
+
"user-agent" => "batchly/1.0.1"
|
147
179
|
}
|
148
180
|
|
149
181
|
# append custom auth authorization
|
@@ -160,37 +192,5 @@ module BatchlyApi
|
|
160
192
|
end
|
161
193
|
end
|
162
194
|
|
163
|
-
# Lists all active projects in batchly
|
164
|
-
# @return Array<ProjectModel> response from the API call
|
165
|
-
def list_projects
|
166
|
-
# the base uri for api requests
|
167
|
-
query_builder = Configuration.BASE_URI.dup
|
168
|
-
|
169
|
-
# prepare query string for API call
|
170
|
-
query_builder << "/api/Project"
|
171
|
-
|
172
|
-
# validate and preprocess url
|
173
|
-
query_url = APIHelper.clean_url query_builder
|
174
|
-
|
175
|
-
# prepare headers
|
176
|
-
headers = {
|
177
|
-
"user-agent" => "batchly/0.5.3",
|
178
|
-
"accept" => "application/json"
|
179
|
-
}
|
180
|
-
|
181
|
-
# append custom auth authorization
|
182
|
-
CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
|
183
|
-
|
184
|
-
# invoke the API call request to fetch the response
|
185
|
-
response = Unirest.get query_url, headers:headers
|
186
|
-
|
187
|
-
#Error handling using HTTP status codes
|
188
|
-
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
189
|
-
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
190
|
-
end
|
191
|
-
|
192
|
-
response.body
|
193
|
-
end
|
194
|
-
|
195
195
|
end
|
196
196
|
end
|
@@ -1,47 +1,41 @@
|
|
1
|
-
# This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on
|
1
|
+
# This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 12/05/2015
|
2
2
|
|
3
3
|
module BatchlyApi
|
4
|
-
class
|
4
|
+
class RunsController
|
5
5
|
|
6
|
-
#
|
7
|
-
# @
|
8
|
-
|
9
|
-
def start_run request
|
6
|
+
# Returns the active runs with details about the current status
|
7
|
+
# @return Array<RunModel> response from the API call
|
8
|
+
def list_runs
|
10
9
|
# the base uri for api requests
|
11
10
|
query_builder = Configuration.BASE_URI.dup
|
12
11
|
|
13
12
|
# prepare query string for API call
|
14
|
-
query_builder << "/api/
|
13
|
+
query_builder << "/api/Runs"
|
15
14
|
|
16
15
|
# validate and preprocess url
|
17
16
|
query_url = APIHelper.clean_url query_builder
|
18
17
|
|
19
18
|
# prepare headers
|
20
19
|
headers = {
|
21
|
-
"user-agent" => "batchly/0.
|
22
|
-
"accept" => "application/json"
|
23
|
-
"content-type" => "application/json; charset=utf-8"
|
20
|
+
"user-agent" => "batchly/1.0.1",
|
21
|
+
"accept" => "application/json"
|
24
22
|
}
|
25
23
|
|
26
24
|
# append custom auth authorization
|
27
|
-
CustomAuthUtility.append_custom_auth_params query_url, "
|
25
|
+
CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
|
28
26
|
|
29
27
|
# invoke the API call request to fetch the response
|
30
|
-
response = Unirest.
|
28
|
+
response = Unirest.get query_url, headers:headers
|
31
29
|
|
32
|
-
#
|
33
|
-
if response.code
|
34
|
-
raise APIException.new "BadRequest", 400, response.raw_body
|
35
|
-
elsif response.code == 409
|
36
|
-
raise APIException.new "Conflict", 409, response.raw_body
|
37
|
-
elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
30
|
+
#Error handling using HTTP status codes
|
31
|
+
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
38
32
|
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
39
33
|
end
|
40
34
|
|
41
35
|
response.body
|
42
36
|
end
|
43
37
|
|
44
|
-
#
|
38
|
+
# Returns the detailed information about the requested run
|
45
39
|
# @param [String] id Required parameter: Run Identifier
|
46
40
|
# @return RunModel response from the API call
|
47
41
|
def describe_run id
|
@@ -49,7 +43,7 @@ module BatchlyApi
|
|
49
43
|
query_builder = Configuration.BASE_URI.dup
|
50
44
|
|
51
45
|
# prepare query string for API call
|
52
|
-
query_builder << "/api/
|
46
|
+
query_builder << "/api/Runs/{id}"
|
53
47
|
|
54
48
|
# process optional query parameters
|
55
49
|
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
@@ -61,7 +55,7 @@ module BatchlyApi
|
|
61
55
|
|
62
56
|
# prepare headers
|
63
57
|
headers = {
|
64
|
-
"user-agent" => "batchly/0.
|
58
|
+
"user-agent" => "batchly/1.0.1",
|
65
59
|
"accept" => "application/json"
|
66
60
|
}
|
67
61
|
|
@@ -81,7 +75,7 @@ module BatchlyApi
|
|
81
75
|
response.body
|
82
76
|
end
|
83
77
|
|
84
|
-
# Stops the
|
78
|
+
# Stops the run if its executing and returns 200 true response. Repeat calls to a run which is currently stopping returns a 200 false response
|
85
79
|
# @param [String] id Required parameter: Run Identifier
|
86
80
|
# @return Boolean response from the API call
|
87
81
|
def stop_run id
|
@@ -89,7 +83,7 @@ module BatchlyApi
|
|
89
83
|
query_builder = Configuration.BASE_URI.dup
|
90
84
|
|
91
85
|
# prepare query string for API call
|
92
|
-
query_builder << "/api/
|
86
|
+
query_builder << "/api/Runs/{id}"
|
93
87
|
|
94
88
|
# process optional query parameters
|
95
89
|
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
@@ -101,7 +95,7 @@ module BatchlyApi
|
|
101
95
|
|
102
96
|
# prepare headers
|
103
97
|
headers = {
|
104
|
-
"user-agent" => "batchly/0.
|
98
|
+
"user-agent" => "batchly/1.0.1"
|
105
99
|
}
|
106
100
|
|
107
101
|
# append custom auth authorization
|
@@ -120,7 +114,9 @@ module BatchlyApi
|
|
120
114
|
response.body
|
121
115
|
end
|
122
116
|
|
123
|
-
#
|
117
|
+
# Removes the run from the active list. The values are still considered for cost and savings calculation.
|
118
|
+
# Only completed, terminated and error runs can be archived.
|
119
|
+
# Active execution should first be stopped and then archived.
|
124
120
|
# @param [String] id Required parameter: Run Identifier
|
125
121
|
# @return void response from the API call
|
126
122
|
def delete_run id
|
@@ -128,7 +124,7 @@ module BatchlyApi
|
|
128
124
|
query_builder = Configuration.BASE_URI.dup
|
129
125
|
|
130
126
|
# prepare query string for API call
|
131
|
-
query_builder << "/api/
|
127
|
+
query_builder << "/api/Runs/{id}"
|
132
128
|
|
133
129
|
# process optional query parameters
|
134
130
|
query_builder = APIHelper.append_url_with_template_parameters query_builder, {
|
@@ -140,7 +136,7 @@ module BatchlyApi
|
|
140
136
|
|
141
137
|
# prepare headers
|
142
138
|
headers = {
|
143
|
-
"user-agent" => "batchly/0.
|
139
|
+
"user-agent" => "batchly/1.0.1"
|
144
140
|
}
|
145
141
|
|
146
142
|
# append custom auth authorization
|
@@ -157,37 +153,5 @@ module BatchlyApi
|
|
157
153
|
end
|
158
154
|
end
|
159
155
|
|
160
|
-
# Lists all the active runs in batchly
|
161
|
-
# @return Array<RunModel> response from the API call
|
162
|
-
def list_runs
|
163
|
-
# the base uri for api requests
|
164
|
-
query_builder = Configuration.BASE_URI.dup
|
165
|
-
|
166
|
-
# prepare query string for API call
|
167
|
-
query_builder << "/api/Run"
|
168
|
-
|
169
|
-
# validate and preprocess url
|
170
|
-
query_url = APIHelper.clean_url query_builder
|
171
|
-
|
172
|
-
# prepare headers
|
173
|
-
headers = {
|
174
|
-
"user-agent" => "batchly/0.5.3",
|
175
|
-
"accept" => "application/json"
|
176
|
-
}
|
177
|
-
|
178
|
-
# append custom auth authorization
|
179
|
-
CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
|
180
|
-
|
181
|
-
# invoke the API call request to fetch the response
|
182
|
-
response = Unirest.get query_url, headers:headers
|
183
|
-
|
184
|
-
#Error handling using HTTP status codes
|
185
|
-
if !(response.code.between?(200,206)) # [200,206] = HTTP OK
|
186
|
-
raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
|
187
|
-
end
|
188
|
-
|
189
|
-
response.body
|
190
|
-
end
|
191
|
-
|
192
156
|
end
|
193
157
|
end
|