batchly_api 0.5.2 → 0.6.2

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: 175821d2a864e68896b9fc66eccb3995d5e106fd
4
- data.tar.gz: dc5ef3dcef932bbd798016487615862d685c56cd
3
+ metadata.gz: b510810d3ae5a01a8d316ddd2928dae4a7208664
4
+ data.tar.gz: 1f9f1ace1919879c530f986cb675e79456859db5
5
5
  SHA512:
6
- metadata.gz: 634ac43cd255741a80125444b1212f39bc3bb1ba654843a53a787ab04cfd69eebdf274c2fa8f80da999caba94d65f41123a686a5756467363c0ab8a7065c456f
7
- data.tar.gz: 6b7f36f47e97f29f10673c51b5bcaa1ba591ed81cd322206593ea84e73ab2c0020dc70100090937e0a56d0cb044a70ea15ccb19e3ca1c2d76bb71400463524ac
6
+ metadata.gz: 862b5a12534ef0c2241e16e046ce4668fab44cb29b7c36535e853f0567711e9639cdd5189872689e81db720a1c2d0d1931414edaaf8af5c96a0676798ca10d65
7
+ data.tar.gz: 779124184c8fde645263fc08cb6362f547813840ca3a61aa657ee5c2733927a75ee72d6557795346c6dba5bcbf96fd3f26f1948e75e5b8af4512ba33cf467531
@@ -1,10 +1,7 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
  require 'openssl'
3
3
  require 'json'
4
4
  require 'unirest'
5
- require 'uri'
6
- require 'cgi'
7
- require 'base64'
8
5
 
9
6
  # APIMATIC Helper Files
10
7
  require 'batchly_api/api_helper.rb'
@@ -20,11 +17,11 @@ require 'batchly_api/controllers/project_controller.rb'
20
17
  require 'batchly_api/controllers/run_controller.rb'
21
18
 
22
19
  # Models
23
- require 'batchly_api/models/execute_job_request.rb'
24
- require 'batchly_api/models/add_aws_account_request.rb'
25
20
  require 'batchly_api/models/add_s_3_data_source_request.rb'
26
- require 'batchly_api/models/create_job_request.rb'
27
21
  require 'batchly_api/models/job_schedule.rb'
28
22
  require 'batchly_api/models/create_project_request.rb'
29
23
  require 'batchly_api/models/vpc_details.rb'
30
24
  require 'batchly_api/models/update_project_request.rb'
25
+ require 'batchly_api/models/execute_job_request.rb'
26
+ require 'batchly_api/models/add_aws_account_request.rb'
27
+ require 'batchly_api/models/create_job_request.rb'
@@ -1,4 +1,4 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class APIException < StandardError
@@ -1,4 +1,4 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class APIHelper
@@ -1,22 +1,16 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
- module BatchlyApi
3
+ module BatchlyApi
4
4
  class Configuration
5
5
 
6
6
  # The base Uri for API calls
7
- @BASE_URI = "http://api.corrs.batchly.net"
7
+ @BASE_URI = "http://localhost:14913"
8
8
 
9
- # The access key for batchly
10
- @API_KEY = "UPDATE YOUR GENERATED API KEY HERE"
11
-
12
- # The access key for batchly
13
- @API_SECRET = "UPDATE YOUR GENERATED API SECRET HERE"
14
9
 
15
10
  # create the getters and setters
16
11
  class << self
17
12
  attr_accessor :BASE_URI
18
- attr_accessor :API_KEY
19
- attr_accessor :API_SECRET
13
+
20
14
  end
21
15
  end
22
16
  end
@@ -1,17 +1,17 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class AccountController
5
5
 
6
6
  # Lists all active projects in the given account identifier.
7
- # @param [String] id Required parameter: TODO: type description here
7
+ # @param [String] id Required parameter: Account ID
8
8
  # @return Array<ProjectModel> response from the API call
9
9
  def list_projects id
10
10
  # the base uri for api requests
11
11
  query_builder = Configuration.BASE_URI.dup
12
12
 
13
13
  # prepare query string for API call
14
- query_builder << "/Account/{id}/Projects"
14
+ query_builder << "/api/account/{id}/Projects"
15
15
 
16
16
  # process optional query parameters
17
17
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -23,7 +23,7 @@ module BatchlyApi
23
23
 
24
24
  # prepare headers
25
25
  headers = {
26
- "user-agent" => "batchly/0.5.1",
26
+ "user-agent" => "batchly/0.5.3",
27
27
  "accept" => "application/json"
28
28
  }
29
29
 
@@ -41,105 +41,105 @@ module BatchlyApi
41
41
  response.body
42
42
  end
43
43
 
44
- # Add a new AWS account. The credentials should have IAMFullAccess Permissions. The keys are used to only create a new Batchly role in AWS IAM. The keys are not saved in batchly servers. Future calls are made using the newly created Batchly Role.
45
- # @param [AddAWSAccountRequest] model Required parameter: TODO: type description here
46
- # @return AccountModel response from the API call
47
- def add_aws_cloud_account model
44
+ # Deactivates the account and all associated jobs.
45
+ # @param [String] id Required parameter: Account Identifier.
46
+ # @return void response from the API call
47
+ def delete id
48
48
  # the base uri for api requests
49
49
  query_builder = Configuration.BASE_URI.dup
50
50
 
51
51
  # prepare query string for API call
52
- query_builder << "/Account/AWS"
52
+ query_builder << "/api/Account/{id}"
53
+
54
+ # process optional query parameters
55
+ query_builder = APIHelper.append_url_with_template_parameters query_builder, {
56
+ "id" => id,
57
+ }
53
58
 
54
59
  # validate and preprocess url
55
60
  query_url = APIHelper.clean_url query_builder
56
61
 
57
62
  # prepare headers
58
63
  headers = {
59
- "user-agent" => "batchly/0.5.1",
60
- "accept" => "application/json",
61
- "content-type" => "application/json; charset=utf-8"
64
+ "user-agent" => "batchly/0.5.3"
62
65
  }
63
66
 
64
67
  # append custom auth authorization
65
- CustomAuthUtility.append_custom_auth_params query_url, "POST", headers
68
+ CustomAuthUtility.append_custom_auth_params query_url, "DELETE", headers
66
69
 
67
70
  # invoke the API call request to fetch the response
68
- response = Unirest.post query_url, headers:headers, parameters:model.to_json
71
+ response = Unirest.delete query_url, headers:headers
69
72
 
70
73
  # Error handling using HTTP status codes
71
- if response.code == 400
72
- raise APIException.new "BadRequest", 400, response.raw_body
74
+ if response.code == 404
75
+ raise APIException.new "NotFound", 404, response.raw_body
73
76
  elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK
74
77
  raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
75
78
  end
76
-
77
- response.body
78
79
  end
79
80
 
80
- # Deactivates the account and all associated jobs.
81
- # @param [String] id Required parameter: TODO: type description here
82
- # @return void response from the API call
83
- def delete_account id
81
+ # Lists all active accounts associated with the batchly account
82
+ # @return Array<AccountModel> response from the API call
83
+ def list_accounts
84
84
  # the base uri for api requests
85
85
  query_builder = Configuration.BASE_URI.dup
86
86
 
87
87
  # prepare query string for API call
88
- query_builder << "/Account/{id}"
89
-
90
- # process optional query parameters
91
- query_builder = APIHelper.append_url_with_template_parameters query_builder, {
92
- "id" => id,
93
- }
88
+ query_builder << "/api/Account"
94
89
 
95
90
  # validate and preprocess url
96
91
  query_url = APIHelper.clean_url query_builder
97
92
 
98
93
  # prepare headers
99
94
  headers = {
100
- "user-agent" => "batchly/0.5.1"
95
+ "user-agent" => "batchly/0.5.3",
96
+ "accept" => "application/json"
101
97
  }
102
98
 
103
99
  # append custom auth authorization
104
- CustomAuthUtility.append_custom_auth_params query_url, "DELETE", headers
100
+ CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
105
101
 
106
102
  # invoke the API call request to fetch the response
107
- response = Unirest.delete query_url, headers:headers
103
+ response = Unirest.get query_url, headers:headers
108
104
 
109
- # Error handling using HTTP status codes
110
- if response.code == 404
111
- raise APIException.new "NotFound", 404, response.raw_body
112
- elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK
105
+ #Error handling using HTTP status codes
106
+ if !(response.code.between?(200,206)) # [200,206] = HTTP OK
113
107
  raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
114
108
  end
109
+
110
+ response.body
115
111
  end
116
112
 
117
- # Lists all active accounts associated with the batchly account
118
- # @return Array<AccountModel> response from the API call
119
- def list_accounts
113
+ # Add a new AWS account. The credentials should have IAMFullAccess Permissions. The keys are used to only create a new Batchly role in AWS IAM. The keys are not saved in batchly servers. Future calls are made using the newly created Batchly Role.
114
+ # @param [AddAWSAccountRequest] model Required parameter: Request model for adding AWS account
115
+ # @return AccountModel response from the API call
116
+ def add_aws_cloud_account model
120
117
  # the base uri for api requests
121
118
  query_builder = Configuration.BASE_URI.dup
122
119
 
123
120
  # prepare query string for API call
124
- query_builder << "/Account"
121
+ query_builder << "/api/account/AWS"
125
122
 
126
123
  # validate and preprocess url
127
124
  query_url = APIHelper.clean_url query_builder
128
125
 
129
126
  # prepare headers
130
127
  headers = {
131
- "user-agent" => "batchly/0.5.1",
132
- "accept" => "application/json"
128
+ "user-agent" => "batchly/0.5.3",
129
+ "accept" => "application/json",
130
+ "content-type" => "application/json; charset=utf-8"
133
131
  }
134
132
 
135
133
  # append custom auth authorization
136
- CustomAuthUtility.append_custom_auth_params query_url, "GET", headers
134
+ CustomAuthUtility.append_custom_auth_params query_url, "POST", headers
137
135
 
138
136
  # invoke the API call request to fetch the response
139
- response = Unirest.get query_url, headers:headers
137
+ response = Unirest.post query_url, headers:headers, parameters:model.to_json
140
138
 
141
- #Error handling using HTTP status codes
142
- if !(response.code.between?(200,206)) # [200,206] = HTTP OK
139
+ # Error handling using HTTP status codes
140
+ if response.code == 400
141
+ raise APIException.new "BadRequest", 400, response.raw_body
142
+ elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK
143
143
  raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
144
144
  end
145
145
 
@@ -1,24 +1,24 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class DataSourceController
5
5
 
6
6
  # Registers a new s3 endpoint with batchly. This endpoint can be used as either a source or destination for your job.
7
- # @param [AddS3DataSourceRequest] model Required parameter: TODO: type description here
7
+ # @param [AddS3DataSourceRequest] model Required parameter: Add S3 DataSource request
8
8
  # @return String response from the API call
9
9
  def add_s_3 model
10
10
  # the base uri for api requests
11
11
  query_builder = Configuration.BASE_URI.dup
12
12
 
13
13
  # prepare query string for API call
14
- query_builder << "/DataSource/S3"
14
+ query_builder << "/api/datasources/S3"
15
15
 
16
16
  # validate and preprocess url
17
17
  query_url = APIHelper.clean_url query_builder
18
18
 
19
19
  # prepare headers
20
20
  headers = {
21
- "user-agent" => "batchly/0.5.1",
21
+ "user-agent" => "batchly/0.5.3",
22
22
  "content-type" => "application/json; charset=utf-8"
23
23
  }
24
24
 
@@ -1,23 +1,23 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class JobController
5
5
 
6
- # TODO: type endpoint description here
6
+ # Lists all active jobs in batchly
7
7
  # @return Array<JobModel> response from the API call
8
8
  def list_jobs
9
9
  # the base uri for api requests
10
10
  query_builder = Configuration.BASE_URI.dup
11
11
 
12
12
  # prepare query string for API call
13
- query_builder << "/Job"
13
+ query_builder << "/api/Job"
14
14
 
15
15
  # validate and preprocess url
16
16
  query_url = APIHelper.clean_url query_builder
17
17
 
18
18
  # prepare headers
19
19
  headers = {
20
- "user-agent" => "batchly/0.5.1",
20
+ "user-agent" => "batchly/0.5.3",
21
21
  "accept" => "application/json"
22
22
  }
23
23
 
@@ -36,21 +36,21 @@ module BatchlyApi
36
36
  end
37
37
 
38
38
  # Adds a new job. Job can be created after registering source and destination as data sources and uploading new processor. Job brings your processors and data endpoints together.
39
- # @param [CreateJobRequest] request Required parameter: TODO: type description here
39
+ # @param [CreateJobRequest] request Required parameter: Create Job Request
40
40
  # @return JobModel response from the API call
41
41
  def add_job request
42
42
  # the base uri for api requests
43
43
  query_builder = Configuration.BASE_URI.dup
44
44
 
45
45
  # prepare query string for API call
46
- query_builder << "/Job"
46
+ query_builder << "/api/Job"
47
47
 
48
48
  # validate and preprocess url
49
49
  query_url = APIHelper.clean_url query_builder
50
50
 
51
51
  # prepare headers
52
52
  headers = {
53
- "user-agent" => "batchly/0.5.1",
53
+ "user-agent" => "batchly/0.5.3",
54
54
  "accept" => "application/json",
55
55
  "content-type" => "application/json; charset=utf-8"
56
56
  }
@@ -71,15 +71,15 @@ module BatchlyApi
71
71
  response.body
72
72
  end
73
73
 
74
- # TODO: type endpoint description here
75
- # @param [String] id Required parameter: TODO: type description here
74
+ # Describes the Job
75
+ # @param [String] id Required parameter: Job Identifier
76
76
  # @return JobModel response from the API call
77
77
  def describe_job id
78
78
  # the base uri for api requests
79
79
  query_builder = Configuration.BASE_URI.dup
80
80
 
81
81
  # prepare query string for API call
82
- query_builder << "/Job/{id}"
82
+ query_builder << "/api/Job/{id}"
83
83
 
84
84
  # process optional query parameters
85
85
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -91,7 +91,7 @@ module BatchlyApi
91
91
 
92
92
  # prepare headers
93
93
  headers = {
94
- "user-agent" => "batchly/0.5.1",
94
+ "user-agent" => "batchly/0.5.3",
95
95
  "accept" => "application/json"
96
96
  }
97
97
 
@@ -112,14 +112,14 @@ module BatchlyApi
112
112
  end
113
113
 
114
114
  # Deletes the jobs and removes all schedules
115
- # @param [String] id Required parameter: TODO: type description here
115
+ # @param [String] id Required parameter: Job Identifier
116
116
  # @return void response from the API call
117
117
  def delete_job id
118
118
  # the base uri for api requests
119
119
  query_builder = Configuration.BASE_URI.dup
120
120
 
121
121
  # prepare query string for API call
122
- query_builder << "/Job/{id}"
122
+ query_builder << "/api/Job/{id}"
123
123
 
124
124
  # process optional query parameters
125
125
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -131,7 +131,7 @@ module BatchlyApi
131
131
 
132
132
  # prepare headers
133
133
  headers = {
134
- "user-agent" => "batchly/0.5.1"
134
+ "user-agent" => "batchly/0.5.3"
135
135
  }
136
136
 
137
137
  # append custom auth authorization
@@ -1,56 +1,24 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class ProjectController
5
5
 
6
- # TODO: type endpoint description here
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 << "/Project"
14
-
15
- # validate and preprocess url
16
- query_url = APIHelper.clean_url query_builder
17
-
18
- # prepare headers
19
- headers = {
20
- "user-agent" => "batchly/0.5.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 [CreateProjectRequest] request Required parameter: TODO: type description here
6
+ # Add a new Project and associate with a cloud VPC
7
+ # @param [CreateProjectRequest] request Required parameter: Create Project Request
40
8
  # @return ProjectModel response from the API call
41
9
  def add_project request
42
10
  # the base uri for api requests
43
11
  query_builder = Configuration.BASE_URI.dup
44
12
 
45
13
  # prepare query string for API call
46
- query_builder << "/Project"
14
+ query_builder << "/api/Project"
47
15
 
48
16
  # validate and preprocess url
49
17
  query_url = APIHelper.clean_url query_builder
50
18
 
51
19
  # prepare headers
52
20
  headers = {
53
- "user-agent" => "batchly/0.5.1",
21
+ "user-agent" => "batchly/0.5.3",
54
22
  "accept" => "application/json",
55
23
  "content-type" => "application/json; charset=utf-8"
56
24
  }
@@ -71,15 +39,15 @@ module BatchlyApi
71
39
  response.body
72
40
  end
73
41
 
74
- # TODO: type endpoint description here
75
- # @param [String] id Required parameter: TODO: type description here
42
+ # Describes the Project in detail
43
+ # @param [String] id Required parameter: Project Identifier
76
44
  # @return ProjectModel response from the API call
77
45
  def describe_project id
78
46
  # the base uri for api requests
79
47
  query_builder = Configuration.BASE_URI.dup
80
48
 
81
49
  # prepare query string for API call
82
- query_builder << "/Project/{id}"
50
+ query_builder << "/api/Project/{id}"
83
51
 
84
52
  # process optional query parameters
85
53
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -91,7 +59,7 @@ module BatchlyApi
91
59
 
92
60
  # prepare headers
93
61
  headers = {
94
- "user-agent" => "batchly/0.5.1",
62
+ "user-agent" => "batchly/0.5.3",
95
63
  "accept" => "application/json"
96
64
  }
97
65
 
@@ -111,16 +79,16 @@ module BatchlyApi
111
79
  response.body
112
80
  end
113
81
 
114
- # TODO: type endpoint description here
115
- # @param [String] id Required parameter: TODO: type description here
116
- # @param [UpdateProjectRequest] request Required parameter: TODO: type description here
82
+ # Update the project with new information
83
+ # @param [String] id Required parameter: Project Identifier
84
+ # @param [UpdateProjectRequest] request Required parameter: Update Project Request
117
85
  # @return ProjectModel response from the API call
118
86
  def update_project id, request
119
87
  # the base uri for api requests
120
88
  query_builder = Configuration.BASE_URI.dup
121
89
 
122
90
  # prepare query string for API call
123
- query_builder << "/Project/{id}"
91
+ query_builder << "/api/Project/{id}"
124
92
 
125
93
  # process optional query parameters
126
94
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -132,7 +100,7 @@ module BatchlyApi
132
100
 
133
101
  # prepare headers
134
102
  headers = {
135
- "user-agent" => "batchly/0.5.1",
103
+ "user-agent" => "batchly/0.5.3",
136
104
  "accept" => "application/json",
137
105
  "content-type" => "application/json; charset=utf-8"
138
106
  }
@@ -155,15 +123,15 @@ module BatchlyApi
155
123
  response.body
156
124
  end
157
125
 
158
- # TODO: type endpoint description here
159
- # @param [String] id Required parameter: TODO: type description here
126
+ # Deletes the project & deactivates all existing jobs in the project
127
+ # @param [String] id Required parameter: Project Identifier
160
128
  # @return void response from the API call
161
129
  def delete_project id
162
130
  # the base uri for api requests
163
131
  query_builder = Configuration.BASE_URI.dup
164
132
 
165
133
  # prepare query string for API call
166
- query_builder << "/Project/{id}"
134
+ query_builder << "/api/Project/{id}"
167
135
 
168
136
  # process optional query parameters
169
137
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -175,7 +143,7 @@ module BatchlyApi
175
143
 
176
144
  # prepare headers
177
145
  headers = {
178
- "user-agent" => "batchly/0.5.1"
146
+ "user-agent" => "batchly/0.5.3"
179
147
  }
180
148
 
181
149
  # append custom auth authorization
@@ -192,5 +160,37 @@ module BatchlyApi
192
160
  end
193
161
  end
194
162
 
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,56 +1,24 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class RunController
5
5
 
6
- # TODO: type endpoint description here
7
- # @return Array<RunModel> response from the API call
8
- def list_runs
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 << "/Run"
14
-
15
- # validate and preprocess url
16
- query_url = APIHelper.clean_url query_builder
17
-
18
- # prepare headers
19
- headers = {
20
- "user-agent" => "batchly/0.5.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 [ExecuteJobRequest] request Required parameter: TODO: type description here
6
+ # Executes the job and creates a new run for tracking
7
+ # @param [ExecuteJobRequest] request Required parameter: Execute Job Request
40
8
  # @return RunModel response from the API call
41
- def add_run request
9
+ def start_run request
42
10
  # the base uri for api requests
43
11
  query_builder = Configuration.BASE_URI.dup
44
12
 
45
13
  # prepare query string for API call
46
- query_builder << "/Run"
14
+ query_builder << "/api/Run"
47
15
 
48
16
  # validate and preprocess url
49
17
  query_url = APIHelper.clean_url query_builder
50
18
 
51
19
  # prepare headers
52
20
  headers = {
53
- "user-agent" => "batchly/0.5.1",
21
+ "user-agent" => "batchly/0.5.3",
54
22
  "accept" => "application/json",
55
23
  "content-type" => "application/json; charset=utf-8"
56
24
  }
@@ -73,15 +41,15 @@ module BatchlyApi
73
41
  response.body
74
42
  end
75
43
 
76
- # TODO: type endpoint description here
77
- # @param [String] id Required parameter: TODO: type description here
44
+ # Describes the run
45
+ # @param [String] id Required parameter: Run Identifier
78
46
  # @return RunModel response from the API call
79
47
  def describe_run id
80
48
  # the base uri for api requests
81
49
  query_builder = Configuration.BASE_URI.dup
82
50
 
83
51
  # prepare query string for API call
84
- query_builder << "/Run/{id}"
52
+ query_builder << "/api/Run/{id}"
85
53
 
86
54
  # process optional query parameters
87
55
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -93,7 +61,7 @@ module BatchlyApi
93
61
 
94
62
  # prepare headers
95
63
  headers = {
96
- "user-agent" => "batchly/0.5.1",
64
+ "user-agent" => "batchly/0.5.3",
97
65
  "accept" => "application/json"
98
66
  }
99
67
 
@@ -113,15 +81,15 @@ module BatchlyApi
113
81
  response.body
114
82
  end
115
83
 
116
- # TODO: type endpoint description here
117
- # @param [String] id Required parameter: TODO: type description here
118
- # @return void response from the API call
84
+ # Stops the execution of job
85
+ # @param [String] id Required parameter: Run Identifier
86
+ # @return Boolean response from the API call
119
87
  def stop_run id
120
88
  # the base uri for api requests
121
89
  query_builder = Configuration.BASE_URI.dup
122
90
 
123
91
  # prepare query string for API call
124
- query_builder << "/Run/{id}"
92
+ query_builder << "/api/Run/{id}"
125
93
 
126
94
  # process optional query parameters
127
95
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -133,7 +101,7 @@ module BatchlyApi
133
101
 
134
102
  # prepare headers
135
103
  headers = {
136
- "user-agent" => "batchly/0.5.1"
104
+ "user-agent" => "batchly/0.5.3"
137
105
  }
138
106
 
139
107
  # append custom auth authorization
@@ -148,17 +116,19 @@ module BatchlyApi
148
116
  elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK
149
117
  raise APIException.new "HTTP Response Not OK", response.code, response.raw_body
150
118
  end
119
+
120
+ response.body
151
121
  end
152
122
 
153
- # TODO: type endpoint description here
154
- # @param [String] id Required parameter: TODO: type description here
123
+ # Delete the run
124
+ # @param [String] id Required parameter: Run Identifier
155
125
  # @return void response from the API call
156
126
  def delete_run id
157
127
  # the base uri for api requests
158
128
  query_builder = Configuration.BASE_URI.dup
159
129
 
160
130
  # prepare query string for API call
161
- query_builder << "/Run/{id}"
131
+ query_builder << "/api/Run/{id}"
162
132
 
163
133
  # process optional query parameters
164
134
  query_builder = APIHelper.append_url_with_template_parameters query_builder, {
@@ -170,7 +140,7 @@ module BatchlyApi
170
140
 
171
141
  # prepare headers
172
142
  headers = {
173
- "user-agent" => "batchly/0.5.1"
143
+ "user-agent" => "batchly/0.5.3"
174
144
  }
175
145
 
176
146
  # append custom auth authorization
@@ -187,5 +157,37 @@ module BatchlyApi
187
157
  end
188
158
  end
189
159
 
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
+
190
192
  end
191
193
  end
@@ -28,7 +28,14 @@ module BatchlyApi
28
28
  apiKey = Configuration.API_KEY.dup
29
29
  apiSecret = Configuration.API_SECRET.dup
30
30
 
31
- req_url = parsed_url.scheme + '://' + parsed_url.host + parsed_url.path
31
+ req_url = parsed_url.to_s
32
+
33
+ if parsed_url.port == 80 || parsed_url.port == 443
34
+ req_url = parsed_url.scheme + '://' + parsed_url.host + parsed_url.path
35
+ else
36
+ req_url = parsed_url.scheme + '://' + parsed_url.host + ":" + parsed_url.port.to_s + parsed_url.path
37
+ end
38
+
32
39
  hmacHeaders = {
33
40
  HEADER_NONCE => Array.new( 5 ) { rand(256) }.pack('C*').unpack('H*').first,
34
41
  HEADER_TIMESTAMP => Time.now.to_i,
@@ -1,21 +1,22 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class AddAwsAccountRequest
5
5
 
6
- # TODO: Write general description for this method
6
+ # A name to identify the account
7
7
  # @return [String]
8
8
  attr_accessor :name
9
9
 
10
- # TODO: Write general description for this method
10
+ # AWS Access key with "IAMFullAccess" permissions
11
11
  # @return [String]
12
12
  attr_accessor :access_key
13
13
 
14
- # TODO: Write general description for this method
14
+ # AWS Secret key of the corresponding Access Key
15
15
  # @return [String]
16
16
  attr_accessor :secret_key
17
17
 
18
- # TODO: Write general description for this method
18
+ # Default aws region for storing configuration and processors
19
+ # Value should equal aws region identifier. e.g. us-east-1, ap-southeast-2
19
20
  # @return [String]
20
21
  attr_accessor :base_region
21
22
 
@@ -1,13 +1,13 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class AddS3DataSourceRequest
5
5
 
6
- # TODO: Write general description for this method
6
+ # Name of the S3 bucket
7
7
  # @return [String]
8
8
  attr_accessor :bucket
9
9
 
10
- # TODO: Write general description for this method
10
+ # Folder within the S3 bucket
11
11
  # @return [String]
12
12
  attr_accessor :folder
13
13
 
@@ -1,41 +1,41 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class CreateJobRequest
5
5
 
6
- # TODO: Write general description for this method
6
+ # Name of the job
7
7
  # @return [String]
8
8
  attr_accessor :name
9
9
 
10
- # TODO: Write general description for this method
10
+ # Identifier of the Project under which the job should execute
11
11
  # @return [String]
12
12
  attr_accessor :project_id
13
13
 
14
- # TODO: Write general description for this method
14
+ # Identifier of the Processor that processes the data
15
15
  # @return [String]
16
16
  attr_accessor :processor_id
17
17
 
18
- # TODO: Write general description for this method
18
+ # Identifier of the DataSource from which data is extracted for processing
19
19
  # @return [String]
20
20
  attr_accessor :data_source_id
21
21
 
22
- # TODO: Write general description for this method
22
+ # Identifier fo the DataSource into which processed data is sent
23
23
  # @return [String]
24
24
  attr_accessor :destination_id
25
25
 
26
- # TODO: Write general description for this method
26
+ # Schedule information of Job if it should be managed by Scheduler
27
27
  # @return [JobSchedule]
28
28
  attr_accessor :schedule
29
29
 
30
- # TODO: Write general description for this method
30
+ # Default Region in which the job should execute. You can change region for each run when calling "Execute" endpoint.
31
31
  # @return [String]
32
32
  attr_accessor :region
33
33
 
34
- # TODO: Write general description for this method
34
+ # Default SLA for the job execution. You can change SLA for each run when calling the "Execute" endpoint.
35
35
  # @return [Double]
36
36
  attr_accessor :sla
37
37
 
38
- # TODO: Write general description for this method
38
+ # Parameter name and values that should be sent to the processor. The values can be changed for each run when calling the "Execute" endpoint.
39
39
  # @return [mixed]
40
40
  attr_accessor :parameters
41
41
 
@@ -1,17 +1,17 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class CreateProjectRequest
5
5
 
6
- # TODO: Write general description for this method
6
+ # Identifier of the Account in which the project resides
7
7
  # @return [String]
8
8
  attr_accessor :account_id
9
9
 
10
- # TODO: Write general description for this method
10
+ # Name of the project
11
11
  # @return [String]
12
12
  attr_accessor :name
13
13
 
14
- # TODO: Write general description for this method
14
+ # VPC Information for projects which are restricted to use a given infrastructure zone
15
15
  # @return [VpcDetails]
16
16
  attr_accessor :vpc
17
17
 
@@ -1,17 +1,17 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class ExecuteJobRequest
5
5
 
6
- # TODO: Write general description for this method
6
+ # Job Identifier
7
7
  # @return [String]
8
8
  attr_accessor :job_id
9
9
 
10
- # TODO: Write general description for this method
10
+ # SLA for the run
11
11
  # @return [Double]
12
12
  attr_accessor :sla
13
13
 
14
- # TODO: Write general description for this method
14
+ # Region in which the job should execute
15
15
  # @return [String]
16
16
  attr_accessor :region
17
17
 
@@ -1,13 +1,15 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class JobSchedule
5
5
 
6
- # TODO: Write general description for this method
6
+ # Time Schedule for the Job in CRON notation format.
7
+ # http://www.nncron.ru/help/EN/working/cron-format.htm
7
8
  # @return [String]
8
9
  attr_accessor :cron
9
10
 
10
- # TODO: Write general description for this method
11
+ # Timezone Identifier for the Scheduled Job. Identifier should be a valid value in the standard timezone list published by Microsoft.
12
+ # https://msdn.microsoft.com/en-us/library/gg154758.aspx
11
13
  # @return [String]
12
14
  attr_accessor :timezone
13
15
 
@@ -1,13 +1,13 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class UpdateProjectRequest
5
5
 
6
- # TODO: Write general description for this method
6
+ # Name of the project
7
7
  # @return [String]
8
8
  attr_accessor :name
9
9
 
10
- # TODO: Write general description for this method
10
+ # VPC Information for projects which are restricted to use a given infrastructure zone
11
11
  # @return [VpcDetails]
12
12
  attr_accessor :vpc
13
13
 
@@ -1,17 +1,18 @@
1
- # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/18/2015
1
+ # This file was automatically generated for support.batchly.net by APIMATIC BETA v2.0 on 11/26/2015
2
2
 
3
3
  module BatchlyApi
4
4
  class VpcDetails
5
5
 
6
- # TODO: Write general description for this method
6
+ # Identifier information of the VPC from cloud service
7
7
  # @return [String]
8
8
  attr_accessor :vpc_id
9
9
 
10
- # TODO: Write general description for this method
10
+ # List of subnets within VPC which are assigned for batchly usage.
11
+ # Minimum Subnets required for High Availability: 2
11
12
  # @return [Array<String>]
12
13
  attr_accessor :subnet_ids
13
14
 
14
- # TODO: Write general description for this method
15
+ # Cloud Region in which the VPC is setup
15
16
  # @return [String]
16
17
  attr_accessor :region
17
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batchly_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - batchly api support
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-24 00:00:00.000000000 Z
12
+ date: 2015-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: unirest