File Coverage

blib/lib/IO/Iron/IronCache/Api.pm
Criterion Covered Total %
statement 8 16 50.0
branch n/a
condition n/a
subroutine 5 13 38.4
pod 8 8 100.0
total 21 37 56.7


line stmt bran cond sub pod time code
1             package IO::Iron::IronCache::Api;
2              
3             ## no critic (Documentation::RequirePodAtEnd)
4             ## no critic (Documentation::RequirePodSections)
5              
6 6     6   106 use 5.010_000;
  6         20  
7 6     6   80 use strict;
  6         22  
  6         157  
8 6     6   45 use warnings;
  6         11  
  6         148  
9              
10             # Global Creator
11       6     BEGIN {
12             }
13              
14             # Global Destructor
15       6     END {
16             }
17              
18             # ABSTRACT: IronCache API reference for Perl Client Libraries!
19              
20             our $VERSION = '0.14'; # VERSION: generated by DZP::OurPkgVersion
21              
22             sub IRONCACHE_LIST_CACHES {
23             return {
24 0     0 1   'action_name' => 'IRONCACHE_LIST_CACHES',
25             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches',
26             'action' => 'GET',
27             'return' => 'LIST',
28             'retry' => 0,
29             'require_body' => 0,
30             'paged' => 1,
31             'per_page' => 100,
32             'url_escape' => { '{Project ID}' => 1 },
33             'log_message' => '(project={Project ID}). Listed caches.',
34             };
35             }
36              
37             sub IRONCACHE_GET_INFO_ABOUT_A_CACHE {
38             return {
39 0     0 1   'action_name' => 'IRONCACHE_GET_INFO_ABOUT_A_CACHE',
40             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}',
41             'action' => 'GET',
42             'return' => 'HASH',
43             'retry' => 1,
44             'require_body' => 0,
45             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1 },
46             'log_message' => '(project={Project ID}, cache={Cache Name}). Got info about a cache.',
47             };
48             }
49              
50             sub IRONCACHE_DELETE_A_CACHE {
51             return {
52 0     0 1   'action_name' => 'IRONCACHE_DELETE_A_CACHE',
53             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}',
54             'action' => 'DELETE',
55             'return' => 'MESSAGE',
56             'retry' => 1,
57             'require_body' => 0,
58             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1 },
59             'log_message' => '(project={Project ID}, cache={Cache Name}). Deleted cache.',
60             };
61             }
62              
63             sub IRONCACHE_CLEAR_A_CACHE {
64             return {
65 0     0 1   'action_name' => 'IRONCACHE_CLEAR_A_CACHE',
66             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/clear',
67             'action' => 'POST',
68             'return' => 'MESSAGE',
69             'retry' => 0,
70             'require_body' => 0,
71             'paged' => 0,
72             'per_page' => 0,
73             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1 },
74             'log_message' => '(project={Project ID}, cache={Cache Name}). Cleared cache.',
75             };
76             }
77              
78             sub IRONCACHE_PUT_AN_ITEM_INTO_A_CACHE {
79             return {
80 0     0 1   'action_name' => 'IRONCACHE_PUT_AN_ITEM_INTO_A_CACHE',
81             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}',
82             'action' => 'PUT',
83             'return' => 'MESSAGE',
84             'retry' => 0,
85             'require_body' => 1,
86             'paged' => 0,
87             'per_page' => 0,
88             'request_fields' =>
89             { 'value' => '{Value}', 'expires_in' => '{Expires In}', 'replace' => '{Replace}', 'add' => '{Put}', 'cas' => '{Cas}' },
90             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
91             'log_message' =>
92             '(project={Project ID}, cache={Cache Name}, item={Key}). Put item into cache. Value: \'{Value}\', Expires in: \'{Expires In}\', Replace: \'{Replace}\', Put: \'{Put}\', Cas: \'{Cas}\'.',
93             };
94             }
95              
96             sub IRONCACHE_INCREMENT_AN_ITEMS_VALUE {
97             return {
98 0     0 1   'action_name' => 'IRONCACHE_INCREMENT_AN_ITEMS_VALUE',
99             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}/increment',
100             'action' => 'POST',
101             'return' => 'HASH',
102             'retry' => 0,
103             'require_body' => 1,
104             'paged' => 0,
105             'per_page' => 0,
106             'request_fields' => { 'amount' => '{Amount}' },
107             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
108             'log_message' => '(project={Project ID}, cache={Cache Name}, item={Key}). Incremented items value by \'{Amount}\'.',
109             };
110             }
111              
112             sub IRONCACHE_GET_AN_ITEM_FROM_A_CACHE {
113             return {
114 0     0 1   'action_name' => 'IRONCACHE_GET_AN_ITEM_FROM_A_CACHE',
115             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}',
116             'action' => 'GET',
117             'return' => 'HASH',
118             'retry' => 0,
119             'require_body' => 0,
120             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
121             'log_message' => '(project={Project ID}, cache={Cache Name}, item={Key}). Got item from cache.',
122             };
123             }
124              
125             sub IRONCACHE_DELETE_AN_ITEM_FROM_A_CACHE {
126             return {
127 0     0 1   'action_name' => 'IRONCACHE_DELETE_AN_ITEM_FROM_A_CACHE',
128             'href' => '{Protocol}://{Host}:{Port}/{API Version}/projects/{Project ID}/caches/{Cache Name}/items/{Key}',
129             'action' => 'DELETE',
130             'return' => 'MESSAGE',
131             'retry' => 0,
132             'require_body' => 0,
133             'url_escape' => { '{Project ID}' => 1, '{Cache Name}' => 1, '{Key}' => 1 },
134             'log_message' => '(project={Project ID}, cache={Cache Name}, item={Key}). Deleted item from cache.',
135             };
136             }
137              
138             1;
139              
140             __END__
141              
142             =pod
143              
144             =encoding UTF-8
145              
146             =head1 NAME
147              
148             IO::Iron::IronCache::Api - IronCache API reference for Perl Client Libraries!
149              
150             =head1 VERSION
151              
152             version 0.14
153              
154             =head1 SYNOPSIS
155              
156             This package is for internal use of IO::Iron::IronCache::Client/Cache packages.
157              
158             =head1 DESCRIPTION
159              
160             The APIs to IronCache REST services.
161              
162             =for stopwords IronCache API APIs Mikko Koivunalho perldoc CPAN AnnoCPAN
163              
164             =for stopwords ACKNOWLEDGMENTS TODO tradename licensable MERCHANTABILITY
165              
166             =head1 FUNCTIONS
167              
168             =head2 Operate caches.
169              
170             =head3 IRONCACHE_LIST_CACHES
171              
172             /projects/{Project ID}/caches
173              
174             =head3 IRONCACHE_GET_INFO_ABOUT_A_CACHE
175              
176             /projects/{Project ID}/caches/{Cache Name}
177              
178             =head3 IRONCACHE_DELETE_A_CACHE
179              
180             /projects/{Project ID}/caches/{Cache Name}
181              
182             =head2 Operate cache items.
183              
184             =head3 IRONCACHE_CLEAR_A_CACHE
185              
186             /projects/{Project ID}/caches/{Cache Name}/clear
187              
188             =head3 IRONCACHE_PUT_AN_ITEM_INTO_A_CACHE
189              
190             /projects/{Project ID}/caches/{Cache Name}/items/{Key}
191              
192             =head3 IRONCACHE_INCREMENT_AN_ITEMS_VALUE
193              
194             /projects/{Project ID}/caches/{Cache Name}/items/{Key}/increment
195              
196             =head3 IRONCACHE_GET_AN_ITEM_FROM_A_CACHE
197              
198             /projects/{Project ID}/caches/{Cache Name}/items/{Key}
199              
200             =head3 IRONCACHE_DELETE_AN_ITEM_FROM_A_CACHE
201              
202             /projects/{Project ID}/caches/{Cache Name}/items/{Key}
203              
204             =head1 AUTHOR
205              
206             Mikko Koivunalho <mikko.koivunalho@iki.fi>
207              
208             =head1 BUGS
209              
210             Please report any bugs or feature requests to bug-io-iron@rt.cpan.org or through the web interface at:
211             http://rt.cpan.org/Public/Dist/Display.html?Name=IO-Iron
212              
213             =head1 COPYRIGHT AND LICENSE
214              
215             This software is copyright (c) 2023 by Mikko Koivunalho.
216              
217             This is free software; you can redistribute it and/or modify it under
218             the same terms as the Perl 5 programming language system itself.
219              
220             The full text of the license can be found in the
221             F<LICENSE> file included with this distribution.
222              
223             =cut