1
// Copyright 2023 The CubeFS Authors.
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
7
// http://www.apache.org/licenses/LICENSE-2.0
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
// implied. See the License for the specific language governing
13
// permissions and limitations under the License.
24
DefaultUid = "default"
27
type UserLimitConf struct {
28
BandWidthQuota map[string]uint64 `json:"band_width_quota"` // uid --> BytesPS
29
QPSQuota map[string]uint64 `json:"qps_quota"` // uid --> QPS
30
ConcurrentQuota map[string]uint64 `json:"concurrent_quota"` // uid --> concurrency
33
type S3QosRequest struct {
34
Uid string `json:"uid"`
35
Api string `json:"api"`
36
Type string `json:"type"`
37
Quota uint64 `json:"quota"`
38
Nodes uint64 `json:"nodes"`
41
type S3QoSResponse struct {
42
ApiLimitConf map[string]*UserLimitConf `json:"user_limit_conf"` // api --> userLimitConf
43
Nodes uint64 `json:"nodes"`
46
func IsS3PutApi(api string) bool {
47
switch strings.ToLower(api) {
48
case "putobject", "copyobject", "uploadpart", "uploadpartcopy", "postobject":