Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
f4fd3ac4
Commit
f4fd3ac4
authored
Feb 06, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix permissions on node API
Remove upload method (now in PVE::API2::Storage::Status)
parent
563faf84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
74 deletions
+10
-74
Nodes.pm
PVE/API2/Nodes.pm
+10
-74
No files found.
PVE/API2/Nodes.pm
View file @
f4fd3ac4
...
...
@@ -104,7 +104,6 @@ __PACKAGE__->register_method ({
{
name
=>
'
services
'
},
{
name
=>
'
scan
'
},
{
name
=>
'
storage
'
},
{
name
=>
'
upload
'
},
{
name
=>
'
qemu
'
},
{
name
=>
'
openvz
'
},
{
name
=>
'
vzdump
'
},
...
...
@@ -488,6 +487,7 @@ __PACKAGE__->register_method ({
method
=>
'
POST
',
protected
=>
1
,
permissions
=>
{
description
=>
"
Restricted to users on realm 'pam'
",
check
=>
['
perm
',
'
/nodes/{node}
',
[
'
Sys.Console
'
]],
},
description
=>
"
Creates a VNC Shell proxy.
",
...
...
@@ -512,7 +512,9 @@ __PACKAGE__->register_method ({
my
$rpcenv
=
PVE::RPCEnvironment::
get
();
my
$user
=
$rpcenv
->
get_user
();
my
(
$user
,
undef
,
$realm
)
=
verify_username
(
$rpcenv
->
get_user
());
raise_perm_exc
("
realm != pam
")
if
$realm
ne
'
pam
';
my
$node
=
$param
->
{
node
};
...
...
@@ -626,6 +628,9 @@ __PACKAGE__->register_method({
path
=>
'
dns
',
method
=>
'
PUT
',
description
=>
"
Write DNS settings.
",
permissions
=>
{
check
=>
['
perm
',
'
/nodes/{node}
',
[
'
Sys.Modify
'
]],
},
proxyto
=>
'
node
',
protected
=>
1
,
parameters
=>
{
...
...
@@ -716,6 +721,9 @@ __PACKAGE__->register_method({
path
=>
'
time
',
method
=>
'
PUT
',
description
=>
"
Set time zone.
",
permissions
=>
{
check
=>
['
perm
',
'
/nodes/{node}
',
[
'
Sys.Modify
'
]],
},
proxyto
=>
'
node
',
protected
=>
1
,
parameters
=>
{
...
...
@@ -737,78 +745,6 @@ __PACKAGE__->register_method({
return
undef
;
}});
__PACKAGE__
->
register_method
({
name
=>
'
upload
',
path
=>
'
upload
',
method
=>
'
POST
',
permissions
=>
{
check
=>
['
perm
',
'
/storage/{storage}
',
[
'
Datastore.AllocateSpace
'
]],
},
description
=>
"
Upload content.
",
parameters
=>
{
additionalProperties
=>
0
,
properties
=>
{
node
=>
get_standard_option
('
pve-node
'),
storage
=>
get_standard_option
('
pve-storage-id
'),
filename
=>
{
description
=>
"
The name of the file to create/upload.
",
type
=>
'
string
',
},
vmid
=>
get_standard_option
('
pve-vmid
',
{
description
=>
"
Specify owner VM
",
optional
=>
1
,
}),
},
},
returns
=>
{
description
=>
"
Volume identifier
",
type
=>
'
string
',
},
code
=>
sub
{
my
(
$param
)
=
@_
;
# todo: can we proxy file uploads to remote nodes?
if
(
$param
->
{
node
}
ne
PVE::INotify::
nodename
())
{
raise_param_exc
({
node
=>
"
can't upload content to remote node
"
});
}
my
$node
=
$param
->
{
node
};
my
$storeid
=
$param
->
{
storage
};
my
$name
=
$param
->
{
filename
};
my
$fh
=
CGI::
upload
('
filename
')
||
die
"
unable to get file handle
\n
";
syslog
('
info
',
"
UPLOAD
$name
to
$node
$storeid
");
# fixme:
die
"
upload not implemented
\n
";
my
$buffer
=
"";
my
$tmpname
=
"
/tmp/proxmox_upload-$$.bin
";
eval
{
open
FILE
,
"
>
$tmpname
"
||
die
"
can't open temporary file '
$tmpname
' - $!
\n
";
while
(
read
(
$fh
,
$buffer
,
32768
))
{
die
"
write failed - $!
"
unless
print
FILE
$buffer
;
}
close
FILE
||
die
"
can't close temporary file '
$tmpname
' - $!
\n
";
};
my
$err
=
$@
;
if
(
$err
)
{
unlink
$tmpname
;
die
$err
;
}
unlink
$tmpname
;
# fixme: proxy to local host import
# fixme: return volid
return
undef
;
}});
package
PVE::API2::
Nodes
;
use
strict
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment