| 1 | package ArangoDB2::Admin; | ||||||||||
| 2 | |||||||||||
| 3 | 22 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 22 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 22 | ▶ | use base qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | ArangoDB2::Base | ||||||||||
| 8 | 22 | ); | |||||||||
| 9 | |||||||||||
| 10 | 22 | ▶ | use JSON::XS; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 22 | my $JSON = JSON::XS->new->utf8; | |||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | |||||||||||
| 16 | ############### | ||||||||||
| 17 | # API METHODS # | ||||||||||
| 18 | ############### | ||||||||||
| 19 | |||||||||||
| 20 | # echo | ||||||||||
| 21 | # | ||||||||||
| 22 | # GET /_admin/echo | ||||||||||
| 23 | sub echo | ||||||||||
| 24 | 0 | ▶ | { | ||||||||
|
Subroutine
echo: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 25 | 0 | my($self) = @_; | |||||||||
| 26 | # make request | ||||||||||
| 27 | 0 | return $self->arango->http->get('/_admin/echo'); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | # execute | ||||||||||
| 31 | # | ||||||||||
| 32 | # POST /_admin/execute | ||||||||||
| 33 | sub execute | ||||||||||
| 34 | 0 | ▶ | { | ||||||||
|
Subroutine
execute: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | 0 | my($self, $args) = @_; | |||||||||
| 36 | # process args | ||||||||||
| 37 | 0 | $args = $self->_build_args($args, ['program','returnAsJSON']); | |||||||||
| 38 | 0 | my $program = delete $args->{program}; | |||||||||
| 39 | # make request | ||||||||||
| 40 | 0 | return $self->arango->http->post( | |||||||||
| 41 | '/_admin/execute', | ||||||||||
| 42 | $args, | ||||||||||
| 43 | $program, | ||||||||||
| 44 | ); | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | # log | ||||||||||
| 48 | # | ||||||||||
| 49 | # GET /_admin/log | ||||||||||
| 50 | sub log | ||||||||||
| 51 | 0 | ▶ | { | ||||||||
|
Subroutine
log: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 52 | 0 | my($self, $args) = @_; | |||||||||
| 53 | # process args | ||||||||||
| 54 | 0 | $args = $self->_build_args($args, [qw( | |||||||||
| 55 | upto level start size offset search sort | ||||||||||
| 56 | )]); | ||||||||||
| 57 | # make request | ||||||||||
| 58 | 0 | return $self->arango->http->get('/_admin/log', $args); | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | # routingReload | ||||||||||
| 62 | # | ||||||||||
| 63 | # POST /_admin/routing/reload | ||||||||||
| 64 | sub routingReload | ||||||||||
| 65 | 0 | ▶ | { | ||||||||
|
Subroutine
routingReload: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 66 | 0 | my($self) = @_; | |||||||||
| 67 | # make request | ||||||||||
| 68 | 0 | return $self->arango->http->post('/_admin/routing/reload'); | |||||||||
| 69 | } | ||||||||||
| 70 | |||||||||||
| 71 | # serverRole | ||||||||||
| 72 | # | ||||||||||
| 73 | # GET /_admin/server/role | ||||||||||
| 74 | sub serverRole | ||||||||||
| 75 | 0 | ▶ | { | ||||||||
|
Subroutine
serverRole: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 76 | 0 | my($self) = @_; | |||||||||
| 77 | # make request | ||||||||||
| 78 | 0 | return $self->arango->http->get('/_admin/server/role'); | |||||||||
| 79 | } | ||||||||||
| 80 | |||||||||||
| 81 | # shutdown | ||||||||||
| 82 | # | ||||||||||
| 83 | # GET /_admin/shutdown | ||||||||||
| 84 | sub shutdown | ||||||||||
| 85 | 0 | ▶ | { | ||||||||
|
Subroutine
shutdown: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 86 | 0 | my($self) = @_; | |||||||||
| 87 | # make request | ||||||||||
| 88 | 0 | return $self->arango->http->get('/_admin/shutdown'); | |||||||||
| 89 | } | ||||||||||
| 90 | |||||||||||
| 91 | # statistics | ||||||||||
| 92 | # | ||||||||||
| 93 | # GET /_admin/statistics | ||||||||||
| 94 | sub statistics | ||||||||||
| 95 | 0 | ▶ | { | ||||||||
|
Subroutine
statistics: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 96 | 0 | my($self) = @_; | |||||||||
| 97 | # make request | ||||||||||
| 98 | 0 | return $self->arango->http->get('/_admin/statistics'); | |||||||||
| 99 | } | ||||||||||
| 100 | |||||||||||
| 101 | # statisticsDescription | ||||||||||
| 102 | # | ||||||||||
| 103 | # GET /_admin/statistics-description | ||||||||||
| 104 | sub statisticsDescription | ||||||||||
| 105 | 0 | ▶ | { | ||||||||
|
Subroutine
statisticsDescription: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 106 | 0 | my($self) = @_; | |||||||||
| 107 | # make request | ||||||||||
| 108 | 0 | return $self->arango->http->get('/_admin/statistics-description'); | |||||||||
| 109 | } | ||||||||||
| 110 | |||||||||||
| 111 | # test | ||||||||||
| 112 | # | ||||||||||
| 113 | # POST /_admin/test | ||||||||||
| 114 | sub test | ||||||||||
| 115 | 0 | ▶ | { | ||||||||
|
Subroutine
test: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 116 | 0 | my($self, $args) = @_; | |||||||||
| 117 | # process args | ||||||||||
| 118 | 0 | $args = $self->_build_args($args, ['tests']); | |||||||||
| 119 | # make request | ||||||||||
| 120 | 0 | return $self->arango->http->post('/_admin/test', $args->{tests}); | |||||||||
| 121 | } | ||||||||||
| 122 | |||||||||||
| 123 | # time | ||||||||||
| 124 | # | ||||||||||
| 125 | # GET /_admin/time | ||||||||||
| 126 | sub time | ||||||||||
| 127 | 0 | ▶ | { | ||||||||
|
Subroutine
time: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 128 | 0 | my($self) = @_; | |||||||||
| 129 | # make request | ||||||||||
| 130 | 0 | return $self->arango->http->get('/_admin/time'); | |||||||||
| 131 | } | ||||||||||
| 132 | |||||||||||
| 133 | # walFlush | ||||||||||
| 134 | # | ||||||||||
| 135 | # PUT /_admin/wal/flush | ||||||||||
| 136 | sub walFlush | ||||||||||
| 137 | 0 | ▶ | { | ||||||||
|
Subroutine
walFlush: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 138 | 0 | my($self, $args) = @_; | |||||||||
| 139 | # process args | ||||||||||
| 140 | 0 | $args = $self->_build_args($args, ['waitForSync', 'waitForCollector']); | |||||||||
| 141 | # make request | ||||||||||
| 142 | 0 | return $self->arango->http->put('/_admin/wal/flush', $args); | |||||||||
| 143 | } | ||||||||||
| 144 | |||||||||||
| 145 | # walProperties | ||||||||||
| 146 | # | ||||||||||
| 147 | # GET /_admin/wal/properties | ||||||||||
| 148 | # PUT /_admin/wal/properties | ||||||||||
| 149 | sub walProperties | ||||||||||
| 150 | 0 | ▶ | { | ||||||||
|
Subroutine
walProperties: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 151 | 0 | my($self, $args) = @_; | |||||||||
| 152 | # process args | ||||||||||
| 153 | 0 | $args = $self->_build_args($args, [qw( | |||||||||
| 154 | allowOversizeEntries logfileSize historicLogfiles | ||||||||||
| 155 | reserveLogfiles throttleWait throttleWhenPending | ||||||||||
| 156 | )]); | ||||||||||
| 157 | # request path | ||||||||||
| 158 | 0 | my $path = '/_admin/wal/properties'; | |||||||||
| 159 | # make request | ||||||||||
| 160 | 0 | ▶ | return $args | ||||||||
|
Branch: 1 branch
| |||||||||||
| 161 | ? $self->arango->http->put($path, undef, $JSON->encode($args)) | ||||||||||
| 162 | : $self->arango->http->get($path); | ||||||||||
| 163 | } | ||||||||||
| 164 | |||||||||||
| 165 | #################### | ||||||||||
| 166 | # PROPERTY METHODS # | ||||||||||
| 167 | #################### | ||||||||||
| 168 | |||||||||||
| 169 | 0 | ▶ | sub allowOversizeEntries { shift->_get_set_bool('allowOversizeEntries', @_) } | ||||||||
|
Subroutine
allowOversizeEntries: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 170 | 0 | ▶ | sub level { shift->_get_set('level', @_) } | ||||||||
|
Subroutine
level: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 171 | 0 | ▶ | sub logfileSize { shift->_get_set('logfileSize', @_) } | ||||||||
|
Subroutine
logfileSize: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 172 | 0 | ▶ | sub historicLogfiles { shift->_get_set('historicLogfiles', @_) } | ||||||||
|
Subroutine
historicLogfiles: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 173 | 0 | ▶ | sub offset { shift->_get_set('offset', @_) } | ||||||||
|
Subroutine
offset: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 174 | 0 | ▶ | sub program { shift->_get_set('program', @_) } | ||||||||
|
Subroutine
program: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 175 | 0 | ▶ | sub reserveLogfiles { shift->_get_set('reserveLogfiles', @_) } | ||||||||
|
Subroutine
reserveLogfiles: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 176 | 0 | ▶ | sub returnAsJSON { shift->_get_set_bool('returnAsJSON', @_) } | ||||||||
|
Subroutine
returnAsJSON: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 177 | 0 | ▶ | sub search { shift->_get_set('search', @_) } | ||||||||
|
Subroutine
search: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 178 | 0 | ▶ | sub size { shift->_get_set('size', @_) } | ||||||||
|
Subroutine
size: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 179 | 0 | ▶ | sub sort { shift->_get_set('sort', @_) } | ||||||||
|
Subroutine
sort: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 180 | 0 | ▶ | sub start { shift->_get_set('start', @_) } | ||||||||
|
Subroutine
start: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 181 | 0 | ▶ | sub tests { shift->_get_set('tests', @_) } | ||||||||
|
Subroutine
tests: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 182 | 0 | ▶ | sub throttleWait { shift->_get_set('throttleWait', @_) } | ||||||||
|
Subroutine
throttleWait: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 183 | 0 | ▶ | sub throttleWhenPending { shift->_get_set('throttleWhenPending', @_) } | ||||||||
|
Subroutine
throttleWhenPending: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 184 | 0 | ▶ | sub upto { shift->_get_set('upto', @_) } | ||||||||
|
Subroutine
upto: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 185 | 0 | ▶ | sub waitForCollector { shift->_get_set_bool('waitForCollector', @_) } | ||||||||
|
Subroutine
waitForCollector: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 186 | 0 | ▶ | sub waitForSync { shift->_get_set_bool('waitForSync', @_) } | ||||||||
|
Subroutine
waitForSync: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 187 | |||||||||||
| 188 | 22 | 1; | |||||||||
| 189 | |||||||||||
| 190 | __END__ | ||||||||||