api/config update: indentation and whitespace fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -39,20 +39,20 @@ my $api_storage_config = sub {
|
|||||||
};
|
};
|
||||||
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'index',
|
name => 'index',
|
||||||
path => '',
|
path => '',
|
||||||
method => 'GET',
|
method => 'GET',
|
||||||
description => "Storage index.",
|
description => "Storage index.",
|
||||||
permissions => {
|
permissions => {
|
||||||
description => "Only list entries where you have 'Datastore.Audit' or 'Datastore.AllocateSpace' permissions on '/storage/<storage>'",
|
description => "Only list entries where you have 'Datastore.Audit' or 'Datastore.AllocateSpace' permissions on '/storage/<storage>'",
|
||||||
user => 'all',
|
user => 'all',
|
||||||
},
|
},
|
||||||
parameters => {
|
parameters => {
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
properties => {
|
properties => {
|
||||||
type => {
|
type => {
|
||||||
description => "Only list storage of specific type",
|
description => "Only list storage of specific type",
|
||||||
type => 'string',
|
type => 'string',
|
||||||
enum => $storage_type_enum,
|
enum => $storage_type_enum,
|
||||||
optional => 1,
|
optional => 1,
|
||||||
},
|
},
|
||||||
@ -90,15 +90,15 @@ __PACKAGE__->register_method ({
|
|||||||
}});
|
}});
|
||||||
|
|
||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'read',
|
name => 'read',
|
||||||
path => '{storage}',
|
path => '{storage}',
|
||||||
method => 'GET',
|
method => 'GET',
|
||||||
description => "Read storage configuration.",
|
description => "Read storage configuration.",
|
||||||
permissions => {
|
permissions => {
|
||||||
check => ['perm', '/storage/{storage}', ['Datastore.Allocate']],
|
check => ['perm', '/storage/{storage}', ['Datastore.Allocate']],
|
||||||
},
|
},
|
||||||
parameters => {
|
parameters => {
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
properties => {
|
properties => {
|
||||||
storage => get_standard_option('pve-storage-id'),
|
storage => get_standard_option('pve-storage-id'),
|
||||||
},
|
},
|
||||||
@ -115,10 +115,10 @@ __PACKAGE__->register_method ({
|
|||||||
__PACKAGE__->register_method ({
|
__PACKAGE__->register_method ({
|
||||||
name => 'create',
|
name => 'create',
|
||||||
protected => 1,
|
protected => 1,
|
||||||
path => '',
|
path => '',
|
||||||
method => 'POST',
|
method => 'POST',
|
||||||
description => "Create a new storage.",
|
description => "Create a new storage.",
|
||||||
permissions => {
|
permissions => {
|
||||||
check => ['perm', '/storage', ['Datastore.Allocate']],
|
check => ['perm', '/storage', ['Datastore.Allocate']],
|
||||||
},
|
},
|
||||||
parameters => PVE::Storage::Plugin->createSchema(),
|
parameters => PVE::Storage::Plugin->createSchema(),
|
||||||
@ -173,7 +173,7 @@ __PACKAGE__->register_method ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
PVE::Storage::write_config($cfg);
|
PVE::Storage::write_config($cfg);
|
||||||
|
|
||||||
}, "create storage failed");
|
}, "create storage failed");
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@ -185,7 +185,7 @@ __PACKAGE__->register_method ({
|
|||||||
path => '{storage}',
|
path => '{storage}',
|
||||||
method => 'PUT',
|
method => 'PUT',
|
||||||
description => "Update storage configuration.",
|
description => "Update storage configuration.",
|
||||||
permissions => {
|
permissions => {
|
||||||
check => ['perm', '/storage', ['Datastore.Allocate']],
|
check => ['perm', '/storage', ['Datastore.Allocate']],
|
||||||
},
|
},
|
||||||
parameters => PVE::Storage::Plugin->updateSchema(),
|
parameters => PVE::Storage::Plugin->updateSchema(),
|
||||||
@ -197,8 +197,7 @@ __PACKAGE__->register_method ({
|
|||||||
my $digest = extract_param($param, 'digest');
|
my $digest = extract_param($param, 'digest');
|
||||||
my $delete = extract_param($param, 'delete');
|
my $delete = extract_param($param, 'delete');
|
||||||
|
|
||||||
PVE::Storage::lock_storage_config(
|
PVE::Storage::lock_storage_config(sub {
|
||||||
sub {
|
|
||||||
|
|
||||||
my $cfg = PVE::Storage::config();
|
my $cfg = PVE::Storage::config();
|
||||||
|
|
||||||
@ -228,7 +227,7 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
PVE::Storage::write_config($cfg);
|
PVE::Storage::write_config($cfg);
|
||||||
|
|
||||||
}, "update storage failed");
|
}, "update storage failed");
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}});
|
}});
|
||||||
@ -239,12 +238,12 @@ __PACKAGE__->register_method ({
|
|||||||
path => '{storage}', # /storage/config/{storage}
|
path => '{storage}', # /storage/config/{storage}
|
||||||
method => 'DELETE',
|
method => 'DELETE',
|
||||||
description => "Delete storage configuration.",
|
description => "Delete storage configuration.",
|
||||||
permissions => {
|
permissions => {
|
||||||
check => ['perm', '/storage', ['Datastore.Allocate']],
|
check => ['perm', '/storage', ['Datastore.Allocate']],
|
||||||
},
|
},
|
||||||
parameters => {
|
parameters => {
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
properties => {
|
properties => {
|
||||||
storage => get_standard_option('pve-storage-id', {
|
storage => get_standard_option('pve-storage-id', {
|
||||||
completion => \&PVE::Storage::complete_storage,
|
completion => \&PVE::Storage::complete_storage,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user