allq_client 1.0.0

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.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +69 -0
  4. data/README.md +111 -0
  5. data/Rakefile +8 -0
  6. data/allq_client.gemspec +46 -0
  7. data/docs/ActionsApi.md +544 -0
  8. data/docs/AdminApi.md +98 -0
  9. data/docs/BasicPayload.md +11 -0
  10. data/docs/BasicResponse.md +8 -0
  11. data/docs/JobRef.md +8 -0
  12. data/docs/JobResponse.md +12 -0
  13. data/docs/NewJob.md +13 -0
  14. data/docs/NewParentJob.md +16 -0
  15. data/docs/StatsInfo.md +9 -0
  16. data/docs/StatsResults.md +10 -0
  17. data/docs/StatsTube.md +14 -0
  18. data/docs/Throttle.md +9 -0
  19. data/docs/TubeRef.md +8 -0
  20. data/git_push.sh +55 -0
  21. data/lib/allq_client.rb +52 -0
  22. data/lib/allq_client/api/actions_api.rb +642 -0
  23. data/lib/allq_client/api/admin_api.rb +128 -0
  24. data/lib/allq_client/api_client.rb +388 -0
  25. data/lib/allq_client/api_error.rb +38 -0
  26. data/lib/allq_client/configuration.rb +202 -0
  27. data/lib/allq_client/models/basic_payload.rb +223 -0
  28. data/lib/allq_client/models/basic_response.rb +193 -0
  29. data/lib/allq_client/models/job_ref.rb +194 -0
  30. data/lib/allq_client/models/job_response.rb +253 -0
  31. data/lib/allq_client/models/new_job.rb +274 -0
  32. data/lib/allq_client/models/new_parent_job.rb +306 -0
  33. data/lib/allq_client/models/stats_info.rb +208 -0
  34. data/lib/allq_client/models/stats_results.rb +226 -0
  35. data/lib/allq_client/models/stats_tube.rb +289 -0
  36. data/lib/allq_client/models/throttle.rb +213 -0
  37. data/lib/allq_client/models/tube_ref.rb +194 -0
  38. data/lib/allq_client/version.rb +15 -0
  39. data/spec/api/actions_api_spec.rb +169 -0
  40. data/spec/api/admin_api_spec.rb +58 -0
  41. data/spec/api_client_spec.rb +226 -0
  42. data/spec/configuration_spec.rb +42 -0
  43. data/spec/models/basic_payload_spec.rb +60 -0
  44. data/spec/models/basic_response_spec.rb +42 -0
  45. data/spec/models/job_ref_spec.rb +42 -0
  46. data/spec/models/job_response_spec.rb +66 -0
  47. data/spec/models/new_job_spec.rb +72 -0
  48. data/spec/models/new_parent_job_spec.rb +90 -0
  49. data/spec/models/stats_info_spec.rb +48 -0
  50. data/spec/models/stats_results_spec.rb +54 -0
  51. data/spec/models/stats_tube_spec.rb +78 -0
  52. data/spec/models/throttle_spec.rb +48 -0
  53. data/spec/models/tube_ref_spec.rb +42 -0
  54. data/spec/spec_helper.rb +111 -0
  55. metadata +292 -0
data/docs/AdminApi.md ADDED
@@ -0,0 +1,98 @@
1
+ # Allq::AdminApi
2
+
3
+ All URIs are relative to *http://localhost:8090*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**stats_get**](AdminApi.md#stats_get) | **GET** /stats | Stats
8
+ [**update_servers_put**](AdminApi.md#update_servers_put) | **PUT** /update_servers | Reset Server Urls
9
+
10
+
11
+ # **stats_get**
12
+ > Array<StatsResults> stats_get
13
+
14
+ Stats
15
+
16
+ Get Stats
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'allq_client'
22
+
23
+ api_instance = Allq::AdminApi.new
24
+
25
+ begin
26
+ #Stats
27
+ result = api_instance.stats_get
28
+ p result
29
+ rescue Allq::ApiError => e
30
+ puts "Exception when calling AdminApi->stats_get: #{e}"
31
+ end
32
+ ```
33
+
34
+ ### Parameters
35
+ This endpoint does not need any parameter.
36
+
37
+ ### Return type
38
+
39
+ [**Array<StatsResults>**](StatsResults.md)
40
+
41
+ ### Authorization
42
+
43
+ No authorization required
44
+
45
+ ### HTTP request headers
46
+
47
+ - **Content-Type**: application/json
48
+ - **Accept**: application/json
49
+
50
+
51
+
52
+ # **update_servers_put**
53
+ > BasicResponse update_servers_put(server_urls)
54
+
55
+ Reset Server Urls
56
+
57
+ Change server URLs
58
+
59
+ ### Example
60
+ ```ruby
61
+ # load the gem
62
+ require 'allq_client'
63
+
64
+ api_instance = Allq::AdminApi.new
65
+
66
+ server_urls = "server_urls_example" # String | Comma Separated List URL String
67
+
68
+
69
+ begin
70
+ #Reset Server Urls
71
+ result = api_instance.update_servers_put(server_urls)
72
+ p result
73
+ rescue Allq::ApiError => e
74
+ puts "Exception when calling AdminApi->update_servers_put: #{e}"
75
+ end
76
+ ```
77
+
78
+ ### Parameters
79
+
80
+ Name | Type | Description | Notes
81
+ ------------- | ------------- | ------------- | -------------
82
+ **server_urls** | **String**| Comma Separated List URL String |
83
+
84
+ ### Return type
85
+
86
+ [**BasicResponse**](BasicResponse.md)
87
+
88
+ ### Authorization
89
+
90
+ No authorization required
91
+
92
+ ### HTTP request headers
93
+
94
+ - **Content-Type**: application/json
95
+ - **Accept**: application/json
96
+
97
+
98
+
@@ -0,0 +1,11 @@
1
+ # Allq::BasicPayload
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **action** | **String** | Name of action |
7
+ **job_id** | **String** | Job ID | [optional]
8
+ **error** | **String** | Error (If any) | [optional]
9
+ **job** | [**JobResponse**](JobResponse.md) | | [optional]
10
+
11
+
@@ -0,0 +1,8 @@
1
+ # Allq::BasicResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **response** | [**BasicPayload**](BasicPayload.md) | |
7
+
8
+
data/docs/JobRef.md ADDED
@@ -0,0 +1,8 @@
1
+ # Allq::JobRef
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **job_id** | **String** | Job ID |
7
+
8
+
@@ -0,0 +1,12 @@
1
+ # Allq::JobResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **String** | Job id | [optional]
7
+ **body** | **String** | Body |
8
+ **tube** | **String** | Tube name |
9
+ **expireds** | **Integer** | Expired count | [default to 0]
10
+ **releases** | **Integer** | Release count | [default to 0]
11
+
12
+
data/docs/NewJob.md ADDED
@@ -0,0 +1,13 @@
1
+ # Allq::NewJob
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tube** | **String** | Tube name | [default to "default"]
7
+ **body** | **String** | Text payload | [default to "<BODY_TEXT>"]
8
+ **ttl** | **Integer** | Time to live when reserved (in seconds) | [default to 1200]
9
+ **delay** | **Integer** | Delay before becoming available for processing | [default to 0]
10
+ **priority** | **Integer** | Priority of job in tube | [default to 5]
11
+ **parent_id** | **String** | Parent job id (if applicable) | [optional]
12
+
13
+
@@ -0,0 +1,16 @@
1
+ # Allq::NewParentJob
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tube** | **String** | Tube name | [default to "default"]
7
+ **body** | **String** | Text payload | [default to "<BODY_TEXT>"]
8
+ **ttl** | **Integer** | Time to live when reserved (in seconds) | [default to 1200]
9
+ **delay** | **Integer** | Delay before becoming available for processing | [default to 0]
10
+ **priority** | **Integer** | Priority of job in tube | [default to 5]
11
+ **parent_id** | **String** | Parent job id (if applicable) | [optional]
12
+ **timeout** | **Integer** | Timeout to run | [optional]
13
+ **run_on_timeout** | **BOOLEAN** | Execute job after timeout | [optional] [default to false]
14
+ **limit** | **Integer** | Number of children | [optional]
15
+
16
+
data/docs/StatsInfo.md ADDED
@@ -0,0 +1,9 @@
1
+ # Allq::StatsInfo
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tube_name** | **String** | Name of tube |
7
+ **info** | [**StatsTube**](StatsTube.md) | |
8
+
9
+
@@ -0,0 +1,10 @@
1
+ # Allq::StatsResults
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **server_name** | **String** | ID of server |
7
+ **stats** | [**Array<StatsTube>**](StatsTube.md) | Array of server instances |
8
+ **action_count** | **Integer** | Total actions taken on server |
9
+
10
+
data/docs/StatsTube.md ADDED
@@ -0,0 +1,14 @@
1
+ # Allq::StatsTube
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **ready** | **Integer** | Count of ready jobs | [default to 0]
7
+ **delayed** | **Integer** | Count of delayed jobs | [default to 0]
8
+ **reserved** | **Integer** | Count of reserved jobs | [default to 0]
9
+ **buried** | **Integer** | Count of buried jobs | [default to 0]
10
+ **parents** | **Integer** | Count of parent jobs | [default to 0]
11
+ **throttle_size** | **Integer** | TPS of throttle | [optional]
12
+ **tube** | **String** | Name of tube |
13
+
14
+
data/docs/Throttle.md ADDED
@@ -0,0 +1,9 @@
1
+ # Allq::Throttle
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tube** | **String** | Name of tube | [default to "default"]
7
+ **tps** | **Integer** | Transactions per second | [default to 1000]
8
+
9
+
data/docs/TubeRef.md ADDED
@@ -0,0 +1,8 @@
1
+ # Allq::TubeRef
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tube** | **String** | Name of tube |
7
+
8
+
data/git_push.sh ADDED
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id=""
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id=""
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note=""
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,52 @@
1
+ =begin
2
+ #AllQ
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'allq_client/api_client'
15
+ require 'allq_client/api_error'
16
+ require 'allq_client/version'
17
+ require 'allq_client/configuration'
18
+
19
+ # Models
20
+ require 'allq_client/models/basic_payload'
21
+ require 'allq_client/models/basic_response'
22
+ require 'allq_client/models/job_ref'
23
+ require 'allq_client/models/job_response'
24
+ require 'allq_client/models/new_job'
25
+ require 'allq_client/models/new_parent_job'
26
+ require 'allq_client/models/stats_info'
27
+ require 'allq_client/models/stats_results'
28
+ require 'allq_client/models/stats_tube'
29
+ require 'allq_client/models/throttle'
30
+ require 'allq_client/models/tube_ref'
31
+
32
+ # APIs
33
+ require 'allq_client/api/actions_api'
34
+ require 'allq_client/api/admin_api'
35
+
36
+ module Allq
37
+ class << self
38
+ # Customize default settings for the SDK using block.
39
+ # Allq.configure do |config|
40
+ # config.username = "xxx"
41
+ # config.password = "xxx"
42
+ # end
43
+ # If no block given, return the default Configuration object.
44
+ def configure
45
+ if block_given?
46
+ yield(Configuration.default)
47
+ else
48
+ Configuration.default
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,642 @@
1
+ =begin
2
+ #AllQ
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module Allq
16
+ class ActionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Bury
24
+ # Bury Job
25
+ # @param job_id Job ID
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [BasicResponse]
28
+ def bury_put(job_id, opts = {})
29
+ data, _status_code, _headers = bury_put_with_http_info(job_id, opts)
30
+ return data
31
+ end
32
+
33
+ # Bury
34
+ # Bury Job
35
+ # @param job_id Job ID
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
38
+ def bury_put_with_http_info(job_id, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug "Calling API: ActionsApi.bury_put ..."
41
+ end
42
+ # verify the required parameter 'job_id' is set
43
+ if @api_client.config.client_side_validation && job_id.nil?
44
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.bury_put"
45
+ end
46
+ # resource path
47
+ local_var_path = "/bury"
48
+
49
+ # query parameters
50
+ query_params = {}
51
+ query_params[:'job_id'] = job_id
52
+
53
+ # header parameters
54
+ header_params = {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+ # HTTP header 'Content-Type'
58
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = {}
62
+
63
+ # http body (model)
64
+ post_body = nil
65
+ auth_names = []
66
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'BasicResponse')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: ActionsApi#bury_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Delete
80
+ # Finished Job
81
+ # @param job_id Job ID
82
+ # @param [Hash] opts the optional parameters
83
+ # @option opts [String] :tube Name of Tube (For deleting \&quot;ready\&quot; objects)
84
+ # @return [BasicResponse]
85
+ def job_delete(job_id, opts = {})
86
+ data, _status_code, _headers = job_delete_with_http_info(job_id, opts)
87
+ return data
88
+ end
89
+
90
+ # Delete
91
+ # Finished Job
92
+ # @param job_id Job ID
93
+ # @param [Hash] opts the optional parameters
94
+ # @option opts [String] :tube Name of Tube (For deleting \&quot;ready\&quot; objects)
95
+ # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
96
+ def job_delete_with_http_info(job_id, opts = {})
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug "Calling API: ActionsApi.job_delete ..."
99
+ end
100
+ # verify the required parameter 'job_id' is set
101
+ if @api_client.config.client_side_validation && job_id.nil?
102
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.job_delete"
103
+ end
104
+ # resource path
105
+ local_var_path = "/job"
106
+
107
+ # query parameters
108
+ query_params = {}
109
+ query_params[:'job_id'] = job_id
110
+ query_params[:'tube'] = opts[:'tube'] if !opts[:'tube'].nil?
111
+
112
+ # header parameters
113
+ header_params = {}
114
+ # HTTP header 'Accept' (if needed)
115
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
116
+ # HTTP header 'Content-Type'
117
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
118
+
119
+ # form parameters
120
+ form_params = {}
121
+
122
+ # http body (model)
123
+ post_body = nil
124
+ auth_names = []
125
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
126
+ :header_params => header_params,
127
+ :query_params => query_params,
128
+ :form_params => form_params,
129
+ :body => post_body,
130
+ :auth_names => auth_names,
131
+ :return_type => 'BasicResponse')
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug "API called: ActionsApi#job_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
134
+ end
135
+ return data, status_code, headers
136
+ end
137
+
138
+ # Job
139
+ # Get job from queue
140
+ # @param tube Name of tube
141
+ # @param [Hash] opts the optional parameters
142
+ # @return [JobResponse]
143
+ def job_get(tube, opts = {})
144
+ data, _status_code, _headers = job_get_with_http_info(tube, opts)
145
+ return data
146
+ end
147
+
148
+ # Job
149
+ # Get job from queue
150
+ # @param tube Name of tube
151
+ # @param [Hash] opts the optional parameters
152
+ # @return [Array<(JobResponse, Fixnum, Hash)>] JobResponse data, response status code and response headers
153
+ def job_get_with_http_info(tube, opts = {})
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "Calling API: ActionsApi.job_get ..."
156
+ end
157
+ # verify the required parameter 'tube' is set
158
+ if @api_client.config.client_side_validation && tube.nil?
159
+ fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.job_get"
160
+ end
161
+ # resource path
162
+ local_var_path = "/job"
163
+
164
+ # query parameters
165
+ query_params = {}
166
+ query_params[:'tube'] = tube
167
+
168
+ # header parameters
169
+ header_params = {}
170
+ # HTTP header 'Accept' (if needed)
171
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
172
+ # HTTP header 'Content-Type'
173
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
174
+
175
+ # form parameters
176
+ form_params = {}
177
+
178
+ # http body (model)
179
+ post_body = nil
180
+ auth_names = []
181
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
182
+ :header_params => header_params,
183
+ :query_params => query_params,
184
+ :form_params => form_params,
185
+ :body => post_body,
186
+ :auth_names => auth_names,
187
+ :return_type => 'JobResponse')
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug "API called: ActionsApi#job_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
+ end
191
+ return data, status_code, headers
192
+ end
193
+
194
+ # Job
195
+ # Put job into queue
196
+ # @param new_job New Job Object
197
+ # @param [Hash] opts the optional parameters
198
+ # @return [JobRef]
199
+ def job_post(new_job, opts = {})
200
+ data, _status_code, _headers = job_post_with_http_info(new_job, opts)
201
+ return data
202
+ end
203
+
204
+ # Job
205
+ # Put job into queue
206
+ # @param new_job New Job Object
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [Array<(JobRef, Fixnum, Hash)>] JobRef data, response status code and response headers
209
+ def job_post_with_http_info(new_job, opts = {})
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "Calling API: ActionsApi.job_post ..."
212
+ end
213
+ # verify the required parameter 'new_job' is set
214
+ if @api_client.config.client_side_validation && new_job.nil?
215
+ fail ArgumentError, "Missing the required parameter 'new_job' when calling ActionsApi.job_post"
216
+ end
217
+ # resource path
218
+ local_var_path = "/job"
219
+
220
+ # query parameters
221
+ query_params = {}
222
+
223
+ # header parameters
224
+ header_params = {}
225
+ # HTTP header 'Accept' (if needed)
226
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
227
+ # HTTP header 'Content-Type'
228
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
229
+
230
+ # form parameters
231
+ form_params = {}
232
+
233
+ # http body (model)
234
+ post_body = @api_client.object_to_http_body(new_job)
235
+ auth_names = []
236
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
237
+ :header_params => header_params,
238
+ :query_params => query_params,
239
+ :form_params => form_params,
240
+ :body => post_body,
241
+ :auth_names => auth_names,
242
+ :return_type => 'JobRef')
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug "API called: ActionsApi#job_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
245
+ end
246
+ return data, status_code, headers
247
+ end
248
+
249
+ # Parent Job
250
+ # Create a parent job
251
+ # @param new_parent_job New Parent Job Data
252
+ # @param [Hash] opts the optional parameters
253
+ # @return [JobRef]
254
+ def parent_job_post(new_parent_job, opts = {})
255
+ data, _status_code, _headers = parent_job_post_with_http_info(new_parent_job, opts)
256
+ return data
257
+ end
258
+
259
+ # Parent Job
260
+ # Create a parent job
261
+ # @param new_parent_job New Parent Job Data
262
+ # @param [Hash] opts the optional parameters
263
+ # @return [Array<(JobRef, Fixnum, Hash)>] JobRef data, response status code and response headers
264
+ def parent_job_post_with_http_info(new_parent_job, opts = {})
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug "Calling API: ActionsApi.parent_job_post ..."
267
+ end
268
+ # verify the required parameter 'new_parent_job' is set
269
+ if @api_client.config.client_side_validation && new_parent_job.nil?
270
+ fail ArgumentError, "Missing the required parameter 'new_parent_job' when calling ActionsApi.parent_job_post"
271
+ end
272
+ # resource path
273
+ local_var_path = "/parent_job"
274
+
275
+ # query parameters
276
+ query_params = {}
277
+
278
+ # header parameters
279
+ header_params = {}
280
+ # HTTP header 'Accept' (if needed)
281
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
282
+ # HTTP header 'Content-Type'
283
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
284
+
285
+ # form parameters
286
+ form_params = {}
287
+
288
+ # http body (model)
289
+ post_body = @api_client.object_to_http_body(new_parent_job)
290
+ auth_names = []
291
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
292
+ :header_params => header_params,
293
+ :query_params => query_params,
294
+ :form_params => form_params,
295
+ :body => post_body,
296
+ :auth_names => auth_names,
297
+ :return_type => 'JobRef')
298
+ if @api_client.config.debugging
299
+ @api_client.config.logger.debug "API called: ActionsApi#parent_job_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
300
+ end
301
+ return data, status_code, headers
302
+ end
303
+
304
+ # Peek
305
+ # Peek at next job
306
+ # @param tube Tube name
307
+ # @param [Hash] opts the optional parameters
308
+ # @option opts [String] :buried Look in buried (default to false)
309
+ # @return [JobResponse]
310
+ def peek_get(tube, opts = {})
311
+ data, _status_code, _headers = peek_get_with_http_info(tube, opts)
312
+ return data
313
+ end
314
+
315
+ # Peek
316
+ # Peek at next job
317
+ # @param tube Tube name
318
+ # @param [Hash] opts the optional parameters
319
+ # @option opts [String] :buried Look in buried
320
+ # @return [Array<(JobResponse, Fixnum, Hash)>] JobResponse data, response status code and response headers
321
+ def peek_get_with_http_info(tube, opts = {})
322
+ if @api_client.config.debugging
323
+ @api_client.config.logger.debug "Calling API: ActionsApi.peek_get ..."
324
+ end
325
+ # verify the required parameter 'tube' is set
326
+ if @api_client.config.client_side_validation && tube.nil?
327
+ fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.peek_get"
328
+ end
329
+ # resource path
330
+ local_var_path = "/peek"
331
+
332
+ # query parameters
333
+ query_params = {}
334
+ query_params[:'tube'] = tube
335
+ query_params[:'buried'] = opts[:'buried'] if !opts[:'buried'].nil?
336
+
337
+ # header parameters
338
+ header_params = {}
339
+ # HTTP header 'Accept' (if needed)
340
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
341
+ # HTTP header 'Content-Type'
342
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
343
+
344
+ # form parameters
345
+ form_params = {}
346
+
347
+ # http body (model)
348
+ post_body = nil
349
+ auth_names = []
350
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
351
+ :header_params => header_params,
352
+ :query_params => query_params,
353
+ :form_params => form_params,
354
+ :body => post_body,
355
+ :auth_names => auth_names,
356
+ :return_type => 'JobResponse')
357
+ if @api_client.config.debugging
358
+ @api_client.config.logger.debug "API called: ActionsApi#peek_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
359
+ end
360
+ return data, status_code, headers
361
+ end
362
+
363
+ # Release
364
+ # Releases job back into queue
365
+ # @param job_id Job ID
366
+ # @param [Hash] opts the optional parameters
367
+ # @return [BasicResponse]
368
+ def release_put(job_id, opts = {})
369
+ data, _status_code, _headers = release_put_with_http_info(job_id, opts)
370
+ return data
371
+ end
372
+
373
+ # Release
374
+ # Releases job back into queue
375
+ # @param job_id Job ID
376
+ # @param [Hash] opts the optional parameters
377
+ # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
378
+ def release_put_with_http_info(job_id, opts = {})
379
+ if @api_client.config.debugging
380
+ @api_client.config.logger.debug "Calling API: ActionsApi.release_put ..."
381
+ end
382
+ # verify the required parameter 'job_id' is set
383
+ if @api_client.config.client_side_validation && job_id.nil?
384
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.release_put"
385
+ end
386
+ # resource path
387
+ local_var_path = "/release"
388
+
389
+ # query parameters
390
+ query_params = {}
391
+ query_params[:'job_id'] = job_id
392
+
393
+ # header parameters
394
+ header_params = {}
395
+ # HTTP header 'Accept' (if needed)
396
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
397
+ # HTTP header 'Content-Type'
398
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
399
+
400
+ # form parameters
401
+ form_params = {}
402
+
403
+ # http body (model)
404
+ post_body = nil
405
+ auth_names = []
406
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
407
+ :header_params => header_params,
408
+ :query_params => query_params,
409
+ :form_params => form_params,
410
+ :body => post_body,
411
+ :auth_names => auth_names,
412
+ :return_type => 'BasicResponse')
413
+ if @api_client.config.debugging
414
+ @api_client.config.logger.debug "API called: ActionsApi#release_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
415
+ end
416
+ return data, status_code, headers
417
+ end
418
+
419
+ # Set Children Started
420
+ # When a parent job doesn't know how many children are going to be added, this is the event that sets the final children count on the parent_job, allowing it to run when the children are done.
421
+ # @param job_id Job ID
422
+ # @param [Hash] opts the optional parameters
423
+ # @return [BasicResponse]
424
+ def set_children_started_put(job_id, opts = {})
425
+ data, _status_code, _headers = set_children_started_put_with_http_info(job_id, opts)
426
+ return data
427
+ end
428
+
429
+ # Set Children Started
430
+ # When a parent job doesn&#39;t know how many children are going to be added, this is the event that sets the final children count on the parent_job, allowing it to run when the children are done.
431
+ # @param job_id Job ID
432
+ # @param [Hash] opts the optional parameters
433
+ # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
434
+ def set_children_started_put_with_http_info(job_id, opts = {})
435
+ if @api_client.config.debugging
436
+ @api_client.config.logger.debug "Calling API: ActionsApi.set_children_started_put ..."
437
+ end
438
+ # verify the required parameter 'job_id' is set
439
+ if @api_client.config.client_side_validation && job_id.nil?
440
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.set_children_started_put"
441
+ end
442
+ # resource path
443
+ local_var_path = "/set_children_started"
444
+
445
+ # query parameters
446
+ query_params = {}
447
+ query_params[:'job_id'] = job_id
448
+
449
+ # header parameters
450
+ header_params = {}
451
+ # HTTP header 'Accept' (if needed)
452
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
453
+ # HTTP header 'Content-Type'
454
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
455
+
456
+ # form parameters
457
+ form_params = {}
458
+
459
+ # http body (model)
460
+ post_body = nil
461
+ auth_names = []
462
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
463
+ :header_params => header_params,
464
+ :query_params => query_params,
465
+ :form_params => form_params,
466
+ :body => post_body,
467
+ :auth_names => auth_names,
468
+ :return_type => 'BasicResponse')
469
+ if @api_client.config.debugging
470
+ @api_client.config.logger.debug "API called: ActionsApi#set_children_started_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
471
+ end
472
+ return data, status_code, headers
473
+ end
474
+
475
+ # Throttle
476
+ # Creates a throttle on a tube
477
+ # @param throttle Throttle info
478
+ # @param [Hash] opts the optional parameters
479
+ # @return [TubeRef]
480
+ def throttle_post(throttle, opts = {})
481
+ data, _status_code, _headers = throttle_post_with_http_info(throttle, opts)
482
+ return data
483
+ end
484
+
485
+ # Throttle
486
+ # Creates a throttle on a tube
487
+ # @param throttle Throttle info
488
+ # @param [Hash] opts the optional parameters
489
+ # @return [Array<(TubeRef, Fixnum, Hash)>] TubeRef data, response status code and response headers
490
+ def throttle_post_with_http_info(throttle, opts = {})
491
+ if @api_client.config.debugging
492
+ @api_client.config.logger.debug "Calling API: ActionsApi.throttle_post ..."
493
+ end
494
+ # verify the required parameter 'throttle' is set
495
+ if @api_client.config.client_side_validation && throttle.nil?
496
+ fail ArgumentError, "Missing the required parameter 'throttle' when calling ActionsApi.throttle_post"
497
+ end
498
+ # resource path
499
+ local_var_path = "/throttle"
500
+
501
+ # query parameters
502
+ query_params = {}
503
+
504
+ # header parameters
505
+ header_params = {}
506
+ # HTTP header 'Accept' (if needed)
507
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
508
+ # HTTP header 'Content-Type'
509
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
510
+
511
+ # form parameters
512
+ form_params = {}
513
+
514
+ # http body (model)
515
+ post_body = @api_client.object_to_http_body(throttle)
516
+ auth_names = []
517
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
518
+ :header_params => header_params,
519
+ :query_params => query_params,
520
+ :form_params => form_params,
521
+ :body => post_body,
522
+ :auth_names => auth_names,
523
+ :return_type => 'TubeRef')
524
+ if @api_client.config.debugging
525
+ @api_client.config.logger.debug "API called: ActionsApi#throttle_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
526
+ end
527
+ return data, status_code, headers
528
+ end
529
+
530
+ # Touch
531
+ # Touch job
532
+ # @param job_id Job ID
533
+ # @param [Hash] opts the optional parameters
534
+ # @return [BasicResponse]
535
+ def touch_put(job_id, opts = {})
536
+ data, _status_code, _headers = touch_put_with_http_info(job_id, opts)
537
+ return data
538
+ end
539
+
540
+ # Touch
541
+ # Touch job
542
+ # @param job_id Job ID
543
+ # @param [Hash] opts the optional parameters
544
+ # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
545
+ def touch_put_with_http_info(job_id, opts = {})
546
+ if @api_client.config.debugging
547
+ @api_client.config.logger.debug "Calling API: ActionsApi.touch_put ..."
548
+ end
549
+ # verify the required parameter 'job_id' is set
550
+ if @api_client.config.client_side_validation && job_id.nil?
551
+ fail ArgumentError, "Missing the required parameter 'job_id' when calling ActionsApi.touch_put"
552
+ end
553
+ # resource path
554
+ local_var_path = "/touch"
555
+
556
+ # query parameters
557
+ query_params = {}
558
+ query_params[:'job_id'] = job_id
559
+
560
+ # header parameters
561
+ header_params = {}
562
+ # HTTP header 'Accept' (if needed)
563
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
564
+ # HTTP header 'Content-Type'
565
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
566
+
567
+ # form parameters
568
+ form_params = {}
569
+
570
+ # http body (model)
571
+ post_body = nil
572
+ auth_names = []
573
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
574
+ :header_params => header_params,
575
+ :query_params => query_params,
576
+ :form_params => form_params,
577
+ :body => post_body,
578
+ :auth_names => auth_names,
579
+ :return_type => 'BasicResponse')
580
+ if @api_client.config.debugging
581
+ @api_client.config.logger.debug "API called: ActionsApi#touch_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
582
+ end
583
+ return data, status_code, headers
584
+ end
585
+
586
+ # Clear Tube
587
+ # Delete all contents of tube
588
+ # @param tube Tube Name
589
+ # @param [Hash] opts the optional parameters
590
+ # @return [BasicResponse]
591
+ def tube_delete(tube, opts = {})
592
+ data, _status_code, _headers = tube_delete_with_http_info(tube, opts)
593
+ return data
594
+ end
595
+
596
+ # Clear Tube
597
+ # Delete all contents of tube
598
+ # @param tube Tube Name
599
+ # @param [Hash] opts the optional parameters
600
+ # @return [Array<(BasicResponse, Fixnum, Hash)>] BasicResponse data, response status code and response headers
601
+ def tube_delete_with_http_info(tube, opts = {})
602
+ if @api_client.config.debugging
603
+ @api_client.config.logger.debug "Calling API: ActionsApi.tube_delete ..."
604
+ end
605
+ # verify the required parameter 'tube' is set
606
+ if @api_client.config.client_side_validation && tube.nil?
607
+ fail ArgumentError, "Missing the required parameter 'tube' when calling ActionsApi.tube_delete"
608
+ end
609
+ # resource path
610
+ local_var_path = "/tube"
611
+
612
+ # query parameters
613
+ query_params = {}
614
+ query_params[:'tube'] = tube
615
+
616
+ # header parameters
617
+ header_params = {}
618
+ # HTTP header 'Accept' (if needed)
619
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
620
+ # HTTP header 'Content-Type'
621
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
622
+
623
+ # form parameters
624
+ form_params = {}
625
+
626
+ # http body (model)
627
+ post_body = nil
628
+ auth_names = []
629
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
630
+ :header_params => header_params,
631
+ :query_params => query_params,
632
+ :form_params => form_params,
633
+ :body => post_body,
634
+ :auth_names => auth_names,
635
+ :return_type => 'BasicResponse')
636
+ if @api_client.config.debugging
637
+ @api_client.config.logger.debug "API called: ActionsApi#tube_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
638
+ end
639
+ return data, status_code, headers
640
+ end
641
+ end
642
+ end