]> git.proxmox.com Git - pmg-api.git/blobdiff - PMG/API2/Transport.pm
fix #1673: Allow email addresses in transport maps
[pmg-api.git] / PMG / API2 / Transport.pm
index 30c06370aac1d4b487e6131423e436196d7067aa..98ab4143ba5e29468bbfede2dc78fc37054928ce 100644 (file)
@@ -21,6 +21,7 @@ __PACKAGE__->register_method ({
     method => 'GET',
     description => "List transport map entries.",
     proxyto => 'master',
+    permissions => { check => [ 'admin', 'audit' ] },
     parameters => {
        additionalProperties => 0,
        properties => {},
@@ -37,7 +38,7 @@ __PACKAGE__->register_method ({
                comment => { type => 'string'},
            },
        },
-       links => [ { rel => 'child', href => "{id}" } ],
+       links => [ { rel => 'child', href => "{domain}" } ],
     },
     code => sub {
        my ($param) = @_;
@@ -59,13 +60,14 @@ __PACKAGE__->register_method ({
     method => 'POST',
     proxyto => 'master',
     protected => 1,
+    permissions => { check => [ 'admin' ] },
     description => "Add transport map entry.",
     parameters => {
        additionalProperties => 0,
        properties => {
            domain => {
                description => "Domain name.",
-               type => 'string', format => 'transport-domain',
+               type => 'string', format => 'transport-domain-or-email',
            },
            host => {
                description => "Target host (name or IP address).",
@@ -127,12 +129,13 @@ __PACKAGE__->register_method ({
     method => 'GET',
     description => "Read transport map entry.",
     proxyto => 'master',
+    permissions => { check => [ 'admin', 'audit' ] },
     parameters => {
        additionalProperties => 0,
        properties => {
            domain => {
                description => "Domain name.",
-               type => 'string', format => 'transport-domain',
+               type => 'string', format => 'transport-domain-or-email',
            },
        },
     },
@@ -164,13 +167,14 @@ __PACKAGE__->register_method ({
     method => 'PUT',
     description => "Update transport map entry.",
     protected => 1,
+    permissions => { check => [ 'admin' ] },
     proxyto => 'master',
     parameters => {
        additionalProperties => 0,
        properties => {
            domain => {
                description => "Domain name.",
-               type => 'string', format => 'transport-domain',
+               type => 'string', format => 'transport-domain-or-email',
            },
            host => {
                description => "Target host (name or IP address).",
@@ -232,13 +236,14 @@ __PACKAGE__->register_method ({
     method => 'DELETE',
     description => "Delete a transport map entry",
     protected => 1,
+    permissions => { check => [ 'admin' ] },
     proxyto => 'master',
     parameters => {
        additionalProperties => 0,
        properties => {
            domain => {
                description => "Domain name.",
-               type => 'string', format => 'transport-domain',
+               type => 'string', format => 'transport-domain-or-email',
            },
        }
     },