Commit Graph

95 Commits

Author SHA1 Message Date
Thomas Lamprecht
9228d0b0aa followup: reword comment a bit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 243f413ad2)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-14 10:08:09 +02:00
Stefan Reiter
fcf1c57354 fix #1427: Set file mode on uploaded templates/ISOs
simply chmod the temp file before copying to the "correct" permission
mode, where all users with access to the directory can read the file,
to mirror the behavior one gets for a apl_download call.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
(cherry picked from commit 5c0720d6c9)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-14 10:08:03 +02:00
Thomas Lamprecht
37ab64f388 api/config update: indentation and whitespace fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 10:36:01 +02:00
Thomas Lamprecht
91f42b33a0 api/config update: only iterate over hash keys, not values
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 10:34:12 +02:00
Thomas Lamprecht
4273e3ace9 pvesm set: handle deletion of properties
the delete parameter get's injected by the SectionConfigs
updateSchem, but we need to handle it ourself in the code
This makes the following possible:

pvesm set STORAGEID --delete property

Also the API equivalent is now possible. Adapted from the HA
managers Resource update API call.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-14 16:24:34 +02:00
Christian Ebner
4af7713268 Status: Include command error in error message when storage activation fails
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-04-11 08:04:32 +02:00
Thomas Lamprecht
a2a04139da followup: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-10 10:15:42 +02:00
Dominic Jäger
b1f9d99017 Fix #318: Delete vzdump log when deleting a backup
Vzdump log files were not deleted when a backup was deleted.
Consequently, the folder continuously filled with .log files.
Now they get deleted after the backup is removed.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2019-04-10 10:10:44 +02:00
Dominik Csapak
a0965edde7 remove PVE/API2/Storage/Scan.pm
since those are now defined in pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-19 13:20:04 +01:00
Dominik Csapak
7963ba74bb move Scan API calls from PVE/API2/Storage/Scan.pm to pvesm.pm
since the calls for the real API are defined now in pve-managers Scan.pm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-11-19 13:20:04 +01:00
Thomas Lamprecht
a4bdab17bb fix #862: do not resolve portal adress on storage add
as described in #862:

> I experienced a problem with ISCSI portal when using a hostname and
> not IP.
> The GUI resolves the hostname to an IP and writes it to storage.cfg.
> As my setup requires hostnames, i needed to change the config
> manually back to the hostname which is working fine.
>
> Why is this conversion done? If I enter a hostname, i want to have a
> hostname. If i enter an IP address i want to have an IP address.

This makes sense to me, a feature of using domains is that they
are/should be resolved when actually using (i.e., connecting to them)
so resolving it once on add does not seems like a good idea (if I do
not miss something - as this is a classic "imported from SVN" I do
not have any rationale to look at).

So save the work and pass it as is.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-15 10:06:19 +01:00
Thomas Lamprecht
a298e55665 remove outdated unused API2::Storage::Replication module
this was not installed, had references to non-existing modules
(e.g., PVE::ReplicationTools) and the things it probably was intended
for are done in pve-manager, which has full access to all pve perl
libs and API methods (from a dependency POV)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-10-03 16:58:57 +02:00
Dietmar Maurer
1e17594e74 add missing parameter descriptions 2018-08-09 09:52:44 +02:00
Dietmar Maurer
48dccd2fbe cleanup return property descriptions 2018-08-09 09:29:10 +02:00
Dietmar Maurer
2654942813 PVE::API2::Storage::Content::index - document return values 2018-08-09 08:53:24 +02:00
Dietmar Maurer
d347322a63 PVE::API2::Storage::Status::index - document return schema properties
And add property "used_fraction" - I want to use that for the CLI tool.
2018-08-07 13:24:27 +02:00
Thomas Lamprecht
6d3b36e1b0 api add: remove now uneeded $cred_file variable
was used for cleanup, which is now handled by on_delete_hook

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
f9602323c6 lvm: use add hook
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
2e109b4bc2 rbd: use add/delete hooks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
ab5e32bb1d cifs: use add/delete hooks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
3932ca0d1b add on_add and on_delete hooks
on_add_hook allows to encapsulate storage specific add steps, like
copying a keyring (RDB) or creating a volume group (LVM) in a clean
manner.
The same for deletion with on_delete_hook, here all should be cleaned
up, as much as possible.

Until now, this was done directly in the api config CREATE and DELETE
code, respectively, with a series of

if ($storage_type eq 'foo) {
    ...
} elsif ($storage_type eq 'bar') {
    ...
}

which isn't really that nice...

Another nice result of this approach is that also external plugins
can use those hooks and to their setup/cleanup steps sanely.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-03 12:27:34 +02:00
Thomas Lamprecht
d7b707626a storage add: always extract password from parameters
as else we write it to /etc/pve/storage.cfg which is readable by
www-data, a not really private group...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-29 13:16:17 +02:00
Thomas Lamprecht
2d4404fc63 add cifs: fix variable declaration in post if
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-29 13:15:26 +02:00
Dietmar Maurer
8b3d5c1f12 PVE/API2/Storage/Config.pm - set type in returns schema 2018-06-22 07:52:51 +02:00
Wolfgang Bumiller
d68c7bca46 whitespace fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-05-14 08:35:22 +02:00
Wolfgang Link
fee2cb61e3 Fix typo. 2018-05-14 08:10:19 +02:00
Wolfgang Link
ee8c176d3a Simplify image/template upload check.
All storage's witch are able to store images must have a path.
2018-05-14 08:10:19 +02:00
Dietmar Maurer
566639d518 cifs: use correct pluging class name 2018-03-16 13:23:47 +01:00
Dietmar Maurer
a9db2ca8a5 cifs: move plugin related code into plugin 2018-03-16 13:08:32 +01:00
Dietmar Maurer
304344ce34 add missing "use PVE::Storage::LVMPlugin;" 2018-03-16 12:54:06 +01:00
Dietmar Maurer
fa1b42dd98 cifs plugin cleanups 2018-03-16 12:35:55 +01:00
Dietmar Maurer
c6fb7b80fc remove useless "use PVE::PTY;" 2018-03-16 12:09:37 +01:00
Wolfgang Link
b9cfb8cac7 Add cifsscan to API 2018-03-16 12:07:14 +01:00
Wolfgang Link
ba7e9ba9c9 Add remove cifs in API call. 2018-03-16 12:05:02 +01:00
Wolfgang Link
a4a9405d76 Add cifs in create API call.
In this patch the nodes will be deleted if the nodes parameter comes with a empty string.
We need this in the GUI when update the nodes in the config to reset if a nodes.

If we do not erase the empty hash the storage online check would be skipped.
Also the password and user would not be verified.
2018-03-16 12:03:37 +01:00
Wolfgang Link
f79a699c13 Add set CIFS credentials. 2018-03-16 11:58:34 +01:00
Dominik Csapak
f6c03d367d whitespace cleanup
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:23:52 +01:00
Dominik Csapak
856c54bd75 add 'format' parameter to storage list call
we will use this for the gui to figure out if we have to show
a size selector, a file selector, which formats are there, etc.

we have to include this data even for not active storages, else
we cannot show the correct fields

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-14 13:23:52 +01:00
Fabian Grünbichler
8143f49038 rbd: create ceph keyring dir before copying
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 12:51:31 +02:00
Fabian Grünbichler
5a39d0a111 rbd: manage keyring for pveceph storages
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:35:00 +02:00
Emmanuel Kasper
030f6e1a97 Fix #1424: allow tar.xz templates upload 2017-06-22 14:32:27 +02:00
Wolfgang Bumiller
cd0b3d5bc2 Revert "free: added snapshot parameter"
This reverts commit a26e1abc70.
2017-05-23 13:31:21 +02:00
Wolfgang Bumiller
acd27197ce migrate: replace target ip parameter with sshinfo parameter 2017-05-23 09:31:19 +02:00
Wolfgang Bumiller
a26e1abc70 free: added snapshot parameter 2017-05-12 14:42:16 +02:00
Dietmar Maurer
f88846ea3b do not install replication code
The code introduces a cyclic package dependency, so we need to
move it to pve-manager package.
2017-05-10 07:06:35 +02:00
Dietmar Maurer
8b38cdaf67 PVE::API2::Storage::Replication - add reasonable permission checks 2017-05-05 11:55:34 +02:00
Dietmar Maurer
1d3ddfaf2c pvesr: move destroy_job into API class, remove wrong permission checks. 2017-05-05 11:18:30 +02:00
Dietmar Maurer
339ca30a5b PVE::API2::Storage::Replication->jobs(): return array 2017-05-05 10:54:10 +02:00
Dietmar Maurer
e0992d57e1 pvesr: rename list => jobs, call API
to avoid code duplication. I also removed the functioanlity to query
jobs on other nodes, because it is clumsy and not really needed.
2017-05-05 10:31:51 +02:00
Dietmar Maurer
07dff26749 PVE::API2::Storage::Replication - add directory index 2017-05-05 10:01:26 +02:00