add Storage::get_bandwidth_limit helper
Takes an operation, an optional requested bandwidth limit override, and a list of storages involved in the operation and lowers the requested bandwidth against global and storage-specific limits unless the user has permissions to change those. This means: * Global limits apply to all users without Sys.Modify on / (as they can change datacenter.cfg options via the API). * Storage specific limits apply to users without Datastore.Allocate access on /storage/X for any involved storage X. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -45,6 +45,7 @@ sub options {
|
||||
content => { optional => 1 },
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ sub properties {
|
||||
type => 'string',
|
||||
default => 'no',
|
||||
},
|
||||
bwlimit => get_standard_option('bwlimit'),
|
||||
};
|
||||
}
|
||||
|
||||
@ -56,6 +57,7 @@ sub options {
|
||||
format => { optional => 1 },
|
||||
mkdir => { optional => 1 },
|
||||
is_mountpoint => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -136,6 +136,7 @@ sub options {
|
||||
content => { optional => 1 },
|
||||
format => { optional => 1 },
|
||||
mkdir => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -68,6 +68,7 @@ sub options {
|
||||
nodes => { optional => 1},
|
||||
disable => { optional => 1},
|
||||
content => { optional => 1},
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -261,6 +261,7 @@ sub options {
|
||||
nodes => { optional => 1},
|
||||
disable => { optional => 1},
|
||||
content => { optional => 1},
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -202,6 +202,7 @@ sub options {
|
||||
content => { optional => 1 },
|
||||
base => { fixed => 1, optional => 1 },
|
||||
tagged_only => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -49,6 +49,7 @@ sub options {
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -86,6 +86,7 @@ sub options {
|
||||
content => { optional => 1 },
|
||||
format => { optional => 1 },
|
||||
mkdir => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -278,6 +278,7 @@ sub options {
|
||||
username => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
krbd => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -115,6 +115,7 @@ sub options {
|
||||
disable => { optional => 1 },
|
||||
portal => { fixed => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -205,6 +205,7 @@ sub options {
|
||||
comstar_hg => { optional => 1 },
|
||||
comstar_tg => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +43,7 @@ sub options {
|
||||
nodes => { optional => 1 },
|
||||
disable => { optional => 1 },
|
||||
content => { optional => 1 },
|
||||
bwlimit => { optional => 1 },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user