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',
+ completion => \&PVE::AccessControl::complete_group,
+});
+
+register_standard_option('group-comment', { type => 'string', optional => 1 });
+
__PACKAGE__->register_method ({
name => 'index',
path => '',
items => {
type => "object",
properties => {
- groupid => { type => 'string' },
+ groupid => get_standard_option('group-id'),
+ comment => get_standard_option('group-comment'),
},
},
links => [ { rel => 'child', href => "{groupid}" } ],
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' },
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' },
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')
},
},
},
parameters => {
additionalProperties => 0,
properties => {
- groupid => {
- type => 'string' , format => 'pve-groupid',
- completion => \&PVE::AccessControl::complete_group,
- },
+ groupid => get_standard_option('group-id'),
}
},
returns => { type => 'null' },