File Coverage

blib/lib/IO/Iron/IronWorker/Api.pm
Criterion Covered Total %
statement 8 27 29.6
branch n/a
condition n/a
subroutine 5 24 20.8
pod 19 19 100.0
total 32 70 45.7


line stmt bran cond sub pod time code
1             package IO::Iron::IronWorker::Api;
2              
3             ## no critic (Documentation::RequirePodAtEnd)
4             ## no critic (Documentation::RequirePodSections)
5              
6 4     4   73 use 5.010_000;
  4         14  
7 4     4   20 use strict;
  4         8  
  4         88  
8 4     4   16 use warnings;
  4         20  
  4         119  
9              
10             # Global Creator
11       4     BEGIN {
12             # No exports.
13             }
14              
15             # Global Destructor
16       4     END {
17             }
18              
19             # ABSTRACT: IronWorker API reference for Perl Client Libraries!
20              
21             our $VERSION = '0.14'; # VERSION: generated by DZP::OurPkgVersion
22              
23             sub IRONWORKER_LIST_CODE_PACKAGES {
24             return {
25 0     0 1   'action_name' => 'IRONWORKER_LIST_CODE_PACKAGES',
26             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/codes',
27             'action' => 'GET',
28             'return' => 'LIST:codes',
29             'retry' => 0,
30             'require_body' => 0,
31             'paged' => 1,
32             'per_page' => 100,
33             'url_escape' => { '{Project ID}' => 1 },
34             'log_message' => '(project={Project ID}). Listed code packages.',
35             };
36             }
37              
38             sub IRONWORKER_UPLOAD_OR_UPDATE_A_CODE_PACKAGE {
39             return {
40 0     0 1   'action_name' => 'IRONWORKER_UPLOAD_OR_UPDATE_A_CODE_PACKAGE',
41             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/codes',
42             'action' => 'POST',
43             'return' => 'HASH',
44             'retry' => 1,
45             'require_body' => 1,
46             'request_fields' => {
47             'name' => 1,
48             'file' => 1,
49             'file_name' => 1,
50             'runtime' => 1,
51             'config' => 1,
52             'max_concurrency' => 1,
53             'retries' => 1,
54             'retries_delay' => 1
55             },
56             'url_escape' => { '{Project ID}' => 1 },
57             'content_type' => 'multipart',
58             'log_message' => '(project={Project ID}). Uploaded or updated a code package.',
59             };
60             }
61              
62             sub IRONWORKER_GET_INFO_ABOUT_A_CODE_PACKAGE {
63             return {
64 0     0 1   'action_name' => 'IRONWORKER_GET_INFO_ABOUT_A_CODE_PACKAGE',
65             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/codes/{Code ID}',
66             'action' => 'GET',
67             'return' => 'HASH',
68             'retry' => 1,
69             'require_body' => 0,
70             'url_escape' => { '{Project ID}' => 1, '{Code ID}' => 1 },
71             'log_message' => '(project={Project ID}, code={Code ID}). Got info about a code package.',
72             };
73             }
74              
75             sub IRONWORKER_DELETE_A_CODE_PACKAGE {
76             return {
77 0     0 1   'action_name' => 'IRONWORKER_DELETE_A_CODE_PACKAGE',
78             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/codes/{Code ID}',
79             'action' => 'DELETE',
80             'return' => 'MESSAGE',
81             'retry' => 1,
82             'require_body' => 0,
83             'url_escape' => { '{Project ID}' => 1, '{Code ID}' => 1 },
84             'log_message' => '(project={Project ID}, code={Code ID}). Deleted a code package.',
85             };
86             }
87              
88             sub IRONWORKER_DOWNLOAD_A_CODE_PACKAGE {
89             return {
90 0     0 1   'action_name' => 'IRONWORKER_DOWNLOAD_A_CODE_PACKAGE',
91             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/codes/{Code ID}/download',
92             'action' => 'GET',
93             'return' => 'BINARY',
94             'retry' => 1,
95             'require_body' => 0,
96             'url_params' => { 'revision' => 1 },
97             'url_escape' => { '{Project ID}' => 1, '{Code ID}' => 1 },
98             'log_message' => '(project={Project ID}, code={Code ID}). Downloaded a code package.',
99             };
100             }
101              
102             sub IRONWORKER_LIST_CODE_PACKAGE_REVISIONS {
103             return {
104 0     0 1   'action_name' => 'IRONWORKER_LIST_CODE_PACKAGE_REVISIONS',
105             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/codes/{Code ID}/revisions',
106             'action' => 'GET',
107             'return' => 'LIST:revisions',
108             'retry' => 1,
109             'require_body' => 0,
110             'paged' => 1,
111             'per_page' => 100,
112             'url_escape' => { '{Project ID}' => 1, '{Code ID}' => 1 },
113             'log_message' => '(project={Project ID}, code={Code ID}). Listed code package revisions.',
114             };
115             }
116              
117             sub IRONWORKER_LIST_TASKS {
118             return {
119 0     0 1   'action_name' => 'IRONWORKER_LIST_TASKS',
120             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks',
121             'action' => 'GET',
122             'return' => 'LIST:tasks',
123             'retry' => 1,
124             'require_body' => 0,
125             'paged' => 1,
126             'per_page' => 100,
127             'url_params' => {
128             'code_name' => 1,
129             'queued' => 1,
130             'running' => 1,
131             'complete' => 1,
132             'error' => 1,
133             'cancelled' => 1,
134             'killed' => 1,
135             'timeout' => 1,
136             'from_time' => 1,
137             'to_time' => 1
138             },
139             'url_escape' => { '{Project ID}' => 1, 'code_name' => 1 },
140             'log_message' => '(project={Project ID}). Listed tasks.',
141             };
142             }
143              
144             sub IRONWORKER_QUEUE_A_TASK {
145             return {
146 0     0 1   'action_name' => 'IRONWORKER_QUEUE_A_TASK',
147             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks',
148             'action' => 'POST',
149             'return' => 'HASH',
150             'retry' => 1,
151             'require_body' => 1,
152             'request_fields' => { 'tasks' => 1 },
153             'url_escape' => { '{Project ID}' => 1 },
154             'log_message' => '(project={Project ID}). Queued tasks.',
155             };
156             }
157              
158             sub IRONWORKER_QUEUE_A_TASK_FROM_A_WEBHOOK {
159             return {
160 0     0 1   'action_name' => 'IRONWORKER_QUEUE_A_TASK_FROM_A_WEBHOOK',
161             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks/webhook',
162             'action' => 'POST',
163             'return' => 'HASH',
164             'retry' => 1,
165             'require_body' => 1,
166             'url_params' => { 'code_name' => 1 },
167             'url_escape' => { '{Project ID}' => 1 },
168             'log_message' => '(project={Project ID}). Queued tasks.',
169             }; # Request body will be passed along as the payload for the task.
170             }
171              
172             sub IRONWORKER_GET_INFO_ABOUT_A_TASK {
173             return {
174 0     0 1   'action_name' => 'IRONWORKER_GET_INFO_ABOUT_A_TASK',
175             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks/{Task ID}',
176             'action' => 'GET',
177             'return' => 'HASH',
178             'retry' => 1,
179             'require_body' => 0,
180             'url_escape' => { '{Project ID}' => 1, '{Task ID}' => 1 },
181             'log_message' => '(project={Project ID}, code={Task ID}). Got info about a task.',
182             };
183             }
184              
185             sub IRONWORKER_GET_A_TASKS_LOG {
186             return {
187 0     0 1   'action_name' => 'IRONWORKER_GET_A_TASKS_LOG',
188             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks/{Task ID}/log',
189             'action' => 'GET',
190             'return' => 'PLAIN_TEXT',
191             'retry' => 1,
192             'require_body' => 0,
193             'url_escape' => { '{Project ID}' => 1, '{Task ID}' => 1 },
194             'log_message' => '(project={Project ID}, code={Task ID}). Got a task\'s log.',
195             }; # Return plain text, not JSON!
196             }
197              
198             sub IRONWORKER_CANCEL_A_TASK {
199             return {
200 0     0 1   'action_name' => 'IRONWORKER_CANCEL_A_TASK',
201             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks/{Task ID}/cancel',
202             'action' => 'POST',
203             'return' => 'MESSAGE',
204             'retry' => 1,
205             'require_body' => 0,
206             'url_escape' => { '{Project ID}' => 1, '{Task ID}' => 1, },
207             'log_message' => '(project={Project ID}, task={Task ID}). Cancelled a task.',
208             };
209             }
210              
211             sub IRONWORKER_SET_A_TASKS_PROGRESS {
212             return {
213 0     0 1   'action_name' => 'IRONWORKER_SET_A_TASKS_PROGRESS',
214             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks/{Task ID}/progress',
215             'action' => 'POST',
216             'return' => 'MESSAGE',
217             'retry' => 1,
218             'require_body' => 1,
219             'request_fields' => { 'percent' => 1, 'msg' => 1 },
220             'url_escape' => { '{Project ID}' => 1, '{Task ID}' => 1 },
221             'log_message' => '(project={Project ID}, code={Task ID}). Set task\'s progress.',
222             };
223             }
224              
225             sub IRONWORKER_RETRY_A_TASK {
226             return {
227 0     0 1   'action_name' => 'IRONWORKER_RETRY_A_TASK',
228             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/tasks/{Task ID}/retry',
229             'action' => 'POST',
230             'return' => 'MESSAGE',
231             'retry' => 1,
232             'require_body' => 1,
233             'request_fields' => { 'delay' => 1 },
234             'url_escape' => { '{Project ID}' => 1, '{Task ID}' => 1 },
235             'log_message' => '(project={Project ID}, code={Task ID}, delay={delay}). Task queued for retry.',
236             };
237             }
238              
239             sub IRONWORKER_LIST_SCHEDULED_TASKS {
240             return {
241 0     0 1   'action_name' => 'IRONWORKER_LIST_SCHEDULED_TASKS',
242             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/schedules',
243             'action' => 'GET',
244             'return' => 'LIST:schedules',
245             'retry' => 1,
246             'require_body' => 0,
247             'paged' => 1,
248             'per_page' => 100,
249             'url_escape' => { '{Project ID}' => 1 },
250             'log_message' => '(project={Project ID}). Listed scheduled tasks.',
251             };
252             }
253              
254             sub IRONWORKER_SCHEDULE_A_TASK {
255             return {
256 0     0 1   'action_name' => 'IRONWORKER_SCHEDULE_A_TASK',
257             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/schedules',
258             'action' => 'POST',
259             'return' => 'HASH',
260             'retry' => 1,
261             'require_body' => 1,
262             'request_fields' => { 'schedules' => 1 },
263             'url_escape' => { '{Project ID}' => 1 },
264             'log_message' => '(project={Project ID}). Scheduled task.',
265             };
266             }
267              
268             sub IRONWORKER_GET_INFO_ABOUT_A_SCHEDULED_TASK {
269             return {
270 0     0 1   'action_name' => 'IRONWORKER_GET_INFO_ABOUT_A_SCHEDULED_TASK',
271             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/schedules/{Schedule ID}',
272             'action' => 'GET',
273             'return' => 'HASH',
274             'retry' => 1,
275             'require_body' => 0,
276             'url_escape' => { '{Project ID}' => 1, '{Schedule ID}' => 1, },
277             'log_message' => '(project={Project ID}, schedule={Schedule ID}). Got info about scheduled task.',
278             };
279             }
280              
281             sub IRONWORKER_CANCEL_A_SCHEDULED_TASK {
282             return {
283 0     0 1   'action_name' => 'IRONWORKER_CANCEL_A_SCHEDULED_TASK',
284             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/schedules/{Schedule ID}/cancel',
285             'action' => 'POST',
286             'return' => 'MESSAGE',
287             'retry' => 1,
288             'require_body' => 0,
289             'url_escape' => { '{Project ID}' => 1, '{Schedule ID}' => 1, },
290             'log_message' => '(project={Project ID}, schedule={Schedule ID}). Canceled scheduled task.',
291             };
292             }
293              
294             sub IRONWORKER_LIST_OF_AVAILABLE_STACKS {
295             return {
296 0     0 1   'action_name' => 'IRONWORKER_LIST_OF_AVAILABLE_STACKS',
297             'href' => '{Protocol}://{Host}:{Port}/{API Version}/stacks',
298             'action' => 'GET',
299             'return' => 'LIST', # Return as JSON.
300             'retry' => 0,
301             'require_body' => 0,
302             'paged' => 0,
303             'url_escape' => {},
304             'log_message' => '(). Listed stacks.',
305             };
306             }
307              
308             1;
309              
310             __END__
311              
312             =pod
313              
314             =encoding UTF-8
315              
316             =head1 NAME
317              
318             IO::Iron::IronWorker::Api - IronWorker API reference for Perl Client Libraries!
319              
320             =head1 VERSION
321              
322             version 0.14
323              
324             =head1 SYNOPSIS
325              
326             This package is for internal use of IO::Iron::IronWorker::Client/Queue packages.
327              
328             =head1 DESCRIPTION
329              
330             =for stopwords IronWorker API Mikko Koivunalho
331              
332             =head1 SUBROUTINES/METHODS
333              
334             =head2 Code Packages
335              
336             =head3 IRONWORKER_LIST_CODE_PACKAGES
337              
338             /projects/{Project ID}/codes
339              
340             =head3 IRONWORKER_UPLOAD_OR_UPDATE_A_CODE_PACKAGE
341              
342             /projects/{Project ID}/codes
343              
344             =head3 IRONWORKER_GET_INFO_ABOUT_A_CODE_PACKAGE
345              
346             /projects/{Project ID}/codes/{Code ID}
347              
348             =head3 IRONWORKER_DELETE_A_CODE_PACKAGE
349              
350             /projects/{Project ID}/codes/{Code ID}
351              
352             =head3 IRONWORKER_DOWNLOAD_A_CODE_PACKAGE
353              
354             /projects/{Project ID}/codes/{Code ID}/download
355              
356             =head3 IRONWORKER_LIST_CODE_PACKAGE_REVISIONS
357              
358             /projects/{Project ID}/codes/{Code ID}/revisions
359              
360             =head2 Tasks
361              
362             =head3 IRONWORKER_LIST_TASKS
363              
364             /projects/{Project ID}/tasks
365              
366             =head3 IRONWORKER_QUEUE_A_TASK
367              
368             /projects/{Project ID}/tasks
369              
370             =head3 IRONWORKER_QUEUE_A_TASK_FROM_A_WEBHOOK
371              
372             /projects/{Project ID}/tasks/webhook
373              
374             =head3 IRONWORKER_GET_INFO_ABOUT_A_TASK
375              
376             /projects/{Project ID}/tasks/{Task ID}
377              
378             =head3 IRONWORKER_GET_A_TASKS_LOG
379              
380             /projects/{Project ID}/tasks/{Task ID}/log
381              
382             =head3 IRONWORKER_CANCEL_A_TASK
383              
384             /projects/{Project ID}/tasks/{Task ID}/cancel
385              
386             =head3 IRONWORKER_SET_A_TASKS_PROGRESS
387              
388             /projects/{Project ID}/tasks/{Task ID}/progress
389              
390             =head3 IRONWORKER_RETRY_A_TASK
391              
392             /projects/{Project ID}/tasks/{Task ID}/retry
393              
394             =head2 Scheduled Tasks
395              
396             =head3 IRONWORKER_LIST_SCHEDULED_TASKS
397              
398             /projects/{Project ID}/schedules
399              
400             =head3 IRONWORKER_SCHEDULE_A_TASK
401              
402             /projects/{Project ID}/tasks
403              
404             =head3 IRONWORKER_GET_INFO_ABOUT_A_SCHEDULED_TASK
405              
406             /projects/{Project ID}/schedules/{Schedule ID}
407              
408             =head3 IRONWORKER_CANCEL_A_SCHEDULED_TASK
409              
410             /projects/{Project ID}/schedules/{Schedule ID}/cancel
411              
412             =head2 Stacks
413              
414             =head3 IRONWORKER_LIST_OF_AVAILABLE_STACKS
415              
416             /stacks
417              
418             =head1 AUTHOR
419              
420             Mikko Koivunalho <mikko.koivunalho@iki.fi>
421              
422             =head1 BUGS
423              
424             Please report any bugs or feature requests to bug-io-iron@rt.cpan.org or through the web interface at:
425             http://rt.cpan.org/Public/Dist/Display.html?Name=IO-Iron
426              
427             =head1 COPYRIGHT AND LICENSE
428              
429             This software is copyright (c) 2023 by Mikko Koivunalho.
430              
431             This is free software; you can redistribute it and/or modify it under
432             the same terms as the Perl 5 programming language system itself.
433              
434             The full text of the license can be found in the
435             F<LICENSE> file included with this distribution.
436              
437             =cut