]>
git.proxmox.com Git - pve-manager.git/blob - PVE/API2/Ceph/Cfg.pm
1 package PVE
::API2
::Ceph
::Cfg
;
7 use PVE
::JSONSchema
qw(get_standard_option);
9 use PVE
::Tools
qw(file_get_contents);
11 use base
qw(PVE::RESTHandler);
13 __PACKAGE__-
>register_method ({
17 description
=> "Directory index.",
18 permissions
=> { user
=> 'all' },
20 check
=> ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any
=> 1],
23 additionalProperties
=> 0,
25 node
=> get_standard_option
('pve-node'),
34 links
=> [ { rel
=> 'child', href
=> "{name}" } ],
47 __PACKAGE__-
>register_method ({
53 check
=> ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any
=> 1],
55 description
=> "Get the Ceph configuration file.",
57 additionalProperties
=> 0,
59 node
=> get_standard_option
('pve-node'),
62 returns
=> { type
=> 'string' },
66 PVE
::Ceph
::Tools
::check_ceph_inited
();
68 my $path = PVE
::Ceph
::Tools
::get_config
('pve_ceph_cfgpath');
69 return file_get_contents
($path);
73 __PACKAGE__-
>register_method ({
80 check
=> ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any
=> 1],
82 description
=> "Get the Ceph configuration database.",
84 additionalProperties
=> 0,
86 node
=> get_standard_option
('pve-node'),
94 section
=> { type
=> "string", },
95 name
=> { type
=> "string", },
96 value
=> { type
=> "string", },
97 level
=> { type
=> "string", },
98 'can_update_at_runtime' => { type
=> "boolean", },
99 mask
=> { type
=> "string" },
106 PVE
::Ceph
::Tools
::check_ceph_inited
();
108 my $rados = PVE
::RADOS-
>new();
109 my $res = $rados->mon_command( { prefix
=> 'config dump', format
=> 'json' });
110 foreach my $entry (@$res) {
111 $entry->{can_update_at_runtime
} = $entry->{can_update_at_runtime
}?
1 : 0; # JSON::true/false -> 1/0