[pve-devel] [PATCH manager v2 5/5] whitespace fix
Dominik Csapak
d.csapak at proxmox.com
Fri Jun 29 10:20:23 CEST 2018
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
PVE/API2/Tasks.pm | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/PVE/API2/Tasks.pm b/PVE/API2/Tasks.pm
index 1395b6b9..a5acb118 100644
--- a/PVE/API2/Tasks.pm
+++ b/PVE/API2/Tasks.pm
@@ -17,12 +17,12 @@ use PVE::AccessControl;
use base qw(PVE::RESTHandler);
__PACKAGE__->register_method({
- name => 'node_tasks',
- path => '',
+ name => 'node_tasks',
+ path => '',
method => 'GET',
- permissions => {
+ permissions => {
description => "List task associated with the current user, or all task the user has 'Sys.Audit' permissions on /nodes/<node> (the <node> the task runs on).",
- user => 'all'
+ user => 'all'
},
description => "Read task list for one node (finished tasks).",
proxyto => 'node',
@@ -111,7 +111,7 @@ __PACKAGE__->register_method({
return if $errors && $status && $status eq 'OK';
- return if $param->{vmid} && (!$task->{id} || $task->{id} ne $param->{vmid});
+ return if $param->{vmid} && (!$task->{id} || $task->{id} ne $param->{vmid});
return if $count++ < $start;
return if $limit <= 0;
@@ -125,13 +125,13 @@ __PACKAGE__->register_method({
}
};
- if (my $bw = File::ReadBackwards->new($filename)) {
+ if (my $bw = File::ReadBackwards->new($filename)) {
while (defined ($line = $bw->readline)) {
&$parse_line();
}
$bw->close();
}
- if (my $bw = File::ReadBackwards->new("$filename.1")) {
+ if (my $bw = File::ReadBackwards->new("$filename.1")) {
while (defined ($line = $bw->readline)) {
&$parse_line();
}
@@ -144,8 +144,8 @@ __PACKAGE__->register_method({
}});
__PACKAGE__->register_method({
- name => 'upid_index',
- path => '{upid}',
+ name => 'upid_index',
+ path => '{upid}',
method => 'GET',
description => '', # index helper
permissions => { user => 'all' },
@@ -174,13 +174,13 @@ __PACKAGE__->register_method({
}});
__PACKAGE__->register_method({
- name => 'stop_task',
- path => '{upid}',
+ name => 'stop_task',
+ path => '{upid}',
method => 'DELETE',
description => 'Stop a task.',
- permissions => {
+ permissions => {
description => "The user needs 'Sys.Modify' permissions on '/nodes/<node>' if the task does not belong to him.",
- user => 'all',
+ user => 'all',
},
protected => 1,
proxyto => 'node',
@@ -213,10 +213,10 @@ __PACKAGE__->register_method({
}});
__PACKAGE__->register_method({
- name => 'read_task_log',
- path => '{upid}/log',
+ name => 'read_task_log',
+ path => '{upid}/log',
method => 'GET',
- permissions => {
+ permissions => {
description => "The user needs 'Sys.Audit' permissions on '/nodes/<node>' if the task does not belong to him.",
user => 'all',
},
@@ -244,7 +244,7 @@ __PACKAGE__->register_method({
},
returns => {
type => 'array',
- items => {
+ items => {
type => "object",
properties => {
n => {
@@ -285,10 +285,10 @@ __PACKAGE__->register_method({
my $exit_status_cache = {};
__PACKAGE__->register_method({
- name => 'read_task_status',
- path => '{upid}/status',
+ name => 'read_task_status',
+ path => '{upid}/status',
method => 'GET',
- permissions => {
+ permissions => {
description => "The user needs 'Sys.Audit' permissions on '/nodes/<node>' if the task does not belong to him.",
user => 'all',
},
@@ -305,11 +305,11 @@ __PACKAGE__->register_method({
returns => {
type => "object",
properties => {
- pid => {
+ pid => {
type => 'integer'
},
- status => {
- type => 'string', enum => ['running', 'stopped'],
+ status => {
+ type => 'string', enum => ['running', 'stopped'],
},
},
},
@@ -338,7 +338,7 @@ __PACKAGE__->register_method({
if ($task->{status} eq 'stopped') {
if (!defined($exit_status_cache->{$task->{upid}})) {
- $exit_status_cache->{$task->{upid}} =
+ $exit_status_cache->{$task->{upid}} =
PVE::Tools::upid_read_status($task->{upid});
}
$task->{exitstatus} = $exit_status_cache->{$task->{upid}};
--
2.11.0
More information about the pve-devel
mailing list