Commit Graph

66 Commits

Author SHA1 Message Date
Hannes Laimer
ac53f1f76c api: cluster/resources: add 'name' property to return schema
VM names are returned by the endpoint anyway, therefore it makes sense
to add it to the endpoint specification so it also appears in the API
docs and is visible when using pvesh with text output.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 11:52:09 +02:00
Thomas Lamprecht
d52b1535cd api: cluster: add backupinfo to subdirectories
to make it actually show up in auto-completion and some docs..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 11:51:18 +02:00
Thomas Lamprecht
424c94fee8 api: resources: only get guest lock after real access check
The guest iteration is slightly confusing as we also handle the
accumulated pool settings there, so we only check the VM.Audit privs.
for a specific VM and skip to the next if the permissions is not
there after those pool handling.

So, move operations which are only required when VM privs. are there
below this check.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:45:01 +02:00
Thomas Lamprecht
ab8ed6f4b0 api: resources: push guest, pool and sdn info sorted
makes it easier to compare in API responses, and those list are not
huge, seldom over a few thousands, which is peanut crumbs compared to
all the other thing in this perl stack.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-15 19:35:31 +02:00
Thomas Lamprecht
77a9ce3248 api: resources: return plugin type
The storage one for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-24 23:01:54 +01:00
Fabian Ebner
74c8984dfc cluster resources: include content type for storages
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-11-22 18:39:16 +01:00
Thomas Lamprecht
d57f8d9482 ui/api: metrics: move server to subpath, post to path with ID
We actually wanted to use that scheme for more new API paths, lets
see if it is really fitting starting with this.

Use the new widget-toolkit submitUrl helper to add the ID on create.

And unify the edit/create window creation, which may fit better in a
separate commit, it's quite small and was to cumbersome to untangle,
so just go against my one rules here... :(

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:53:05 +01:00
Thomas Lamprecht
9dedf1e2d5 api: drop Config from MetricServer module name
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:39:33 +01:00
Dominik Csapak
19e3a7f2a4 api2/cluster: add 'metricserver' api endpoints
modeled after our typical api endpoints for sectionschema configs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-11-21 20:39:33 +01:00
Aaron Lauterer
f26c7b54e0 fix #2609 api: backupinfo: add non job specific endpoint
Adds a new api endpoint at cluster/backupinfo for cluster wide backup
stuff. This is necessary because cluster/backup expects a backup job ID
at the next level and thus other endpoints are hard to impossible to
implement under that hierarchy.

The only api endpoint available for now is the `not_backed_up` which
returns a list of all guests which are not covered by any backup job.

The top level index endpoint is left unsused for now to be available for
a more generic summary endpoint in the future.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-07-09 14:12:59 +02:00
Alexandre Derumier
9afcbd26b2 api : cluster resources: add sdn audit permission
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-06-15 15:35:30 +02:00
Fabian Grünbichler
838470846c acme plugins: improve API
add checks, encoding of loaded data files, update API path, proper inclusion into API tree

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Wolfgang Link
b227e9d2ab Create ACME Plugin config.
With this configuration it is possible to use many different plugins
with different providers and users.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
a901f94a2c api/tasks: attribute token tasks to user
and store token ID in separate, currently unused member.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-01-29 10:28:16 +01:00
Thomas Lamprecht
06855f1264 followup: IP in capital & what the node IP is
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-09 18:18:47 +01:00
Tim Marx
122020b195 api: prevent null as return value for property type string
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-12-09 18:16:23 +01:00
Tim Marx
e9b2e291c8 api: update cluster status return properties
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-12-09 18:16:23 +01:00
Tim Marx
cd8d0de269 whitespace cleanup
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-12-09 18:16:23 +01:00
Fabian Grünbichler
3ac3653e63 use PVE::DataCenterConfig
to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Thomas Lamprecht
eb5cc90892 follouwp whitespace/indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-09-03 10:31:14 +02:00
Alexandre Derumier
afc237df4e api : cluster ressources : add sdn
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-09-03 10:28:55 +02:00
Alexandre Derumier
f0f63a1cb2 api2 : cluster: add sdn api endpoint
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-09-03 10:28:55 +02:00
Thomas Lamprecht
78ad23f8f0 api/cluster: move ceph calls into sub- directory/module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-23 15:28:18 +02:00
Thomas Lamprecht
a35f2afff4 cluster api: group and sort module use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-23 15:24:58 +02:00
Thomas Lamprecht
7618913027 perl: fix some common typos found with codespell
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-15 10:40:20 +02:00
Thomas Lamprecht
f79372c0dc api: cluster/resources: add information about guest locks
using the new get_guest_config_property helper from pve-cluster,
which allows us to get this info with relatively low overhead.

With a somewhat realistic setup of 303 guest configurations here my
API call timing changes from ~ 24 to 26 ms without this to 26 to 28
ms with this patch applied, which seems reasonable.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-13 11:11:38 +02:00
Dominik Csapak
46fb9c5017 ceph: a little luminous backwards compatibility
ceph luminous does not use the 'name' property in the metadata
everywhere, so fall back to 'id'

this makes the ceph dashboard usable while having still luminous
(relevant for upgrading)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-11 12:58:24 +02:00
Dominik Csapak
4e76dbd7b3 ceph: refactor broadcast_ceph_services and get_cluster_service
and use the broadcast when a service is added/removed
we will use 'get_cluster_service' in the future when we generate a list
of services of a specific type

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 14:56:24 +02:00
Dominik Csapak
6e251e550b add cluster wide ceph api calls
add two new api calls in /cluster/ceph

status:
the same as /nodes/NODE/ceph/status, but accessible without
nodename, which we don't need, as in the hyperconverged case, all nodes
have the ceph.conf which contains the info on how to connect to the
monitors

metadata:
combines data from the cluster filesystem about the services,
as well as the 'ceph YYY metadata' info we get from ceph.
with this info we can convieniently display which services exists,
which are running and which versions they have

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-27 16:17:20 +02:00
Fabian Grünbichler
e1c20e2a77 call cfs_update() before retrieving cluster status
otherwise this potentially returns outdated information (like the
cluster being quorate when corosync has crashed on all nodes 5 minutes
ago).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-04-18 09:44:11 +00:00
Thomas Lamprecht
57d56896c8 fix #263: only include node rrd stats if user has Sys.Audit
It makes sense to not give users without Sys.Audit permissions to
much information over a node and this is relatively easy and cheap to
check and enforce at those two points.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
2019-04-16 12:28:42 +00:00
Thomas Lamprecht
dd6b2e5742 remove unused libxml-parser-perl dependency
over from the time where corosync was still bnased on XML configs
(pre PVE 4.0). This was not used, and XML::Parser is not Export
based, so it does not pushes some methods into the using modules
namespace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-31 12:02:55 +01:00
Dominik Csapak
47f8655333 fixe return values in /cluster/resources
openvz is deprecated but can still be a return value
maxcpu can be a real number (e.g., for CT if cpulimit is 1.5 and
cores is not set), and may not be an integer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-08-20 11:31:53 +02:00
Thomas Lamprecht
b66c604ef2 fixup: s/destriction/description/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-10 14:16:23 +02:00
Dietmar Maurer
fc6c0fddb2 PVE/API2/Cluster.pm - document return properties for cluster resource list.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-10 13:23:28 +02:00
Fabian Grünbichler
5c3fd6ace6 add ACME account API endpoints
for registering, updating, refreshing and deactiving a PVE-managed ACME
account, as well as for retrieving the (optional, but required if
available) terms of service of the ACME API provider / CA.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00
Thomas Lamprecht
8ad1127a16 fix #1578: api/resource hastate: fallback to resource cfg state
With ignored or still queued services we have no hastate for a
service in the manager status available.

As we use hastate in the web UI to determine if a service is
configured for HA this could lead to confusion there.
For example, the VM/CT 'Manage HA' window thinks tries to add the
service again if its in the 'ignored' state, and then the backend
errors out because it is already configured.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-28 15:59:58 +01:00
Dietmar Maurer
892821fd87 pvesr: add pve storage replication tool
Just added code to configure jobs. Replication itself is not
implemented.
2017-05-31 08:23:46 +02:00
Dominik Csapak
0c8d740228 fix diffstore issue with clusterlog
extjs cannot "convert" and id from other fields, so the ids in the
diffstore and the realstore are different and we re-add every element on
every update

to mitigate this, we generate the id (which is "uid:hostname") in the
backend, and simply use it in the frontend

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-03-10 11:09:46 +01:00
Dietmar Maurer
ac04fb558b plug new ClusterConfig API at /cluster/config 2016-11-29 12:08:39 +01:00
Dietmar Maurer
b67dc872ac code cleanup: avoid use of PVE::HA::Env (not necessary) 2016-10-28 09:32:35 +02:00
Dominik Csapak
c6e94f4224 add hastate to /cluster/resources api call
this adds a hastate field to all vms/ct which have ha enabled

we will use this for showing the error state in the tree (in the webgui)
and for the cluster dashboard (to count the error state guests)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-28 09:22:37 +02:00
Wolfgang Bumiller
c37f23f53b fix undefined value warning in resources api call
With the new calculation $pe->{maxcpu} was used before being
initialized to zero. Moving the initialization up.
Additionally setting $pe->{cpu} to $entry->{cpu} if maxcpu
is not set seems pointless as with its factor (maxcpu)
initialized to zero it is cancelled out anyway.
2016-07-07 08:15:15 +02:00
Dominik Csapak
ffe31eeacd fix #1030: calculate correct cpu usage of pools
we only added the % of the vms in a pool
which lead to wrong results
e.g. having a pool with 3 vms with 4 cores each and a
cpu usage of 50% each (2 cores at 100%)
lead to :

vm1	50%
vm2	50%
vm3	50%
pool	150%

instead we new calculate the percentage for the whole pool

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-07-01 11:10:37 +02:00
Wolfgang Bumiller
5301228562 fix a remote_node_ip calling context
Using remote_node_ip to build a hash needs to explicitly
request a scalar context.
2015-07-30 08:58:04 +02:00
Dietmar Maurer
91d7c7aa00 API change: /cluster/status - do not use clustat 2015-06-02 11:05:30 +02:00
Dietmar Maurer
c608873a5c GUI: add pool view 2014-08-13 08:06:18 +02:00
Dietmar Maurer
4a07fcedb7 depend on pve-firewall, connect firewall API 2014-05-06 12:43:41 +02:00
Dietmar Maurer
10cdf3ae1a fix bug 178: correctly verify if VMID is already used 2012-09-05 09:42:18 +02:00
Dietmar Maurer
16b69b6c3e add subscription status to datacenter summary 2012-03-26 10:39:10 +02:00