X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=blobdiff_plain;f=PVE%2FAPI2%2FGroup.pm;h=1d6ba98bf605da4a3004bb9aae850358d1af7bd3;hp=fca8a2ae831d2043e420119562f66b2d51dc65a5;hb=bcf4eb3d4960aa2b3d1e63c482fc35b83bab2c0a;hpb=3e5bfdf60f255a432956ba0f77d6f840708d9619 diff --git a/PVE/API2/Group.pm b/PVE/API2/Group.pm index fca8a2a..1d6ba98 100644 --- a/PVE/API2/Group.pm +++ b/PVE/API2/Group.pm @@ -6,9 +6,19 @@ use PVE::Cluster qw (cfs_read_file cfs_write_file); use PVE::AccessControl; use PVE::SafeSyslog; use PVE::RESTHandler; +use PVE::JSONSchema qw(get_standard_option register_standard_option); use base qw(PVE::RESTHandler); +register_standard_option('group-id', { + type => 'string', + format => 'pve-groupid', + title => 'Group ID' , + completion => \&PVE::AccessControl::complete_group, +}); + +register_standard_option('group-comment', { type => 'string', optional => 1 }); + __PACKAGE__->register_method ({ name => 'index', path => '', @@ -27,7 +37,8 @@ __PACKAGE__->register_method ({ items => { type => "object", properties => { - groupid => { type => 'string' }, + groupid => get_standard_option('group-id'), + comment => get_standard_option('group-comment'), }, }, links => [ { rel => 'child', href => "{groupid}" } ], @@ -66,8 +77,8 @@ __PACKAGE__->register_method ({ parameters => { additionalProperties => 0, properties => { - groupid => { type => 'string', format => 'pve-groupid' }, - comment => { type => 'string', optional => 1 }, + groupid => get_standard_option('group-id'), + comment => get_standard_option('group-comment'), }, }, returns => { type => 'null' }, @@ -107,11 +118,8 @@ __PACKAGE__->register_method ({ parameters => { additionalProperties => 0, properties => { - groupid => { - type => 'string', format => 'pve-groupid', - completion => \&PVE::AccessControl::complete_group, - }, - comment => { type => 'string', optional => 1 }, + groupid => get_standard_option('group-id'), + comment => get_standard_option('group-comment'), }, }, returns => { type => 'null' }, @@ -149,19 +157,17 @@ __PACKAGE__->register_method ({ parameters => { additionalProperties => 0, properties => { - groupid => { type => 'string', format => 'pve-groupid' }, + groupid => get_standard_option('group-id'), }, }, returns => { type => "object", additionalProperties => 0, properties => { - comment => { type => 'string', optional => 1 }, + comment => get_standard_option('group-comment'), members => { type => 'array', - items => { - type => "string", - }, + items => get_standard_option('userid-completed') }, }, }, @@ -198,10 +204,7 @@ __PACKAGE__->register_method ({ parameters => { additionalProperties => 0, properties => { - groupid => { - type => 'string' , format => 'pve-groupid', - completion => \&PVE::AccessControl::complete_group, - }, + groupid => get_standard_option('group-id'), } }, returns => { type => 'null' },