Tiers & lifecycle implementation (#638)
11
go.mod
@@ -18,19 +18,20 @@ require (
|
|||||||
github.com/minio/cli v1.22.0
|
github.com/minio/cli v1.22.0
|
||||||
github.com/minio/direct-csi v1.2.8
|
github.com/minio/direct-csi v1.2.8
|
||||||
github.com/minio/kes v0.11.0
|
github.com/minio/kes v0.11.0
|
||||||
github.com/minio/mc v0.0.0-20210301162250-f9d36f9b5243
|
github.com/minio/mc v0.0.0-20210422171734-4eae7ec7ed25
|
||||||
github.com/minio/minio v0.0.0-20210301203133-e8d8dfa3ae8f
|
github.com/minio/minio v0.0.0-20210423185853-cbfdf97abf9f
|
||||||
github.com/minio/minio-go/v7 v7.0.10
|
github.com/minio/minio-go/v7 v7.0.11-0.20210407221404-ba867dba7ee1
|
||||||
github.com/minio/operator v0.0.0-20210419212754-93a9239fd18b
|
github.com/minio/operator v0.0.0-20210419212754-93a9239fd18b
|
||||||
github.com/minio/operator/logsearchapi v0.0.0-20210201110528-753019b838b4
|
github.com/minio/operator/logsearchapi v0.0.0-20210201110528-753019b838b4
|
||||||
github.com/minio/selfupdate v0.3.1
|
github.com/minio/selfupdate v0.3.1
|
||||||
github.com/mitchellh/go-homedir v1.1.0
|
github.com/mitchellh/go-homedir v1.1.0
|
||||||
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
|
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
|
||||||
|
github.com/rs/xid v1.2.1
|
||||||
github.com/secure-io/sio-go v0.3.1
|
github.com/secure-io/sio-go v0.3.1
|
||||||
github.com/stretchr/testify v1.6.1
|
github.com/stretchr/testify v1.6.1
|
||||||
github.com/unrolled/secure v1.0.7
|
github.com/unrolled/secure v1.0.7
|
||||||
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392
|
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc
|
||||||
golang.org/x/net v0.0.0-20201216054612-986b41b23924
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
|
||||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
||||||
gopkg.in/yaml.v2 v2.3.0
|
gopkg.in/yaml.v2 v2.3.0
|
||||||
k8s.io/api v0.20.2
|
k8s.io/api v0.20.2
|
||||||
|
|||||||
76
go.sum
@@ -474,8 +474,9 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
|
|||||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||||
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
|
|
||||||
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
|
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||||
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
@@ -542,8 +543,9 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
|
|||||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
|
|
||||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
|
||||||
|
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
|
github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4=
|
||||||
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
|
github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
|
||||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||||
@@ -795,6 +797,7 @@ github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaR
|
|||||||
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
|
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
|
||||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||||
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||||
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||||
@@ -802,8 +805,9 @@ github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0
|
|||||||
github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
github.com/klauspost/compress v1.10.1/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg=
|
|
||||||
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
|
github.com/klauspost/compress v1.11.12 h1:famVnQVu7QwryBN4jNseQdUKES71ZAOnB6UQQJPZvqk=
|
||||||
|
github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||||
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||||
github.com/klauspost/cpuid v1.2.2/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
github.com/klauspost/cpuid v1.2.2/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||||
@@ -840,12 +844,15 @@ github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
|||||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lib/pq v1.4.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.4.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg=
|
|
||||||
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
|
github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8=
|
||||||
|
github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
|
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
|
||||||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
||||||
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
|
||||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||||
|
github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
|
||||||
|
github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
|
||||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
@@ -906,24 +913,25 @@ github.com/minio/controller-tools v0.4.7/go.mod h1:xES4iNis9dGrLQuP6nquTZZNg2T0/
|
|||||||
github.com/minio/direct-csi v1.2.8 h1:jOpefwTGZYUIzouz5McSQ8EqeXO7Qu5aCJIwstbc6vs=
|
github.com/minio/direct-csi v1.2.8 h1:jOpefwTGZYUIzouz5McSQ8EqeXO7Qu5aCJIwstbc6vs=
|
||||||
github.com/minio/direct-csi v1.2.8/go.mod h1:+Zw8NjMQ5rQqySezan6G9DsQjHSHQCPWJli3v9dP80o=
|
github.com/minio/direct-csi v1.2.8/go.mod h1:+Zw8NjMQ5rQqySezan6G9DsQjHSHQCPWJli3v9dP80o=
|
||||||
github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc=
|
github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc=
|
||||||
github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0=
|
github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g=
|
||||||
github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY=
|
||||||
github.com/minio/kes v0.11.0 h1:8ma6OCVSxKT50b1uYXLJro3m7PmZtCLxBaTddQexI5k=
|
github.com/minio/kes v0.11.0 h1:8ma6OCVSxKT50b1uYXLJro3m7PmZtCLxBaTddQexI5k=
|
||||||
github.com/minio/kes v0.11.0/go.mod h1:mTF1Bv8YVEtQqF/B7Felp4tLee44Pp+dgI0rhCvgNg8=
|
github.com/minio/kes v0.11.0/go.mod h1:mTF1Bv8YVEtQqF/B7Felp4tLee44Pp+dgI0rhCvgNg8=
|
||||||
github.com/minio/mc v0.0.0-20210301162250-f9d36f9b5243 h1:V0EoJ/I/p86J8FH2zuOSTsTzNzDXQX4xZKvBwBLS/Qk=
|
github.com/minio/mc v0.0.0-20210422171734-4eae7ec7ed25 h1:HrVywZfBwMUS6fQMdaOgyD5XJEMnwd7fAaR99oy5mow=
|
||||||
github.com/minio/mc v0.0.0-20210301162250-f9d36f9b5243/go.mod h1:nkHp/atLUKkhML5YGfvaDDFqlcBmuii7s9Dbk3ulB1Q=
|
github.com/minio/mc v0.0.0-20210422171734-4eae7ec7ed25/go.mod h1:0mEfTTrQEZJXPvi9dNQWRlRplsmSmH+Z5h6G/2N3F/0=
|
||||||
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
|
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
|
||||||
github.com/minio/md5-simd v1.1.1 h1:9ojcLbuZ4gXbB2sX53MKn8JUZ0sB/2wfwsEcRw+I08U=
|
github.com/minio/md5-simd v1.1.1 h1:9ojcLbuZ4gXbB2sX53MKn8JUZ0sB/2wfwsEcRw+I08U=
|
||||||
github.com/minio/md5-simd v1.1.1/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
|
github.com/minio/md5-simd v1.1.1/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
|
||||||
github.com/minio/minio v0.0.0-20210110213705-828602d672f7/go.mod h1:fp/MFzOSx+MgC/b1epAX6ZLXvBP+zaemt7cV98+UsUg=
|
github.com/minio/minio v0.0.0-20210110213705-828602d672f7/go.mod h1:fp/MFzOSx+MgC/b1epAX6ZLXvBP+zaemt7cV98+UsUg=
|
||||||
github.com/minio/minio v0.0.0-20210128013121-e79829b5b368/go.mod h1:6jySvEwvfCfr9SphRrAb+TMtEXRgRJ4sb79UKFJWmFM=
|
github.com/minio/minio v0.0.0-20210128013121-e79829b5b368/go.mod h1:6jySvEwvfCfr9SphRrAb+TMtEXRgRJ4sb79UKFJWmFM=
|
||||||
github.com/minio/minio v0.0.0-20210301081546-0b9c17443eb8/go.mod h1:E7ngQWKJdbRG9dqHZ86lnhGS0RxqtEJTnWDEM/P9BQs=
|
github.com/minio/minio v0.0.0-20210421185923-38a9f87a560e/go.mod h1:XNPkjbDN/j7cNOoaE0TefFKeDycjJVkYTGRJlD6I9EI=
|
||||||
github.com/minio/minio v0.0.0-20210301203133-e8d8dfa3ae8f h1:dAFaii7oqV0Mu9rUNfsgKdE10aZADSgIXoK5saLVeOE=
|
github.com/minio/minio v0.0.0-20210423185853-cbfdf97abf9f h1:2IVnOLvfO2HY9n82nHKhLcxVbCPFsVvSCzO33rAgd7w=
|
||||||
github.com/minio/minio v0.0.0-20210301203133-e8d8dfa3ae8f/go.mod h1:E7ngQWKJdbRG9dqHZ86lnhGS0RxqtEJTnWDEM/P9BQs=
|
github.com/minio/minio v0.0.0-20210423185853-cbfdf97abf9f/go.mod h1:RDrFSTbgdNK7uLIZZqfx93L973cEj6EecG2OGfOeUp8=
|
||||||
github.com/minio/minio-go/v7 v7.0.7-0.20201217170524-3baf9ea06f7c/go.mod h1:pEZBUa+L2m9oECoIA6IcSK8bv/qggtQVLovjeKK5jYc=
|
github.com/minio/minio-go/v7 v7.0.7-0.20201217170524-3baf9ea06f7c/go.mod h1:pEZBUa+L2m9oECoIA6IcSK8bv/qggtQVLovjeKK5jYc=
|
||||||
github.com/minio/minio-go/v7 v7.0.8-0.20210127003153-c40722862654/go.mod h1:pEZBUa+L2m9oECoIA6IcSK8bv/qggtQVLovjeKK5jYc=
|
github.com/minio/minio-go/v7 v7.0.8-0.20210127003153-c40722862654/go.mod h1:pEZBUa+L2m9oECoIA6IcSK8bv/qggtQVLovjeKK5jYc=
|
||||||
github.com/minio/minio-go/v7 v7.0.10 h1:1oUKe4EOPUEhw2qnPQaPsJ0lmVTYLFu03SiItauXs94=
|
github.com/minio/minio-go/v7 v7.0.11-0.20210302210017-6ae69c73ce78/go.mod h1:mTh2uJuAbEqdhMVl6CMIIZLUeiMiWtJR4JB8/5g2skw=
|
||||||
github.com/minio/minio-go/v7 v7.0.10/go.mod h1:td4gW1ldOsj1PbSNS+WYK43j+P1XVhX/8W8awaYlBFo=
|
github.com/minio/minio-go/v7 v7.0.11-0.20210407221404-ba867dba7ee1 h1:x0jnjGGnb0PaewBIH9dbTaLJUNVKYoQOjjdqwz9PwdQ=
|
||||||
|
github.com/minio/minio-go/v7 v7.0.11-0.20210407221404-ba867dba7ee1/go.mod h1:mTh2uJuAbEqdhMVl6CMIIZLUeiMiWtJR4JB8/5g2skw=
|
||||||
github.com/minio/operator v0.0.0-20210419212754-93a9239fd18b h1:3TV7FQpciS08+66ydlSPHSU96hMUjt1696xW6NrAcmk=
|
github.com/minio/operator v0.0.0-20210419212754-93a9239fd18b h1:3TV7FQpciS08+66ydlSPHSU96hMUjt1696xW6NrAcmk=
|
||||||
github.com/minio/operator v0.0.0-20210419212754-93a9239fd18b/go.mod h1:kPcdt1W5H4gBMzrH1Pz1LHkCD5QQDDwkU62MyYg3O8M=
|
github.com/minio/operator v0.0.0-20210419212754-93a9239fd18b/go.mod h1:kPcdt1W5H4gBMzrH1Pz1LHkCD5QQDDwkU62MyYg3O8M=
|
||||||
github.com/minio/operator/logsearchapi v0.0.0-20210201110528-753019b838b4 h1:7HNd0WPMFcQzQbgPs7VQJfiXVm8xjuxnS3/1yi4twwM=
|
github.com/minio/operator/logsearchapi v0.0.0-20210201110528-753019b838b4 h1:7HNd0WPMFcQzQbgPs7VQJfiXVm8xjuxnS3/1yi4twwM=
|
||||||
@@ -936,6 +944,7 @@ github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy
|
|||||||
github.com/minio/simdjson-go v0.1.5/go.mod h1:oKURrZZEBtqObgJrSjN1Ln2n9MJj2icuBTkeJzZnvSI=
|
github.com/minio/simdjson-go v0.1.5/go.mod h1:oKURrZZEBtqObgJrSjN1Ln2n9MJj2icuBTkeJzZnvSI=
|
||||||
github.com/minio/simdjson-go v0.2.0/go.mod h1:JPUSkRykfSPS+AhO0YPA1h0l5vY7NqrF4zel2b12wxc=
|
github.com/minio/simdjson-go v0.2.0/go.mod h1:JPUSkRykfSPS+AhO0YPA1h0l5vY7NqrF4zel2b12wxc=
|
||||||
github.com/minio/simdjson-go v0.2.1/go.mod h1:JPUSkRykfSPS+AhO0YPA1h0l5vY7NqrF4zel2b12wxc=
|
github.com/minio/simdjson-go v0.2.1/go.mod h1:JPUSkRykfSPS+AhO0YPA1h0l5vY7NqrF4zel2b12wxc=
|
||||||
|
github.com/minio/sio v0.2.1 h1:NjzKiIMSMcHediVQR0AFVx2tp7Wxh9tKPfDI3kH7aHQ=
|
||||||
github.com/minio/sio v0.2.1/go.mod h1:8b0yPp2avGThviy/+OCJBI6OMpvxoUuiLvE6F1lebhw=
|
github.com/minio/sio v0.2.1/go.mod h1:8b0yPp2avGThviy/+OCJBI6OMpvxoUuiLvE6F1lebhw=
|
||||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||||
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
||||||
@@ -983,8 +992,9 @@ github.com/nats-io/jwt v1.1.0/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4
|
|||||||
github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
|
github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
|
||||||
github.com/nats-io/nats-server/v2 v2.1.9 h1:Sxr2zpaapgpBT9ElTxTVe62W+qjnhPcKY/8W5cnA/Qk=
|
github.com/nats-io/nats-server/v2 v2.1.9 h1:Sxr2zpaapgpBT9ElTxTVe62W+qjnhPcKY/8W5cnA/Qk=
|
||||||
github.com/nats-io/nats-server/v2 v2.1.9/go.mod h1:9qVyoewoYXzG1ME9ox0HwkkzyYvnlBDugfR4Gg/8uHU=
|
github.com/nats-io/nats-server/v2 v2.1.9/go.mod h1:9qVyoewoYXzG1ME9ox0HwkkzyYvnlBDugfR4Gg/8uHU=
|
||||||
github.com/nats-io/nats-streaming-server v0.19.0 h1:NVYusu6kcMxRBj1wOWRdXBUHf1bzkJQbsHovsg+Fr1o=
|
|
||||||
github.com/nats-io/nats-streaming-server v0.19.0/go.mod h1:oqrRqpMg84aiPDyroTornjVWNYJKh+6ozh2Mgt8dslE=
|
github.com/nats-io/nats-streaming-server v0.19.0/go.mod h1:oqrRqpMg84aiPDyroTornjVWNYJKh+6ozh2Mgt8dslE=
|
||||||
|
github.com/nats-io/nats-streaming-server v0.21.1 h1:jb/osnXmFJtKDS9DFghDjX82v1NT9IhaoR/r6s6toNg=
|
||||||
|
github.com/nats-io/nats-streaming-server v0.21.1/go.mod h1:2W8QfNVOtcFpmf0bRiwuLtRb0/hkX4NuOxPOFNOThVQ=
|
||||||
github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
|
github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
|
||||||
github.com/nats-io/nats.go v1.10.0 h1:L8qnKaofSfNFbXg0C5F71LdjPRnmQwSsA4ukmkt1TvY=
|
github.com/nats-io/nats.go v1.10.0 h1:L8qnKaofSfNFbXg0C5F71LdjPRnmQwSsA4ukmkt1TvY=
|
||||||
github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE=
|
github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE=
|
||||||
@@ -995,8 +1005,9 @@ github.com/nats-io/nkeys v0.2.0 h1:WXKF7diOaPU9cJdLD7nuzwasQy9vT1tBqzXZZf3AMJM=
|
|||||||
github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s=
|
github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s=
|
||||||
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=
|
||||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||||
github.com/nats-io/stan.go v0.7.0 h1:sMVHD9RkxPOl6PJfDVBQd+gbxWkApeYl6GrH+10msO4=
|
|
||||||
github.com/nats-io/stan.go v0.7.0/go.mod h1:Ci6mUIpGQTjl++MqK2XzkWI/0vF+Bl72uScx7ejSYmU=
|
github.com/nats-io/stan.go v0.7.0/go.mod h1:Ci6mUIpGQTjl++MqK2XzkWI/0vF+Bl72uScx7ejSYmU=
|
||||||
|
github.com/nats-io/stan.go v0.8.3 h1:XyemjL9vAeGHooHn5RQy+ngljd8AVSM2l65Jdnpv4rI=
|
||||||
|
github.com/nats-io/stan.go v0.8.3/go.mod h1:Ejm8bbHnMTSptU6uNMAVuxeapMJYBB/Ml3ej6z4GoSY=
|
||||||
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
|
github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU=
|
||||||
github.com/ncw/directio v1.0.5 h1:JSUBhdjEvVaJvOoyPAbcW0fnd0tvRXD76wEfZ1KcQz4=
|
github.com/ncw/directio v1.0.5 h1:JSUBhdjEvVaJvOoyPAbcW0fnd0tvRXD76wEfZ1KcQz4=
|
||||||
github.com/ncw/directio v1.0.5/go.mod h1:rX/pKEYkOXBGOggmcyJeJGloCkleSvphPx2eV3t6ROk=
|
github.com/ncw/directio v1.0.5/go.mod h1:rX/pKEYkOXBGOggmcyJeJGloCkleSvphPx2eV3t6ROk=
|
||||||
@@ -1057,6 +1068,7 @@ github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bA
|
|||||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||||
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||||
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
|
github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw=
|
||||||
|
github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
|
||||||
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||||
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
|
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
|
||||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||||
@@ -1116,8 +1128,9 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z
|
|||||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||||
github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4=
|
|
||||||
github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||||
|
github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
|
||||||
|
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||||
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
|
github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI=
|
||||||
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
|
github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k=
|
||||||
@@ -1176,8 +1189,9 @@ github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
|
|||||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||||
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
|
|
||||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||||
|
github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
|
||||||
|
github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
|
||||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||||
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
||||||
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
||||||
@@ -1240,7 +1254,10 @@ github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQx
|
|||||||
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
|
github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0=
|
||||||
github.com/tidwall/gjson v1.3.5/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
github.com/tidwall/gjson v1.3.5/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
|
||||||
github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI=
|
github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI=
|
||||||
|
github.com/tidwall/gjson v1.6.8 h1:CTmXMClGYPAmln7652e69B7OLXfTi5ABcPPwjIWUv7w=
|
||||||
|
github.com/tidwall/gjson v1.6.8/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI=
|
||||||
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
|
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
|
||||||
|
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
|
||||||
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
|
||||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||||
github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
|
github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
|
||||||
@@ -1248,6 +1265,7 @@ github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV
|
|||||||
github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y=
|
github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y=
|
||||||
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
|
github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
|
||||||
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
|
github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk=
|
||||||
|
github.com/tinylib/msgp v1.1.3 h1:3giwAkmtaEDLSV0MdO1lDLuPgklgPzmk8H9+So2BVfA=
|
||||||
github.com/tinylib/msgp v1.1.3/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
github.com/tinylib/msgp v1.1.3/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||||
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
|
github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLDRpvE+3b7gP/C2YyLFYxNmcLnPTMe0=
|
||||||
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
|
github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0=
|
||||||
@@ -1378,8 +1396,10 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh
|
|||||||
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 h1:xYJJ3S178yv++9zXV/hnr29plCAGO9vAFG9dorqaFQc=
|
|
||||||
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||||
|
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||||
|
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc h1:+q90ECDSAQirdykUN6sPEiBXBsp8Csjcca8Oy7bgLTA=
|
||||||
|
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
@@ -1412,8 +1432,9 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
|||||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
|
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
|
||||||
|
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
@@ -1462,8 +1483,9 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
|
|||||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20201216054612-986b41b23924 h1:QsnDpLLOKwHBBDa8nDws4DYNc/ryVW2vCpxCs09d4PY=
|
|
||||||
golang.org/x/net v0.0.0-20201216054612-986b41b23924/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20201216054612-986b41b23924/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
|
||||||
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
@@ -1482,6 +1504,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@@ -1555,8 +1578,10 @@ golang.org/x/sys v0.0.0-20201024232916-9f70ab9862d5/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
|
|
||||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M=
|
||||||
|
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
@@ -1649,6 +1674,7 @@ golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjs
|
|||||||
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||||
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200425043458-8463f397d07c/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
@@ -1659,13 +1685,16 @@ golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roY
|
|||||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200616195046-dc31b401abb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200616195046-dc31b401abb5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
golang.org/x/tools v0.0.0-20201105001634-bc3cf281b174/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20201105001634-bc3cf281b174/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.0.0-20210115202250-e0d201561e39/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210115202250-e0d201561e39/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
|
|
||||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||||
|
golang.org/x/tools v0.1.1-0.20210201201750-4d4ee958a9b7 h1:/wdPW261t381NDQd8TBo63/FyvACfLICwtH8wMRoHJQ=
|
||||||
|
golang.org/x/tools v0.1.1-0.20210201201750-4d4ee958a9b7/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||||
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
@@ -1833,8 +1862,9 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
|
|||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
|
|
||||||
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
|
||||||
|
honnef.co/go/tools v0.0.1-2020.1.6/go.mod h1:pyyisuGw24ruLjrr1ddx39WE0y9OooInRzEYLhQB2YY=
|
||||||
k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI=
|
k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI=
|
||||||
k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA=
|
k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA=
|
||||||
k8s.io/api v0.18.3/go.mod h1:UOaMwERbqJMfeeeHc8XJKawj4P9TgDRnViIqqBeH2QA=
|
k8s.io/api v0.18.3/go.mod h1:UOaMwERbqJMfeeeHc8XJKawj4P9TgDRnViIqqBeH2QA=
|
||||||
|
|||||||
93
models/add_bucket_lifecycle.go
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddBucketLifecycle add bucket lifecycle
|
||||||
|
//
|
||||||
|
// swagger:model addBucketLifecycle
|
||||||
|
type AddBucketLifecycle struct {
|
||||||
|
|
||||||
|
// Non required, toggle to disable or enable rule
|
||||||
|
Disable bool `json:"disable,omitempty"`
|
||||||
|
|
||||||
|
// Non required, toggle to disable or enable rule
|
||||||
|
ExpiredObjectDeleteMarker bool `json:"expired_object_delete_marker,omitempty"`
|
||||||
|
|
||||||
|
// Required in case of expiry_days or transition fields are not set. it defines an expiry date for ILM
|
||||||
|
ExpiryDate string `json:"expiry_date,omitempty"`
|
||||||
|
|
||||||
|
// Required in case of expiry_date or transition fields are not set. it defines an expiry days for ILM
|
||||||
|
ExpiryDays int32 `json:"expiry_days,omitempty"`
|
||||||
|
|
||||||
|
// Non required, can be set in case of expiration is enabled
|
||||||
|
NoncurrentversionExpirationDays int32 `json:"noncurrentversion_expiration_days,omitempty"`
|
||||||
|
|
||||||
|
// Non required, can be set in case of transition is enabled
|
||||||
|
NoncurrentversionTransitionDays int32 `json:"noncurrentversion_transition_days,omitempty"`
|
||||||
|
|
||||||
|
// Non required, can be set in case of transition is enabled
|
||||||
|
NoncurrentversionTransitionStorageClass string `json:"noncurrentversion_transition_storage_class,omitempty"`
|
||||||
|
|
||||||
|
// Non required field, it matches a prefix to perform ILM operations on it
|
||||||
|
Prefix string `json:"prefix,omitempty"`
|
||||||
|
|
||||||
|
// Required only in case of transition is set. it refers to a tier
|
||||||
|
StorageClass string `json:"storage_class,omitempty"`
|
||||||
|
|
||||||
|
// Non required field, tags to match ILM files
|
||||||
|
Tags string `json:"tags,omitempty"`
|
||||||
|
|
||||||
|
// Required in case of transition_days or expiry fields are not set. it defines a transition date for ILM
|
||||||
|
TransitionDate string `json:"transition_date,omitempty"`
|
||||||
|
|
||||||
|
// Required in case of transition_date or expiry fields are not set. it defines a transition days for ILM
|
||||||
|
TransitionDays int32 `json:"transition_days,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this add bucket lifecycle
|
||||||
|
func (m *AddBucketLifecycle) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *AddBucketLifecycle) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *AddBucketLifecycle) UnmarshalBinary(b []byte) error {
|
||||||
|
var res AddBucketLifecycle
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
97
models/bucket_lifecycle_response.go
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketLifecycleResponse bucket lifecycle response
|
||||||
|
//
|
||||||
|
// swagger:model bucketLifecycleResponse
|
||||||
|
type BucketLifecycleResponse struct {
|
||||||
|
|
||||||
|
// lifecycle
|
||||||
|
Lifecycle []*ObjectBucketLifecycle `json:"lifecycle"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket lifecycle response
|
||||||
|
func (m *BucketLifecycleResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateLifecycle(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BucketLifecycleResponse) validateLifecycle(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Lifecycle) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Lifecycle); i++ {
|
||||||
|
if swag.IsZero(m.Lifecycle[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Lifecycle[i] != nil {
|
||||||
|
if err := m.Lifecycle[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("lifecycle" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketLifecycleResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketLifecycleResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketLifecycleResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
66
models/expiration_response.go
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ExpirationResponse expiration response
|
||||||
|
//
|
||||||
|
// swagger:model expirationResponse
|
||||||
|
type ExpirationResponse struct {
|
||||||
|
|
||||||
|
// date
|
||||||
|
Date string `json:"date,omitempty"`
|
||||||
|
|
||||||
|
// days
|
||||||
|
Days int64 `json:"days,omitempty"`
|
||||||
|
|
||||||
|
// delete marker
|
||||||
|
DeleteMarker bool `json:"delete_marker,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this expiration response
|
||||||
|
func (m *ExpirationResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *ExpirationResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *ExpirationResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res ExpirationResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
63
models/lifecycle_tag.go
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// LifecycleTag lifecycle tag
|
||||||
|
//
|
||||||
|
// swagger:model lifecycleTag
|
||||||
|
type LifecycleTag struct {
|
||||||
|
|
||||||
|
// key
|
||||||
|
Key string `json:"key,omitempty"`
|
||||||
|
|
||||||
|
// value
|
||||||
|
Value string `json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this lifecycle tag
|
||||||
|
func (m *LifecycleTag) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *LifecycleTag) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *LifecycleTag) UnmarshalBinary(b []byte) error {
|
||||||
|
var res LifecycleTag
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
156
models/object_bucket_lifecycle.go
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ObjectBucketLifecycle object bucket lifecycle
|
||||||
|
//
|
||||||
|
// swagger:model objectBucketLifecycle
|
||||||
|
type ObjectBucketLifecycle struct {
|
||||||
|
|
||||||
|
// expiration
|
||||||
|
Expiration *ExpirationResponse `json:"expiration,omitempty"`
|
||||||
|
|
||||||
|
// id
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
|
|
||||||
|
// prefix
|
||||||
|
Prefix string `json:"prefix,omitempty"`
|
||||||
|
|
||||||
|
// status
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
|
||||||
|
// tags
|
||||||
|
Tags []*LifecycleTag `json:"tags"`
|
||||||
|
|
||||||
|
// transition
|
||||||
|
Transition *TransitionResponse `json:"transition,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this object bucket lifecycle
|
||||||
|
func (m *ObjectBucketLifecycle) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateExpiration(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTags(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTransition(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ObjectBucketLifecycle) validateExpiration(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Expiration) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Expiration != nil {
|
||||||
|
if err := m.Expiration.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("expiration")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ObjectBucketLifecycle) validateTags(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Tags) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Tags); i++ {
|
||||||
|
if swag.IsZero(m.Tags[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Tags[i] != nil {
|
||||||
|
if err := m.Tags[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("tags" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ObjectBucketLifecycle) validateTransition(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Transition) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Transition != nil {
|
||||||
|
if err := m.Transition.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("transition")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *ObjectBucketLifecycle) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *ObjectBucketLifecycle) UnmarshalBinary(b []byte) error {
|
||||||
|
var res ObjectBucketLifecycle
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
198
models/tier.go
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Tier tier
|
||||||
|
//
|
||||||
|
// swagger:model tier
|
||||||
|
type Tier struct {
|
||||||
|
|
||||||
|
// azure
|
||||||
|
Azure *TierAzure `json:"azure,omitempty"`
|
||||||
|
|
||||||
|
// gcs
|
||||||
|
Gcs *TierGcs `json:"gcs,omitempty"`
|
||||||
|
|
||||||
|
// s3
|
||||||
|
S3 *TierS3 `json:"s3,omitempty"`
|
||||||
|
|
||||||
|
// type
|
||||||
|
// Enum: [s3 gcs azure unsupported]
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tier
|
||||||
|
func (m *Tier) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateAzure(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateGcs(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateS3(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateType(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Tier) validateAzure(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Azure) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Azure != nil {
|
||||||
|
if err := m.Azure.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("azure")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Tier) validateGcs(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Gcs) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Gcs != nil {
|
||||||
|
if err := m.Gcs.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("gcs")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Tier) validateS3(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.S3) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.S3 != nil {
|
||||||
|
if err := m.S3.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("s3")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var tierTypeTypePropEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []string
|
||||||
|
if err := json.Unmarshal([]byte(`["s3","gcs","azure","unsupported"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
tierTypeTypePropEnum = append(tierTypeTypePropEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// TierTypeS3 captures enum value "s3"
|
||||||
|
TierTypeS3 string = "s3"
|
||||||
|
|
||||||
|
// TierTypeGcs captures enum value "gcs"
|
||||||
|
TierTypeGcs string = "gcs"
|
||||||
|
|
||||||
|
// TierTypeAzure captures enum value "azure"
|
||||||
|
TierTypeAzure string = "azure"
|
||||||
|
|
||||||
|
// TierTypeUnsupported captures enum value "unsupported"
|
||||||
|
TierTypeUnsupported string = "unsupported"
|
||||||
|
)
|
||||||
|
|
||||||
|
// prop value enum
|
||||||
|
func (m *Tier) validateTypeEnum(path, location string, value string) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, tierTypeTypePropEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Tier) validateType(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Type) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateTypeEnum("type", "body", m.Type); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *Tier) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *Tier) UnmarshalBinary(b []byte) error {
|
||||||
|
var res Tier
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
78
models/tier_azure.go
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TierAzure tier azure
|
||||||
|
//
|
||||||
|
// swagger:model tier_azure
|
||||||
|
type TierAzure struct {
|
||||||
|
|
||||||
|
// accountkey
|
||||||
|
Accountkey string `json:"accountkey,omitempty"`
|
||||||
|
|
||||||
|
// accountname
|
||||||
|
Accountname string `json:"accountname,omitempty"`
|
||||||
|
|
||||||
|
// bucket
|
||||||
|
Bucket string `json:"bucket,omitempty"`
|
||||||
|
|
||||||
|
// endpoint
|
||||||
|
Endpoint string `json:"endpoint,omitempty"`
|
||||||
|
|
||||||
|
// name
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
|
||||||
|
// prefix
|
||||||
|
Prefix string `json:"prefix,omitempty"`
|
||||||
|
|
||||||
|
// region
|
||||||
|
Region string `json:"region,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tier azure
|
||||||
|
func (m *TierAzure) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TierAzure) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TierAzure) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TierAzure
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
66
models/tier_credentials_request.go
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TierCredentialsRequest tier credentials request
|
||||||
|
//
|
||||||
|
// swagger:model tierCredentialsRequest
|
||||||
|
type TierCredentialsRequest struct {
|
||||||
|
|
||||||
|
// access key
|
||||||
|
AccessKey string `json:"access_key,omitempty"`
|
||||||
|
|
||||||
|
// a base64 encoded value
|
||||||
|
Creds string `json:"creds,omitempty"`
|
||||||
|
|
||||||
|
// secret key
|
||||||
|
SecretKey string `json:"secret_key,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tier credentials request
|
||||||
|
func (m *TierCredentialsRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TierCredentialsRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TierCredentialsRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TierCredentialsRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
75
models/tier_gcs.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TierGcs tier gcs
|
||||||
|
//
|
||||||
|
// swagger:model tier_gcs
|
||||||
|
type TierGcs struct {
|
||||||
|
|
||||||
|
// bucket
|
||||||
|
Bucket string `json:"bucket,omitempty"`
|
||||||
|
|
||||||
|
// creds
|
||||||
|
Creds string `json:"creds,omitempty"`
|
||||||
|
|
||||||
|
// endpoint
|
||||||
|
Endpoint string `json:"endpoint,omitempty"`
|
||||||
|
|
||||||
|
// name
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
|
||||||
|
// prefix
|
||||||
|
Prefix string `json:"prefix,omitempty"`
|
||||||
|
|
||||||
|
// region
|
||||||
|
Region string `json:"region,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tier gcs
|
||||||
|
func (m *TierGcs) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TierGcs) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TierGcs) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TierGcs
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
97
models/tier_list_response.go
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TierListResponse tier list response
|
||||||
|
//
|
||||||
|
// swagger:model tierListResponse
|
||||||
|
type TierListResponse struct {
|
||||||
|
|
||||||
|
// items
|
||||||
|
Items []*Tier `json:"items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tier list response
|
||||||
|
func (m *TierListResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateItems(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TierListResponse) validateItems(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Items) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Items); i++ {
|
||||||
|
if swag.IsZero(m.Items[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Items[i] != nil {
|
||||||
|
if err := m.Items[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("items" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TierListResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TierListResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TierListResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
81
models/tier_s3.go
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TierS3 tier s3
|
||||||
|
//
|
||||||
|
// swagger:model tier_s3
|
||||||
|
type TierS3 struct {
|
||||||
|
|
||||||
|
// accesskey
|
||||||
|
Accesskey string `json:"accesskey,omitempty"`
|
||||||
|
|
||||||
|
// bucket
|
||||||
|
Bucket string `json:"bucket,omitempty"`
|
||||||
|
|
||||||
|
// endpoint
|
||||||
|
Endpoint string `json:"endpoint,omitempty"`
|
||||||
|
|
||||||
|
// name
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
|
||||||
|
// prefix
|
||||||
|
Prefix string `json:"prefix,omitempty"`
|
||||||
|
|
||||||
|
// region
|
||||||
|
Region string `json:"region,omitempty"`
|
||||||
|
|
||||||
|
// secretkey
|
||||||
|
Secretkey string `json:"secretkey,omitempty"`
|
||||||
|
|
||||||
|
// storageclass
|
||||||
|
Storageclass string `json:"storageclass,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tier s3
|
||||||
|
func (m *TierS3) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TierS3) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TierS3) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TierS3
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
66
models/transition_response.go
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TransitionResponse transition response
|
||||||
|
//
|
||||||
|
// swagger:model transitionResponse
|
||||||
|
type TransitionResponse struct {
|
||||||
|
|
||||||
|
// date
|
||||||
|
Date string `json:"date,omitempty"`
|
||||||
|
|
||||||
|
// days
|
||||||
|
Days int64 `json:"days,omitempty"`
|
||||||
|
|
||||||
|
// storage class
|
||||||
|
StorageClass string `json:"storage_class,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this transition response
|
||||||
|
func (m *TransitionResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TransitionResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TransitionResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TransitionResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
63
models/update_bucket_lifecycle.go
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package models
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateBucketLifecycle update bucket lifecycle
|
||||||
|
//
|
||||||
|
// swagger:model updateBucketLifecycle
|
||||||
|
type UpdateBucketLifecycle struct {
|
||||||
|
|
||||||
|
// disable
|
||||||
|
Disable bool `json:"disable,omitempty"`
|
||||||
|
|
||||||
|
// tags
|
||||||
|
Tags string `json:"tags,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this update bucket lifecycle
|
||||||
|
func (m *UpdateBucketLifecycle) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *UpdateBucketLifecycle) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *UpdateBucketLifecycle) UnmarshalBinary(b []byte) error {
|
||||||
|
var res UpdateBucketLifecycle
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -177,7 +177,7 @@ func TestGetActionsStringFromPolicy(t *testing.T) {
|
|||||||
args: args{
|
args: args{
|
||||||
policy: &iampolicy.AdminDiagnostics,
|
policy: &iampolicy.AdminDiagnostics,
|
||||||
},
|
},
|
||||||
want: 7,
|
want: 8,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|||||||
BIN
portal-ui/build/amazon.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
@@ -1,25 +1,25 @@
|
|||||||
{
|
{
|
||||||
"files": {
|
"files": {
|
||||||
"main.css": "/static/css/main.a19f3d53.chunk.css",
|
"main.css": "/static/css/main.a19f3d53.chunk.css",
|
||||||
"main.js": "/static/js/main.8cc2439a.chunk.js",
|
"main.js": "/static/js/main.b4a5fae7.chunk.js",
|
||||||
"main.js.map": "/static/js/main.8cc2439a.chunk.js.map",
|
"main.js.map": "/static/js/main.b4a5fae7.chunk.js.map",
|
||||||
"runtime-main.js": "/static/js/runtime-main.f48e99e5.js",
|
"runtime-main.js": "/static/js/runtime-main.f48e99e5.js",
|
||||||
"runtime-main.js.map": "/static/js/runtime-main.f48e99e5.js.map",
|
"runtime-main.js.map": "/static/js/runtime-main.f48e99e5.js.map",
|
||||||
"static/css/2.f324abd6.chunk.css": "/static/css/2.f324abd6.chunk.css",
|
"static/css/2.32daf8f7.chunk.css": "/static/css/2.32daf8f7.chunk.css",
|
||||||
"static/js/2.e6e35200.chunk.js": "/static/js/2.e6e35200.chunk.js",
|
"static/js/2.e5e999f3.chunk.js": "/static/js/2.e5e999f3.chunk.js",
|
||||||
"static/js/2.e6e35200.chunk.js.map": "/static/js/2.e6e35200.chunk.js.map",
|
"static/js/2.e5e999f3.chunk.js.map": "/static/js/2.e5e999f3.chunk.js.map",
|
||||||
"index.html": "/index.html",
|
"index.html": "/index.html",
|
||||||
"static/css/2.f324abd6.chunk.css.map": "/static/css/2.f324abd6.chunk.css.map",
|
"static/css/2.32daf8f7.chunk.css.map": "/static/css/2.32daf8f7.chunk.css.map",
|
||||||
"static/css/main.a19f3d53.chunk.css.map": "/static/css/main.a19f3d53.chunk.css.map",
|
"static/css/main.a19f3d53.chunk.css.map": "/static/css/main.a19f3d53.chunk.css.map",
|
||||||
"static/js/2.e6e35200.chunk.js.LICENSE.txt": "/static/js/2.e6e35200.chunk.js.LICENSE.txt",
|
"static/js/2.e5e999f3.chunk.js.LICENSE.txt": "/static/js/2.e5e999f3.chunk.js.LICENSE.txt",
|
||||||
"static/media/minio_console_logo.0837460e.svg": "/static/media/minio_console_logo.0837460e.svg",
|
"static/media/minio_console_logo.0837460e.svg": "/static/media/minio_console_logo.0837460e.svg",
|
||||||
"static/media/minio_operator_logo.1312b7c9.svg": "/static/media/minio_operator_logo.1312b7c9.svg"
|
"static/media/minio_operator_logo.1312b7c9.svg": "/static/media/minio_operator_logo.1312b7c9.svg"
|
||||||
},
|
},
|
||||||
"entrypoints": [
|
"entrypoints": [
|
||||||
"static/js/runtime-main.f48e99e5.js",
|
"static/js/runtime-main.f48e99e5.js",
|
||||||
"static/css/2.f324abd6.chunk.css",
|
"static/css/2.32daf8f7.chunk.css",
|
||||||
"static/js/2.e6e35200.chunk.js",
|
"static/js/2.e5e999f3.chunk.js",
|
||||||
"static/css/main.a19f3d53.chunk.css",
|
"static/css/main.a19f3d53.chunk.css",
|
||||||
"static/js/main.8cc2439a.chunk.js"
|
"static/js/main.b4a5fae7.chunk.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
BIN
portal-ui/build/azure.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
portal-ui/build/gcs.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
@@ -1 +1 @@
|
|||||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.f324abd6.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.e6e35200.chunk.js"></script><script src="/static/js/main.8cc2439a.chunk.js"></script></body></html>
|
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.32daf8f7.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.e5e999f3.chunk.js"></script><script src="/static/js/main.b4a5fae7.chunk.js"></script></body></html>
|
||||||
BIN
portal-ui/build/minioTier.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
@@ -1,2 +1,2 @@
|
|||||||
.ReactVirtualized__Table__headerRow{font-weight:700;text-transform:uppercase}.ReactVirtualized__Table__headerRow,.ReactVirtualized__Table__row{display:flex;flex-direction:row;align-items:center}.ReactVirtualized__Table__headerTruncatedText{display:inline-block;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ReactVirtualized__Table__headerColumn,.ReactVirtualized__Table__rowColumn{margin-right:10px;min-width:0}.ReactVirtualized__Table__rowColumn{text-overflow:ellipsis;white-space:nowrap}.ReactVirtualized__Table__headerColumn:first-of-type,.ReactVirtualized__Table__rowColumn:first-of-type{margin-left:10px}.ReactVirtualized__Table__sortableHeaderColumn{cursor:pointer}.ReactVirtualized__Table__sortableHeaderIconContainer{display:flex;align-items:center}.ReactVirtualized__Table__sortableHeaderIcon{flex:0 0 24px;height:1em;width:1em;fill:currentColor}.react-grid-layout{position:relative;transition:height .2s ease}.react-grid-item{transition:all .2s ease;transition-property:left,top}.react-grid-item img{pointer-events:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.react-grid-item.cssTransforms{transition-property:transform}.react-grid-item.resizing{z-index:1;will-change:width,height}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform}.react-grid-item.dropping{visibility:hidden}.react-grid-item.react-grid-placeholder{background:red;opacity:.2;transition-duration:.1s;z-index:2;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px}.react-grid-item>.react-resizable-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0,0,0,.4);border-bottom:2px solid rgba(0,0,0,.4)}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e,.react-grid-item>.react-resizable-handle.react-resizable-handle-w{top:50%;margin-top:-10px;cursor:ew-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.react-resizable{position:relative}.react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZ6IiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+");background-position:100% 100%;padding:0 3px 3px 0}.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-resizable-handle-e,.react-resizable-handle-w{top:50%;margin-top:-10px;cursor:ew-resize}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}
|
.ReactVirtualized__Table__headerRow{font-weight:700;text-transform:uppercase}.ReactVirtualized__Table__headerRow,.ReactVirtualized__Table__row{display:flex;flex-direction:row;align-items:center}.ReactVirtualized__Table__headerTruncatedText{display:inline-block;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ReactVirtualized__Table__headerColumn,.ReactVirtualized__Table__rowColumn{margin-right:10px;min-width:0}.ReactVirtualized__Table__rowColumn{text-overflow:ellipsis;white-space:nowrap}.ReactVirtualized__Table__headerColumn:first-of-type,.ReactVirtualized__Table__rowColumn:first-of-type{margin-left:10px}.ReactVirtualized__Table__sortableHeaderColumn{cursor:pointer}.ReactVirtualized__Table__sortableHeaderIconContainer{display:flex;align-items:center}.ReactVirtualized__Table__sortableHeaderIcon{flex:0 0 24px;height:1em;width:1em;fill:currentColor}.react-grid-layout{position:relative;transition:height .2s ease}.react-grid-item{transition:all .2s ease;transition-property:left,top}.react-grid-item img{pointer-events:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.react-grid-item.cssTransforms{transition-property:transform}.react-grid-item.resizing{z-index:1;will-change:width,height}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform}.react-grid-item.dropping{visibility:hidden}.react-grid-item.react-grid-placeholder{background:red;opacity:.2;transition-duration:.1s;z-index:2;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px}.react-grid-item>.react-resizable-handle:after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0,0,0,.4);border-bottom:2px solid rgba(0,0,0,.4)}.react-resizable-hide>.react-resizable-handle{display:none}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e,.react-grid-item>.react-resizable-handle.react-resizable-handle-w{top:50%;margin-top:-10px;cursor:ew-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}.react-resizable{position:relative}.react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgd2lkdGg9IjYiIGhlaWdodD0iNiI+PHBhdGggZD0iTTYgNkgwVjQuMmg0LjJWMEg2djZ6IiBvcGFjaXR5PSIuMzAyIi8+PC9zdmc+");background-position:100% 100%;padding:0 3px 3px 0}.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg)}.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize}.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg)}.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg)}.react-resizable-handle-e,.react-resizable-handle-w{top:50%;margin-top:-10px;cursor:ew-resize}.react-resizable-handle-w{left:0;transform:rotate(135deg)}.react-resizable-handle-e{right:0;transform:rotate(315deg)}.react-resizable-handle-n,.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize}.react-resizable-handle-n{top:0;transform:rotate(225deg)}.react-resizable-handle-s{bottom:0;transform:rotate(45deg)}
|
||||||
/*# sourceMappingURL=2.f324abd6.chunk.css.map */
|
/*# sourceMappingURL=2.32daf8f7.chunk.css.map */
|
||||||
3
portal-ui/build/static/js/2.e5e999f3.chunk.js
Normal file
1
portal-ui/build/static/js/2.e5e999f3.chunk.js.map
Normal file
2
portal-ui/build/static/js/main.b4a5fae7.chunk.js
Normal file
1
portal-ui/build/static/js/main.b4a5fae7.chunk.js.map
Normal file
BIN
portal-ui/public/amazon.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
portal-ui/public/azure.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
portal-ui/public/gcs.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
portal-ui/public/minioTier.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
@@ -0,0 +1,469 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import React, { useState, useEffect, Fragment } from "react";
|
||||||
|
import get from "lodash/get";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
|
import { Button, LinearProgress } from "@material-ui/core";
|
||||||
|
import Grid from "@material-ui/core/Grid";
|
||||||
|
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
|
||||||
|
import { setModalErrorSnackMessage } from "../../../../actions";
|
||||||
|
import {
|
||||||
|
ITierResponse,
|
||||||
|
ITierElement,
|
||||||
|
} from "../../Configurations/TiersConfiguration/types";
|
||||||
|
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
|
||||||
|
import FormSwitchWrapper from "../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
|
||||||
|
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
|
||||||
|
import api from "../../../../common/api";
|
||||||
|
import DateSelector from "../../Common/FormComponents/DateSelector/DateSelector";
|
||||||
|
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
|
||||||
|
import QueryMultiSelector from "../../Common/FormComponents/QueryMultiSelector/QueryMultiSelector";
|
||||||
|
import RadioGroupSelector from "../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
|
||||||
|
|
||||||
|
interface IReplicationModal {
|
||||||
|
open: boolean;
|
||||||
|
closeModalAndRefresh: (refresh: boolean) => any;
|
||||||
|
classes: any;
|
||||||
|
bucketName: string;
|
||||||
|
setModalErrorSnackMessage: typeof setModalErrorSnackMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ITiersDropDown {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = (theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
minTableHeader: {
|
||||||
|
color: "#393939",
|
||||||
|
"& tr": {
|
||||||
|
"& th": {
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
buttonContainer: {
|
||||||
|
textAlign: "right",
|
||||||
|
},
|
||||||
|
...modalBasic,
|
||||||
|
});
|
||||||
|
|
||||||
|
const AddLifecycleModal = ({
|
||||||
|
open,
|
||||||
|
closeModalAndRefresh,
|
||||||
|
classes,
|
||||||
|
bucketName,
|
||||||
|
setModalErrorSnackMessage,
|
||||||
|
}: IReplicationModal) => {
|
||||||
|
const [loadingTiers, setLoadingTiers] = useState<boolean>(true);
|
||||||
|
const [tiersList, setTiersList] = useState<ITiersDropDown[]>([]);
|
||||||
|
const [addLoading, setAddLoading] = useState(false);
|
||||||
|
const [prefix, setPrefix] = useState("");
|
||||||
|
const [tags, setTags] = useState<string>("");
|
||||||
|
const [storageClass, setStorageClass] = useState("");
|
||||||
|
const [NCTransitionSC, setNCTransitionSC] = useState("");
|
||||||
|
const [expiredObjectDM, setExpiredObjectDM] = useState<boolean>(false);
|
||||||
|
const [NCExpirationDays, setNCExpirationDays] = useState<string>("0");
|
||||||
|
const [NCTransitionDays, setNCTransitionDays] = useState<string>("0");
|
||||||
|
const [ilmType, setIlmType] = useState<string>("expiry");
|
||||||
|
const [expiryType, setExpiryType] = useState<string>("date");
|
||||||
|
const [expiryDays, setExpiryDays] = useState<string>("0");
|
||||||
|
const [expiryDate, setExpiryDate] = useState<string>("");
|
||||||
|
const [transitionDays, setTransitionDays] = useState<string>("0");
|
||||||
|
const [transitionDate, setTransitionDate] = useState<string>("");
|
||||||
|
const [transitionType, setTransitionType] = useState<string>("date");
|
||||||
|
const [isFormValid, setIsFormValid] = useState<boolean>(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (loadingTiers) {
|
||||||
|
api
|
||||||
|
.invoke("GET", `/api/v1/admin/tiers`)
|
||||||
|
.then((res: ITierResponse) => {
|
||||||
|
const tiersList: ITierElement[] | null = get(res, "items", []);
|
||||||
|
|
||||||
|
if (tiersList !== null && tiersList.length >= 1) {
|
||||||
|
const objList = tiersList.map((tier: ITierElement) => {
|
||||||
|
const tierType = tier.type;
|
||||||
|
const value = get(tier, `${tierType}.name`, "");
|
||||||
|
|
||||||
|
return { label: value, value: value };
|
||||||
|
});
|
||||||
|
|
||||||
|
setTiersList(objList);
|
||||||
|
if (objList.length > 0) {
|
||||||
|
setStorageClass(objList[0].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setLoadingTiers(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setLoadingTiers(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [loadingTiers]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let valid = true;
|
||||||
|
|
||||||
|
if (ilmType === "expiry") {
|
||||||
|
if (expiryType === "date" && expiryDate === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (expiryType === "days" && parseInt(expiryDays) < 1) {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (transitionType === "date" && transitionDate === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (transitionType === "days" && parseInt(transitionDays) < 1) {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (storageClass === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setIsFormValid(valid);
|
||||||
|
}, [
|
||||||
|
ilmType,
|
||||||
|
expiryType,
|
||||||
|
expiryDate,
|
||||||
|
expiryDays,
|
||||||
|
transitionType,
|
||||||
|
transitionDate,
|
||||||
|
transitionDays,
|
||||||
|
storageClass,
|
||||||
|
]);
|
||||||
|
|
||||||
|
const addRecord = () => {
|
||||||
|
let rules = {};
|
||||||
|
|
||||||
|
if (ilmType === "expiry") {
|
||||||
|
let expiry = {};
|
||||||
|
|
||||||
|
if (expiryType === "date") {
|
||||||
|
expiry = {
|
||||||
|
expiry_date: `${expiryDate}T23:59:59Z`,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
expiry = {
|
||||||
|
expiry_days: parseInt(expiryDays),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
rules = {
|
||||||
|
...expiry,
|
||||||
|
noncurrentversion_expiration_days: parseInt(NCExpirationDays),
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
let transition = {};
|
||||||
|
|
||||||
|
if (transitionType === "date") {
|
||||||
|
transition = {
|
||||||
|
transition_date: `${transitionDate}T23:59:59Z`,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
transition = {
|
||||||
|
transition_days: parseInt(transitionDays),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
rules = {
|
||||||
|
...transition,
|
||||||
|
noncurrentversion_transition_days: parseInt(NCTransitionDays),
|
||||||
|
noncurrentversion_transition_storage_class: NCTransitionSC,
|
||||||
|
storage_class: storageClass,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const lifecycleInsert = {
|
||||||
|
prefix,
|
||||||
|
tags,
|
||||||
|
expired_object_delete_marker: expiredObjectDM,
|
||||||
|
...rules,
|
||||||
|
};
|
||||||
|
|
||||||
|
api
|
||||||
|
.invoke(
|
||||||
|
"POST",
|
||||||
|
`/api/v1/buckets/${bucketName}/lifecycle`,
|
||||||
|
lifecycleInsert
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
setAddLoading(false);
|
||||||
|
closeModalAndRefresh(true);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setAddLoading(false);
|
||||||
|
setModalErrorSnackMessage(err);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalWrapper
|
||||||
|
modalOpen={open}
|
||||||
|
onClose={() => {
|
||||||
|
closeModalAndRefresh(false);
|
||||||
|
}}
|
||||||
|
title="Add Lifecycle Rule"
|
||||||
|
>
|
||||||
|
{loadingTiers && (
|
||||||
|
<Grid container className={classes.loadingBox}>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<LinearProgress />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!loadingTiers && (
|
||||||
|
<form
|
||||||
|
noValidate
|
||||||
|
autoComplete="off"
|
||||||
|
onSubmit={(e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setAddLoading(true);
|
||||||
|
addRecord();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid container>
|
||||||
|
<Grid item xs={12} className={classes.formScrollable}>
|
||||||
|
<h3>Lifecycle Configuration</h3>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<RadioGroupSelector
|
||||||
|
currentSelection={ilmType}
|
||||||
|
id="quota_type"
|
||||||
|
name="quota_type"
|
||||||
|
label="ILM Rule"
|
||||||
|
onChange={(e: React.ChangeEvent<{ value: unknown }>) => {
|
||||||
|
setIlmType(e.target.value as string);
|
||||||
|
}}
|
||||||
|
selectorOptions={[
|
||||||
|
{ value: "expiry", label: "Expiry" },
|
||||||
|
{ value: "transition", label: "Transition" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
{ilmType === "expiry" ? (
|
||||||
|
<Fragment>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<RadioGroupSelector
|
||||||
|
currentSelection={expiryType}
|
||||||
|
id="expiryType"
|
||||||
|
name="expiryType"
|
||||||
|
label="Expiry Type"
|
||||||
|
onChange={(e: React.ChangeEvent<{ value: unknown }>) => {
|
||||||
|
setExpiryType(e.target.value as string);
|
||||||
|
}}
|
||||||
|
selectorOptions={[
|
||||||
|
{ value: "date", label: "Date" },
|
||||||
|
{ value: "days", label: "Days" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
{expiryType === "date" ? (
|
||||||
|
<DateSelector
|
||||||
|
id="expiry_date"
|
||||||
|
label="Expiry Date"
|
||||||
|
value={expiryDate}
|
||||||
|
borderBottom={true}
|
||||||
|
onDateChange={(date: string, isValid: boolean) => {
|
||||||
|
if (isValid) {
|
||||||
|
setExpiryDate(date);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<InputBoxWrapper
|
||||||
|
type="number"
|
||||||
|
id="expiry_days"
|
||||||
|
name="expiry_days"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setExpiryDays(e.target.value);
|
||||||
|
}}
|
||||||
|
label="Expiry Days"
|
||||||
|
value={expiryDays}
|
||||||
|
min="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<InputBoxWrapper
|
||||||
|
type="number"
|
||||||
|
id="noncurrentversion_expiration_days"
|
||||||
|
name="noncurrentversion_expiration_days"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setNCExpirationDays(e.target.value);
|
||||||
|
}}
|
||||||
|
label="Non-current Expiration Days"
|
||||||
|
value={NCExpirationDays}
|
||||||
|
min="0"
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</Fragment>
|
||||||
|
) : (
|
||||||
|
<Fragment>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<RadioGroupSelector
|
||||||
|
currentSelection={transitionType}
|
||||||
|
id="transitionType"
|
||||||
|
name="transitionType"
|
||||||
|
label="Transition Type"
|
||||||
|
onChange={(e: React.ChangeEvent<{ value: unknown }>) => {
|
||||||
|
setTransitionType(e.target.value as string);
|
||||||
|
}}
|
||||||
|
selectorOptions={[
|
||||||
|
{ value: "date", label: "Date" },
|
||||||
|
{ value: "days", label: "Days" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
{transitionType === "date" ? (
|
||||||
|
<DateSelector
|
||||||
|
id="transition_date"
|
||||||
|
label="Transition Date"
|
||||||
|
value={transitionDate}
|
||||||
|
borderBottom={true}
|
||||||
|
onDateChange={(date: string, isValid: boolean) => {
|
||||||
|
if (isValid) {
|
||||||
|
setTransitionDate(date);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<InputBoxWrapper
|
||||||
|
type="number"
|
||||||
|
id="transition_days"
|
||||||
|
name="transition_days"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setTransitionDays(e.target.value);
|
||||||
|
}}
|
||||||
|
label="Transition Days"
|
||||||
|
value={transitionDays}
|
||||||
|
min="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<InputBoxWrapper
|
||||||
|
type="number"
|
||||||
|
id="noncurrentversion_transition_days"
|
||||||
|
name="noncurrentversion_transition_days"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setNCTransitionDays(e.target.value);
|
||||||
|
}}
|
||||||
|
label="Non-current Transition Days"
|
||||||
|
value={NCTransitionDays}
|
||||||
|
min="0"
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="noncurrentversion_t_SC"
|
||||||
|
name="noncurrentversion_t_SC"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setNCTransitionSC(e.target.value);
|
||||||
|
}}
|
||||||
|
placeholder="Set Non-current Version Transition Storage Class"
|
||||||
|
label="Non-current Version Transition Storage Class"
|
||||||
|
value={NCTransitionSC}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<SelectWrapper
|
||||||
|
label="Storage Class"
|
||||||
|
id="storage_class"
|
||||||
|
name="storage_class"
|
||||||
|
value={storageClass}
|
||||||
|
onChange={(e: React.ChangeEvent<{ value: unknown }>) => {
|
||||||
|
setStorageClass(e.target.value as string);
|
||||||
|
}}
|
||||||
|
options={tiersList}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
<h3>File Configuration</h3>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="prefix"
|
||||||
|
name="prefix"
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setPrefix(e.target.value);
|
||||||
|
}}
|
||||||
|
label="Prefix"
|
||||||
|
value={prefix}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<QueryMultiSelector
|
||||||
|
name="tags"
|
||||||
|
label="Tags"
|
||||||
|
elements={""}
|
||||||
|
onChange={(vl: string) => {
|
||||||
|
setTags(vl);
|
||||||
|
}}
|
||||||
|
keyPlaceholder="Tag Key"
|
||||||
|
valuePlaceholder="Tag Value"
|
||||||
|
withBorder
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<FormSwitchWrapper
|
||||||
|
value="expired_delete_marker"
|
||||||
|
id="expired_delete_marker"
|
||||||
|
name="expired_delete_marker"
|
||||||
|
checked={expiredObjectDM}
|
||||||
|
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setExpiredObjectDM(event.target.checked);
|
||||||
|
}}
|
||||||
|
label={"Expired Object Delete Marker"}
|
||||||
|
indicatorLabels={["On", "Off"]}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} className={classes.buttonContainer}>
|
||||||
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
disabled={addLoading || !isFormValid}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
{addLoading && (
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<LinearProgress />
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
</form>
|
||||||
|
)}
|
||||||
|
</ModalWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const connector = connect(null, {
|
||||||
|
setModalErrorSnackMessage,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default withStyles(styles)(connector(AddLifecycleModal));
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import Grid from "@material-ui/core/Grid";
|
||||||
|
import { Button, LinearProgress } from "@material-ui/core";
|
||||||
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
|
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
|
||||||
|
import { setModalErrorSnackMessage } from "../../../../actions";
|
||||||
|
import api from "../../../../common/api";
|
||||||
|
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
|
||||||
|
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
|
||||||
|
import FormSwitchWrapper from "../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
|
||||||
|
import QueryMultiSelector from "../../Common/FormComponents/QueryMultiSelector/QueryMultiSelector";
|
||||||
|
import { LifeCycleItem } from "../types";
|
||||||
|
|
||||||
|
const styles = (theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
strongText: {
|
||||||
|
fontWeight: 700,
|
||||||
|
},
|
||||||
|
keyName: {
|
||||||
|
marginLeft: 5,
|
||||||
|
},
|
||||||
|
buttonContainer: {
|
||||||
|
textAlign: "right",
|
||||||
|
},
|
||||||
|
...modalBasic,
|
||||||
|
});
|
||||||
|
|
||||||
|
interface IAddUserContentProps {
|
||||||
|
classes: any;
|
||||||
|
closeModalAndRefresh: (reload: boolean) => void;
|
||||||
|
selectedBucket: string;
|
||||||
|
lifecycle: LifeCycleItem;
|
||||||
|
open: boolean;
|
||||||
|
setModalErrorSnackMessage: typeof setModalErrorSnackMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
const EditLifecycleConfiguration = ({
|
||||||
|
classes,
|
||||||
|
closeModalAndRefresh,
|
||||||
|
selectedBucket,
|
||||||
|
lifecycle,
|
||||||
|
open,
|
||||||
|
setModalErrorSnackMessage,
|
||||||
|
}: IAddUserContentProps) => {
|
||||||
|
const [addLoading, setAddLoading] = useState<boolean>(false);
|
||||||
|
const [tags, setTags] = useState<string>("");
|
||||||
|
const [enabled, setEnabled] = useState<boolean>(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (lifecycle.status === "Enabled") {
|
||||||
|
setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lifecycle.tags) {
|
||||||
|
const tgs = lifecycle.tags.reduce(
|
||||||
|
(stringLab: string, currItem: any, index: number) => {
|
||||||
|
return `${stringLab}${index !== 0 ? "&" : ""}${currItem.key}=${
|
||||||
|
currItem.value
|
||||||
|
}`;
|
||||||
|
},
|
||||||
|
""
|
||||||
|
);
|
||||||
|
|
||||||
|
setTags(tgs);
|
||||||
|
}
|
||||||
|
}, [lifecycle]);
|
||||||
|
|
||||||
|
const saveRecord = (event: React.FormEvent) => {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (addLoading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setAddLoading(true);
|
||||||
|
if (selectedBucket !== null && lifecycle !== null) {
|
||||||
|
api
|
||||||
|
.invoke(
|
||||||
|
"PUT",
|
||||||
|
`/api/v1/buckets/${selectedBucket}/lifecycle/${lifecycle.id}`,
|
||||||
|
{
|
||||||
|
disable: !enabled,
|
||||||
|
tags: tags,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
setAddLoading(false);
|
||||||
|
closeModalAndRefresh(true);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setAddLoading(false);
|
||||||
|
setModalErrorSnackMessage(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalWrapper
|
||||||
|
onClose={() => {
|
||||||
|
closeModalAndRefresh(false);
|
||||||
|
}}
|
||||||
|
modalOpen={open}
|
||||||
|
title={"Edit Lifecycle Configuration"}
|
||||||
|
>
|
||||||
|
<div className={classes.floatingEnabled}>
|
||||||
|
<FormSwitchWrapper
|
||||||
|
indicatorLabels={["Enabled", "Disabled"]}
|
||||||
|
checked={enabled}
|
||||||
|
value={"user_enabled"}
|
||||||
|
id="user-status"
|
||||||
|
name="user-status"
|
||||||
|
onChange={(e) => {
|
||||||
|
setEnabled(e.target.checked);
|
||||||
|
}}
|
||||||
|
switchOnly
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<React.Fragment>
|
||||||
|
<form
|
||||||
|
noValidate
|
||||||
|
autoComplete="off"
|
||||||
|
onSubmit={(e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
saveRecord(e);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid container>
|
||||||
|
<Grid item xs={12} className={classes.formScrollable}>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="id"
|
||||||
|
name="id"
|
||||||
|
label="Id"
|
||||||
|
value={lifecycle.id}
|
||||||
|
onChange={() => {}}
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<QueryMultiSelector
|
||||||
|
name="tags"
|
||||||
|
label="Tags"
|
||||||
|
elements={tags}
|
||||||
|
onChange={(vl: string) => {
|
||||||
|
setTags(vl);
|
||||||
|
}}
|
||||||
|
keyPlaceholder="Tag Key"
|
||||||
|
valuePlaceholder="Tag Value"
|
||||||
|
withBorder
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} className={classes.buttonContainer}>
|
||||||
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
disabled={addLoading}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
{addLoading && (
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<LinearProgress />
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
</form>
|
||||||
|
</React.Fragment>
|
||||||
|
</ModalWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = {
|
||||||
|
setModalErrorSnackMessage,
|
||||||
|
};
|
||||||
|
|
||||||
|
const connector = connect(null, mapDispatchToProps);
|
||||||
|
|
||||||
|
export default withStyles(styles)(connector(EditLifecycleConfiguration));
|
||||||
@@ -18,6 +18,7 @@ import React, { useEffect, useState, Fragment } from "react";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
import { Button, IconButton } from "@material-ui/core";
|
import { Button, IconButton } from "@material-ui/core";
|
||||||
|
import * as reactMoment from "react-moment";
|
||||||
import get from "lodash/get";
|
import get from "lodash/get";
|
||||||
import Paper from "@material-ui/core/Paper";
|
import Paper from "@material-ui/core/Paper";
|
||||||
import Grid from "@material-ui/core/Grid";
|
import Grid from "@material-ui/core/Grid";
|
||||||
@@ -40,6 +41,7 @@ import {
|
|||||||
BucketReplicationRuleDeleteMarker,
|
BucketReplicationRuleDeleteMarker,
|
||||||
BucketVersioning,
|
BucketVersioning,
|
||||||
HasPermissionResponse,
|
HasPermissionResponse,
|
||||||
|
LifeCycleItem,
|
||||||
} from "../types";
|
} from "../types";
|
||||||
import { CreateIcon } from "../../../../icons";
|
import { CreateIcon } from "../../../../icons";
|
||||||
import { niceBytes } from "../../../../common/utils";
|
import { niceBytes } from "../../../../common/utils";
|
||||||
@@ -47,6 +49,9 @@ import { containerForHeader } from "../../Common/FormComponents/common/styleLibr
|
|||||||
import { setErrorSnackMessage } from "../../../../actions";
|
import { setErrorSnackMessage } from "../../../../actions";
|
||||||
import { Policy } from "../../Policies/types";
|
import { Policy } from "../../Policies/types";
|
||||||
import { User } from "../../Users/types";
|
import { User } from "../../Users/types";
|
||||||
|
import { AppState } from "../../../../store";
|
||||||
|
import { ISessionResponse } from "../../types";
|
||||||
|
import SetAccessPolicy from "./SetAccessPolicy";
|
||||||
import SetRetentionConfig from "./SetRetentionConfig";
|
import SetRetentionConfig from "./SetRetentionConfig";
|
||||||
import AddEvent from "./AddEvent";
|
import AddEvent from "./AddEvent";
|
||||||
import DeleteEvent from "./DeleteEvent";
|
import DeleteEvent from "./DeleteEvent";
|
||||||
@@ -58,8 +63,9 @@ import PencilIcon from "../../Common/TableWrapper/TableActionIcons/PencilIcon";
|
|||||||
import EnableVersioningModal from "./EnableVersioningModal";
|
import EnableVersioningModal from "./EnableVersioningModal";
|
||||||
import UsageIcon from "../../../../icons/UsageIcon";
|
import UsageIcon from "../../../../icons/UsageIcon";
|
||||||
import AddPolicy from "../../Policies/AddPolicy";
|
import AddPolicy from "../../Policies/AddPolicy";
|
||||||
import SetAccessPolicy from "./SetAccessPolicy";
|
|
||||||
import DeleteReplicationRule from "../ViewBucket/DeleteReplicationRule";
|
import DeleteReplicationRule from "../ViewBucket/DeleteReplicationRule";
|
||||||
|
import EditLifecycleConfiguration from "./EditLifecycleConfiguration";
|
||||||
|
import AddLifecycleModal from "./AddLifecycleModal";
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
const styles = (theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
@@ -181,6 +187,7 @@ interface IViewBucketProps {
|
|||||||
classes: any;
|
classes: any;
|
||||||
match: any;
|
match: any;
|
||||||
setErrorSnackMessage: typeof setErrorSnackMessage;
|
setErrorSnackMessage: typeof setErrorSnackMessage;
|
||||||
|
session: ISessionResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface TabPanelProps {
|
interface TabPanelProps {
|
||||||
@@ -217,6 +224,7 @@ const ViewBucket = ({
|
|||||||
classes,
|
classes,
|
||||||
match,
|
match,
|
||||||
setErrorSnackMessage,
|
setErrorSnackMessage,
|
||||||
|
session,
|
||||||
}: IViewBucketProps) => {
|
}: IViewBucketProps) => {
|
||||||
const [info, setInfo] = useState<BucketInfo | null>(null);
|
const [info, setInfo] = useState<BucketInfo | null>(null);
|
||||||
const [records, setRecords] = useState<BucketEvent[]>([]);
|
const [records, setRecords] = useState<BucketEvent[]>([]);
|
||||||
@@ -245,6 +253,7 @@ const ViewBucket = ({
|
|||||||
setEnableEncryptionScreenOpen,
|
setEnableEncryptionScreenOpen,
|
||||||
] = useState<boolean>(false);
|
] = useState<boolean>(false);
|
||||||
const [deleteOpen, setDeleteOpen] = useState<boolean>(false);
|
const [deleteOpen, setDeleteOpen] = useState<boolean>(false);
|
||||||
|
const [editLifecycleOpen, setEditLifecycleOpen] = useState<boolean>(false);
|
||||||
const [selectedEvent, setSelectedEvent] = useState<BucketEvent | null>(null);
|
const [selectedEvent, setSelectedEvent] = useState<BucketEvent | null>(null);
|
||||||
const [bucketSize, setBucketSize] = useState<string>("0");
|
const [bucketSize, setBucketSize] = useState<string>("0");
|
||||||
const [openSetReplication, setOpenSetReplication] = useState<boolean>(false);
|
const [openSetReplication, setOpenSetReplication] = useState<boolean>(false);
|
||||||
@@ -265,6 +274,9 @@ const ViewBucket = ({
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
const [selectedRRule, setSelectedRRule] = useState<string>("");
|
const [selectedRRule, setSelectedRRule] = useState<string>("");
|
||||||
|
const [loadingLifecycle, setLoadingLifecycle] = useState<boolean>(true);
|
||||||
|
const [lifecycleRecords, setLifecycleRecords] = useState<LifeCycleItem[]>([]);
|
||||||
|
const [addLifecycleOpen, setAddLifecycleOpen] = useState<boolean>(false);
|
||||||
|
|
||||||
// check the permissions for creating bucket
|
// check the permissions for creating bucket
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -320,6 +332,7 @@ const ViewBucket = ({
|
|||||||
}, [loadingPerms, setErrorSnackMessage]);
|
}, [loadingPerms, setErrorSnackMessage]);
|
||||||
|
|
||||||
const bucketName = match.params["bucketName"];
|
const bucketName = match.params["bucketName"];
|
||||||
|
const ilmEnabled = session.features?.indexOf("ilm") > -1;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (loadingEvents) {
|
if (loadingEvents) {
|
||||||
@@ -470,6 +483,22 @@ const ViewBucket = ({
|
|||||||
const setBucketVersioning = () => {
|
const setBucketVersioning = () => {
|
||||||
setEnableVersioningOpen(true);
|
setEnableVersioningOpen(true);
|
||||||
};
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
if (loadingLifecycle) {
|
||||||
|
api
|
||||||
|
.invoke("GET", `/api/v1/buckets/${bucketName}/lifecycle`)
|
||||||
|
.then((res: any) => {
|
||||||
|
const records = get(res, "lifecycle", []);
|
||||||
|
|
||||||
|
setLifecycleRecords(records || []);
|
||||||
|
setLoadingLifecycle(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
setLoadingLifecycle(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [loadingLifecycle, setLoadingLifecycle, bucketName]);
|
||||||
|
|
||||||
const loadAllBucketData = () => {
|
const loadAllBucketData = () => {
|
||||||
setLoadingBucket(true);
|
setLoadingBucket(true);
|
||||||
@@ -524,6 +553,13 @@ const ViewBucket = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const closeEditLCAndRefresh = (refresh: boolean) => {
|
||||||
|
setEditLifecycleOpen(false);
|
||||||
|
if (refresh) {
|
||||||
|
setLoadingLifecycle(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const confirmDeleteEvent = (evnt: BucketEvent) => {
|
const confirmDeleteEvent = (evnt: BucketEvent) => {
|
||||||
setDeleteOpen(true);
|
setDeleteOpen(true);
|
||||||
setSelectedEvent(evnt);
|
setSelectedEvent(evnt);
|
||||||
@@ -556,7 +592,7 @@ const ViewBucket = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ruleDelDisplay = (events: BucketReplicationRuleDeleteMarker) => {
|
const ruleDelDisplay = (events: BucketReplicationRuleDeleteMarker) => {
|
||||||
return <Fragment>{events.status}</Fragment>;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const setOpenReplicationOpen = (open = false) => {
|
const setOpenReplicationOpen = (open = false) => {
|
||||||
@@ -571,6 +607,13 @@ const ViewBucket = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const closeAddLCAndRefresh = (refresh: boolean) => {
|
||||||
|
setAddLifecycleOpen(false);
|
||||||
|
if (refresh) {
|
||||||
|
setLoadingLifecycle(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleEncryptionCheckbox = (
|
const handleEncryptionCheckbox = (
|
||||||
event: React.ChangeEvent<HTMLInputElement>
|
event: React.ChangeEvent<HTMLInputElement>
|
||||||
) => {
|
) => {
|
||||||
@@ -603,6 +646,64 @@ const ViewBucket = ({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const expirationRender = (expiration: any) => {
|
||||||
|
if (expiration.days) {
|
||||||
|
return `${expiration.days} day${expiration.days > 1 ? "s" : ""}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expiration.date === "0001-01-01T00:00:00Z") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return <reactMoment.default>{expiration.date}</reactMoment.default>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const transitionRender = (transition: any) => {
|
||||||
|
if (transition.days) {
|
||||||
|
return `${transition.days} day${transition.days > 1 ? "s" : ""}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transition.date === "0001-01-01T00:00:00Z") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return <reactMoment.default>{transition.date}</reactMoment.default>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderStorageClass = (objectST: any) => {
|
||||||
|
const stClass = get(objectST, "transition.storage_class", "");
|
||||||
|
|
||||||
|
return stClass;
|
||||||
|
};
|
||||||
|
|
||||||
|
const lifecycleColumns = [
|
||||||
|
{ label: "ID", elementKey: "id" },
|
||||||
|
{
|
||||||
|
label: "Prefix",
|
||||||
|
elementKey: "prefix",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Status",
|
||||||
|
elementKey: "status",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Expiration",
|
||||||
|
elementKey: "expiration",
|
||||||
|
renderFunction: expirationRender,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Transition",
|
||||||
|
elementKey: "transition",
|
||||||
|
renderFunction: transitionRender,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Storage Class",
|
||||||
|
elementKey: "storage_class",
|
||||||
|
renderFunction: renderStorageClass,
|
||||||
|
renderFullObject: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
{addScreenOpen && (
|
{addScreenOpen && (
|
||||||
@@ -672,6 +773,24 @@ const ViewBucket = ({
|
|||||||
ruleToDelete={selectedRRule}
|
ruleToDelete={selectedRRule}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{editLifecycleOpen && (
|
||||||
|
<EditLifecycleConfiguration
|
||||||
|
open={editLifecycleOpen}
|
||||||
|
closeModalAndRefresh={closeEditLCAndRefresh}
|
||||||
|
selectedBucket={bucketName}
|
||||||
|
lifecycle={{
|
||||||
|
id: "",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{addLifecycleOpen && (
|
||||||
|
<AddLifecycleModal
|
||||||
|
open={addLifecycleOpen}
|
||||||
|
bucketName={bucketName}
|
||||||
|
closeModalAndRefresh={closeAddLCAndRefresh}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<PageHeader label={`Bucket > ${match.params["bucketName"]}`} />
|
<PageHeader label={`Bucket > ${match.params["bucketName"]}`} />
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item xs={12} className={classes.container}>
|
<Grid item xs={12} className={classes.container}>
|
||||||
@@ -806,7 +925,7 @@ const ViewBucket = ({
|
|||||||
<br />
|
<br />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid container item xs={12}>
|
<Grid container item xs={12}>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={8}>
|
||||||
<Tabs
|
<Tabs
|
||||||
value={curTab}
|
value={curTab}
|
||||||
onChange={(e: React.ChangeEvent<{}>, newValue: number) => {
|
onChange={(e: React.ChangeEvent<{}>, newValue: number) => {
|
||||||
@@ -822,9 +941,10 @@ const ViewBucket = ({
|
|||||||
)}
|
)}
|
||||||
<Tab label="Policies" {...a11yProps(2)} />
|
<Tab label="Policies" {...a11yProps(2)} />
|
||||||
<Tab label="Users" {...a11yProps(3)} />
|
<Tab label="Users" {...a11yProps(3)} />
|
||||||
|
{ilmEnabled && <Tab label="Lifecycle" {...a11yProps(4)} />}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6} className={classes.actionsTray}>
|
<Grid item xs={4} className={classes.actionsTray}>
|
||||||
{curTab === 0 && (
|
{curTab === 0 && (
|
||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
@@ -855,6 +975,19 @@ const ViewBucket = ({
|
|||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
|
{curTab === 4 && (
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
startIcon={<CreateIcon />}
|
||||||
|
size="medium"
|
||||||
|
onClick={() => {
|
||||||
|
setAddLifecycleOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Add Lifecycle Rule
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
@@ -925,6 +1058,17 @@ const ViewBucket = ({
|
|||||||
idField="accessKey"
|
idField="accessKey"
|
||||||
/>
|
/>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
<TabPanel index={4} value={curTab}>
|
||||||
|
<TableWrapper
|
||||||
|
itemActions={[]}
|
||||||
|
columns={lifecycleColumns}
|
||||||
|
isLoading={loadingLifecycle}
|
||||||
|
records={lifecycleRecords}
|
||||||
|
entityName="Lifecycle"
|
||||||
|
customEmptyMessage="There are no Lifecycle rules yet"
|
||||||
|
idField="id"
|
||||||
|
/>
|
||||||
|
</TabPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -932,7 +1076,11 @@ const ViewBucket = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const connector = connect(null, {
|
const mapState = (state: AppState) => ({
|
||||||
|
session: state.console.session,
|
||||||
|
});
|
||||||
|
|
||||||
|
const connector = connect(mapState, {
|
||||||
setErrorSnackMessage,
|
setErrorSnackMessage,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -142,3 +142,23 @@ export interface BulkReplicationItem {
|
|||||||
originBucket: string;
|
originBucket: string;
|
||||||
targetBucket: string;
|
targetBucket: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IExpirationLifecycle {
|
||||||
|
days: number;
|
||||||
|
date: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ITransitionLifecycle {
|
||||||
|
days: number;
|
||||||
|
date: string;
|
||||||
|
storage_class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LifeCycleItem {
|
||||||
|
id: string;
|
||||||
|
prefix?: string;
|
||||||
|
expiration?: IExpirationLifecycle;
|
||||||
|
transition?: ITransitionLifecycle;
|
||||||
|
tags?: any;
|
||||||
|
status?: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,251 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
import React, {
|
||||||
|
useState,
|
||||||
|
useEffect,
|
||||||
|
createRef,
|
||||||
|
useLayoutEffect,
|
||||||
|
ChangeEvent,
|
||||||
|
useRef,
|
||||||
|
} from "react";
|
||||||
|
import get from "lodash/get";
|
||||||
|
import debounce from "lodash/debounce";
|
||||||
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
|
import Grid from "@material-ui/core/Grid";
|
||||||
|
import HelpIcon from "@material-ui/icons/Help";
|
||||||
|
import { InputLabel, Tooltip } from "@material-ui/core";
|
||||||
|
import { fieldBasic, tooltipHelper } from "../common/styleLibrary";
|
||||||
|
import InputBoxWrapper from "../InputBoxWrapper/InputBoxWrapper";
|
||||||
|
import AddIcon from "../../../../../icons/AddIcon";
|
||||||
|
|
||||||
|
interface IQueryMultiSelector {
|
||||||
|
elements: string;
|
||||||
|
name: string;
|
||||||
|
label: string;
|
||||||
|
tooltip?: string;
|
||||||
|
keyPlaceholder?: string;
|
||||||
|
valuePlaceholder?: string;
|
||||||
|
classes: any;
|
||||||
|
withBorder?: boolean;
|
||||||
|
onChange: (elements: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = (theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
...fieldBasic,
|
||||||
|
...tooltipHelper,
|
||||||
|
inputWithBorder: {
|
||||||
|
border: "1px solid #EAEAEA",
|
||||||
|
padding: 15,
|
||||||
|
height: 150,
|
||||||
|
overflowY: "auto",
|
||||||
|
position: "relative",
|
||||||
|
marginTop: 15,
|
||||||
|
},
|
||||||
|
labelContainer: {
|
||||||
|
display: "flex",
|
||||||
|
},
|
||||||
|
lineInputBoxes: {
|
||||||
|
display: "flex",
|
||||||
|
},
|
||||||
|
queryDiv: {
|
||||||
|
alignSelf: "center",
|
||||||
|
margin: "0 4px",
|
||||||
|
fontWeight: 600,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const QueryMultiSelector = ({
|
||||||
|
elements,
|
||||||
|
name,
|
||||||
|
label,
|
||||||
|
tooltip = "",
|
||||||
|
keyPlaceholder = "",
|
||||||
|
valuePlaceholder = "",
|
||||||
|
onChange,
|
||||||
|
withBorder = false,
|
||||||
|
classes,
|
||||||
|
}: IQueryMultiSelector) => {
|
||||||
|
const [currentKeys, setCurrentKeys] = useState<string[]>([""]);
|
||||||
|
const [currentValues, setCurrentValues] = useState<string[]>([""]);
|
||||||
|
const bottomList = createRef<HTMLDivElement>();
|
||||||
|
|
||||||
|
// Use effect to get the initial values from props
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
currentKeys.length === 1 &&
|
||||||
|
currentKeys[0] === "" &&
|
||||||
|
currentValues.length === 1 &&
|
||||||
|
currentValues[0] === "" &&
|
||||||
|
elements &&
|
||||||
|
elements !== ""
|
||||||
|
) {
|
||||||
|
const elementsSplit = elements.split("&");
|
||||||
|
let keys = [];
|
||||||
|
let values = [];
|
||||||
|
|
||||||
|
elementsSplit.forEach((element: string) => {
|
||||||
|
const splittedVals = element.split("=");
|
||||||
|
if (splittedVals.length === 2) {
|
||||||
|
keys.push(splittedVals[0]);
|
||||||
|
values.push(splittedVals[1]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
keys.push("");
|
||||||
|
values.push("");
|
||||||
|
|
||||||
|
setCurrentKeys(keys);
|
||||||
|
setCurrentValues(values);
|
||||||
|
}
|
||||||
|
}, [currentKeys, currentValues, elements]);
|
||||||
|
|
||||||
|
// Use effect to send new values to onChange
|
||||||
|
useEffect(() => {
|
||||||
|
const refScroll = bottomList.current;
|
||||||
|
if (refScroll) {
|
||||||
|
refScroll.scrollIntoView(false);
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [currentKeys]);
|
||||||
|
|
||||||
|
// We avoid multiple re-renders / hang issue typing too fast
|
||||||
|
const firstUpdate = useRef(true);
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
if (firstUpdate.current) {
|
||||||
|
firstUpdate.current = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
debouncedOnChange();
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [currentKeys, currentValues]);
|
||||||
|
|
||||||
|
// If the last input is not empty, we add a new one
|
||||||
|
const addEmptyLine = () => {
|
||||||
|
if (
|
||||||
|
currentKeys[currentKeys.length - 1].trim() !== "" &&
|
||||||
|
currentValues[currentValues.length - 1].trim() !== ""
|
||||||
|
) {
|
||||||
|
const keysList = [...currentKeys];
|
||||||
|
const valuesList = [...currentValues];
|
||||||
|
|
||||||
|
keysList.push("");
|
||||||
|
valuesList.push("");
|
||||||
|
|
||||||
|
setCurrentKeys(keysList);
|
||||||
|
setCurrentValues(valuesList);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Onchange function for input box, we get the dataset-index & only update that value in the array
|
||||||
|
const onChangeKey = (e: ChangeEvent<HTMLInputElement>) => {
|
||||||
|
e.persist();
|
||||||
|
|
||||||
|
let updatedElement = [...currentKeys];
|
||||||
|
const index = get(e.target, "dataset.index", 0);
|
||||||
|
updatedElement[index] = e.target.value;
|
||||||
|
|
||||||
|
setCurrentKeys(updatedElement);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onChangeValue = (e: ChangeEvent<HTMLInputElement>) => {
|
||||||
|
e.persist();
|
||||||
|
|
||||||
|
let updatedElement = [...currentValues];
|
||||||
|
const index = get(e.target, "dataset.index", 0);
|
||||||
|
updatedElement[index] = e.target.value;
|
||||||
|
|
||||||
|
setCurrentValues(updatedElement);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Debounce for On Change
|
||||||
|
const debouncedOnChange = debounce(() => {
|
||||||
|
let queryString = "";
|
||||||
|
|
||||||
|
currentKeys.forEach((keyVal, index) => {
|
||||||
|
if (currentKeys[index] && currentValues[index]) {
|
||||||
|
let insertString = `${keyVal}=${currentValues[index]}`;
|
||||||
|
if (index !== 0) {
|
||||||
|
insertString = `&${insertString}`;
|
||||||
|
}
|
||||||
|
queryString = `${queryString}${insertString}`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onChange(queryString);
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
const inputs = currentValues.map((element, index) => {
|
||||||
|
return (
|
||||||
|
<Grid
|
||||||
|
item
|
||||||
|
xs={12}
|
||||||
|
className={classes.lineInputBoxes}
|
||||||
|
key={`query-pair-${name}-${index.toString()}`}
|
||||||
|
>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id={`${name}-key-${index.toString()}`}
|
||||||
|
label={""}
|
||||||
|
name={`${name}-${index.toString()}`}
|
||||||
|
value={currentKeys[index]}
|
||||||
|
onChange={onChangeKey}
|
||||||
|
index={index}
|
||||||
|
placeholder={keyPlaceholder}
|
||||||
|
/>
|
||||||
|
<span className={classes.queryDiv}>:</span>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id={`${name}-value-${index.toString()}`}
|
||||||
|
label={""}
|
||||||
|
name={`${name}-${index.toString()}`}
|
||||||
|
value={currentValues[index]}
|
||||||
|
onChange={onChangeValue}
|
||||||
|
index={index}
|
||||||
|
placeholder={valuePlaceholder}
|
||||||
|
overlayIcon={index === currentValues.length - 1 ? <AddIcon /> : null}
|
||||||
|
overlayAction={() => {
|
||||||
|
addEmptyLine();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<React.Fragment>
|
||||||
|
<Grid item xs={12} className={classes.fieldContainer}>
|
||||||
|
<InputLabel className={classes.inputLabel}>
|
||||||
|
<span>{label}</span>
|
||||||
|
{tooltip !== "" && (
|
||||||
|
<div className={classes.tooltipContainer}>
|
||||||
|
<Tooltip title={tooltip} placement="top-start">
|
||||||
|
<HelpIcon className={classes.tooltip} />
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</InputLabel>
|
||||||
|
<Grid
|
||||||
|
item
|
||||||
|
xs={12}
|
||||||
|
className={`${withBorder ? classes.inputWithBorder : ""}`}
|
||||||
|
>
|
||||||
|
{inputs}
|
||||||
|
<div ref={bottomList} />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</React.Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default withStyles(styles)(QueryMultiSelector);
|
||||||
@@ -320,6 +320,56 @@ export const settingsCommon = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const typesSelection = {
|
||||||
|
iconContainer: {
|
||||||
|
display: "flex" as const,
|
||||||
|
flexDirection: "row" as const,
|
||||||
|
maxWidth: 455,
|
||||||
|
justifyContent: "space-between" as const,
|
||||||
|
flexWrap: "wrap" as const,
|
||||||
|
width: "100%",
|
||||||
|
},
|
||||||
|
nonIconContainer: {
|
||||||
|
marginBottom: 16,
|
||||||
|
width: 455,
|
||||||
|
marginTop: 15,
|
||||||
|
"& button": {
|
||||||
|
marginRight: 16,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
pickTitle: {
|
||||||
|
fontWeight: 600,
|
||||||
|
color: "#393939",
|
||||||
|
fontSize: 14,
|
||||||
|
marginBottom: 16,
|
||||||
|
},
|
||||||
|
centerElements: {
|
||||||
|
display: "flex" as const,
|
||||||
|
flexDirection: "column" as const,
|
||||||
|
alignItems: "center" as const,
|
||||||
|
justifyContent: "center" as const,
|
||||||
|
},
|
||||||
|
logoButton: {
|
||||||
|
height: "80px",
|
||||||
|
},
|
||||||
|
lambdaNotif: {
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
border: "#393939 1px solid",
|
||||||
|
borderRadius: 5,
|
||||||
|
width: 101,
|
||||||
|
height: 91,
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
marginBottom: 16,
|
||||||
|
cursor: "pointer",
|
||||||
|
"& img": {
|
||||||
|
maxWidth: 71,
|
||||||
|
maxHeight: 71,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export const logsCommon = {
|
export const logsCommon = {
|
||||||
logsSubContainer: {
|
logsSubContainer: {
|
||||||
height: "calc(100vh - 230px)",
|
height: "calc(100vh - 230px)",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import DescriptionIcon from "./TableActionIcons/DescriptionIcon";
|
|||||||
import CloudIcon from "./TableActionIcons/CloudIcon";
|
import CloudIcon from "./TableActionIcons/CloudIcon";
|
||||||
import ConsoleIcon from "./TableActionIcons/ConsoleIcon";
|
import ConsoleIcon from "./TableActionIcons/ConsoleIcon";
|
||||||
import DownloadIcon from "./TableActionIcons/DownloadIcon";
|
import DownloadIcon from "./TableActionIcons/DownloadIcon";
|
||||||
|
import DisableIcon from "./TableActionIcons/DisableIcon";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { createStyles, withStyles } from "@material-ui/core/styles";
|
import { createStyles, withStyles } from "@material-ui/core/styles";
|
||||||
|
|
||||||
@@ -71,6 +72,8 @@ const defineIcon = (type: string, selected: boolean) => {
|
|||||||
return <ConsoleIcon active={selected} />;
|
return <ConsoleIcon active={selected} />;
|
||||||
case "download":
|
case "download":
|
||||||
return <DownloadIcon active={selected} />;
|
return <DownloadIcon active={selected} />;
|
||||||
|
case "disable":
|
||||||
|
return <DisableIcon active={selected} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { IIcon, selected, unSelected } from "./common";
|
||||||
|
|
||||||
|
const DescriptionIcon = ({ active = false }: IIcon) => {
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="20"
|
||||||
|
height="20"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
fill={active ? selected : unSelected}
|
||||||
|
d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11H7v-2h10v2z"
|
||||||
|
></path>
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DescriptionIcon;
|
||||||
@@ -1,3 +1,19 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import React, { Fragment, useState } from "react";
|
import React, { Fragment, useState } from "react";
|
||||||
import PageHeader from "../Common/PageHeader/PageHeader";
|
import PageHeader from "../Common/PageHeader/PageHeader";
|
||||||
import { Grid } from "@material-ui/core";
|
import { Grid } from "@material-ui/core";
|
||||||
@@ -7,9 +23,14 @@ import Tab from "@material-ui/core/Tab";
|
|||||||
import Tabs from "@material-ui/core/Tabs";
|
import Tabs from "@material-ui/core/Tabs";
|
||||||
import ConfigurationsList from "./ConfigurationPanels/ConfigurationsList";
|
import ConfigurationsList from "./ConfigurationPanels/ConfigurationsList";
|
||||||
import ListNotificationEndpoints from "./NotificationEndpoints/ListNotificationEndpoints";
|
import ListNotificationEndpoints from "./NotificationEndpoints/ListNotificationEndpoints";
|
||||||
|
import ListTiersConfiguration from "./TiersConfiguration/ListTiersConfiguration";
|
||||||
|
import { AppState } from "../../../store";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { ISessionResponse } from "../types";
|
||||||
|
|
||||||
interface IConfigurationMain {
|
interface IConfigurationMain {
|
||||||
classes: any;
|
classes: any;
|
||||||
|
session: ISessionResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
const styles = (theme: Theme) =>
|
||||||
@@ -23,8 +44,10 @@ const styles = (theme: Theme) =>
|
|||||||
...containerForHeader(theme.spacing(4)),
|
...containerForHeader(theme.spacing(4)),
|
||||||
});
|
});
|
||||||
|
|
||||||
const ConfigurationMain = ({ classes }: IConfigurationMain) => {
|
const ConfigurationMain = ({ classes, session }: IConfigurationMain) => {
|
||||||
const [selectedTab, setSelectedTab] = useState<number>(0);
|
const [selectedTab, setSelectedTab] = useState<number>(0);
|
||||||
|
const ilmEnabled = session.features?.indexOf("ilm") > -1;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<PageHeader label="Settings" />
|
<PageHeader label="Settings" />
|
||||||
@@ -44,6 +67,7 @@ const ConfigurationMain = ({ classes }: IConfigurationMain) => {
|
|||||||
>
|
>
|
||||||
<Tab label="Configurations" />
|
<Tab label="Configurations" />
|
||||||
<Tab label="Lambda Notifications" />
|
<Tab label="Lambda Notifications" />
|
||||||
|
{ilmEnabled && <Tab label="Tiers" />}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
{selectedTab === 0 && (
|
{selectedTab === 0 && (
|
||||||
@@ -56,6 +80,11 @@ const ConfigurationMain = ({ classes }: IConfigurationMain) => {
|
|||||||
<ListNotificationEndpoints />
|
<ListNotificationEndpoints />
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
|
{selectedTab === 2 && (
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<ListTiersConfiguration />
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -63,4 +92,10 @@ const ConfigurationMain = ({ classes }: IConfigurationMain) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withStyles(styles)(ConfigurationMain);
|
const mapState = (state: AppState) => ({
|
||||||
|
session: state.console.session,
|
||||||
|
});
|
||||||
|
|
||||||
|
const connector = connect(mapState, {});
|
||||||
|
|
||||||
|
export default withStyles(styles)(connector(ConfigurationMain));
|
||||||
|
|||||||
@@ -19,7 +19,10 @@ import Grid from "@material-ui/core/Grid";
|
|||||||
import { Button } from "@material-ui/core";
|
import { Button } from "@material-ui/core";
|
||||||
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
import { servicesList } from "./utils";
|
import { servicesList } from "./utils";
|
||||||
import { settingsCommon } from "../../Common/FormComponents/common/styleLibrary";
|
import {
|
||||||
|
settingsCommon,
|
||||||
|
typesSelection,
|
||||||
|
} from "../../Common/FormComponents/common/styleLibrary";
|
||||||
|
|
||||||
interface INotificationTypeSelector {
|
interface INotificationTypeSelector {
|
||||||
classes: any;
|
classes: any;
|
||||||
@@ -32,56 +35,11 @@ const withLogos = servicesList.filter((elService) => elService.logo !== "");
|
|||||||
const styles = (theme: Theme) =>
|
const styles = (theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
...settingsCommon,
|
...settingsCommon,
|
||||||
logoButton: {
|
|
||||||
height: "80px",
|
|
||||||
},
|
|
||||||
lambdaNotif: {
|
|
||||||
backgroundColor: "#fff",
|
|
||||||
border: "#393939 1px solid",
|
|
||||||
borderRadius: 5,
|
|
||||||
width: 101,
|
|
||||||
height: 91,
|
|
||||||
display: "flex",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
marginBottom: 16,
|
|
||||||
cursor: "pointer",
|
|
||||||
"& img": {
|
|
||||||
maxWidth: 71,
|
|
||||||
maxHeight: 71,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
iconContainer: {
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "row",
|
|
||||||
maxWidth: 455,
|
|
||||||
justifyContent: "space-between",
|
|
||||||
flexWrap: "wrap",
|
|
||||||
},
|
|
||||||
nonIconContainer: {
|
|
||||||
marginBottom: 16,
|
|
||||||
width: 455,
|
|
||||||
marginTop: 15,
|
|
||||||
"& button": {
|
|
||||||
marginRight: 16,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
pickTitle: {
|
|
||||||
fontWeight: 600,
|
|
||||||
color: "#393939",
|
|
||||||
fontSize: 14,
|
|
||||||
marginBottom: 16,
|
|
||||||
},
|
|
||||||
centerElements: {
|
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
alignItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
},
|
|
||||||
customTitle: {
|
customTitle: {
|
||||||
...settingsCommon.customTitle,
|
...settingsCommon.customTitle,
|
||||||
marginTop: 0,
|
marginTop: 0,
|
||||||
},
|
},
|
||||||
|
...typesSelection,
|
||||||
});
|
});
|
||||||
|
|
||||||
const NotificationTypeSelector = ({
|
const NotificationTypeSelector = ({
|
||||||
|
|||||||
@@ -0,0 +1,432 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import React, { Fragment, useEffect, useState } from "react";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import Grid from "@material-ui/core/Grid";
|
||||||
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
|
import { Button } from "@material-ui/core";
|
||||||
|
import api from "../../../../common/api";
|
||||||
|
import { setErrorSnackMessage } from "../../../../actions";
|
||||||
|
import {
|
||||||
|
modalBasic,
|
||||||
|
settingsCommon,
|
||||||
|
} from "../../Common/FormComponents/common/styleLibrary";
|
||||||
|
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
|
||||||
|
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
|
||||||
|
import FileSelector from "../../Common/FormComponents/FileSelector/FileSelector";
|
||||||
|
|
||||||
|
const styles = (theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
...modalBasic,
|
||||||
|
...settingsCommon,
|
||||||
|
strongText: {
|
||||||
|
fontWeight: 700,
|
||||||
|
},
|
||||||
|
keyName: {
|
||||||
|
marginLeft: 5,
|
||||||
|
},
|
||||||
|
buttonContainer: {
|
||||||
|
textAlign: "right",
|
||||||
|
},
|
||||||
|
customTitle: {
|
||||||
|
...settingsCommon.customTitle,
|
||||||
|
marginTop: 0,
|
||||||
|
},
|
||||||
|
settingsFormContainer: {
|
||||||
|
...settingsCommon.settingsFormContainer,
|
||||||
|
height: "calc(100vh - 422px)",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
interface IAddNotificationEndpointProps {
|
||||||
|
saveAndRefresh: any;
|
||||||
|
setErrorSnackMessage: typeof setErrorSnackMessage;
|
||||||
|
classes: any;
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddTierConfiguration = ({
|
||||||
|
saveAndRefresh,
|
||||||
|
classes,
|
||||||
|
setErrorSnackMessage,
|
||||||
|
type,
|
||||||
|
}: IAddNotificationEndpointProps) => {
|
||||||
|
//Local States
|
||||||
|
const [saving, setSaving] = useState<boolean>(false);
|
||||||
|
|
||||||
|
// Form Items
|
||||||
|
const [name, setName] = useState<string>("");
|
||||||
|
const [endpoint, setEndpoint] = useState<string>("");
|
||||||
|
const [bucket, setBucket] = useState<string>("");
|
||||||
|
const [prefix, setPrefix] = useState<string>("");
|
||||||
|
const [region, setRegion] = useState<string>("");
|
||||||
|
const [storageClass, setStorageClass] = useState<string>("");
|
||||||
|
|
||||||
|
const [accessKey, setAccessKey] = useState<string>("");
|
||||||
|
const [secretKey, setSecretKey] = useState<string>("");
|
||||||
|
|
||||||
|
const [creds, setCreds] = useState<string>("");
|
||||||
|
const [encodedCreds, setEncodedCreds] = useState<string>("");
|
||||||
|
|
||||||
|
const [accountName, setAccountName] = useState<string>("");
|
||||||
|
const [accountKey, setAccountKey] = useState<string>("");
|
||||||
|
|
||||||
|
const [titleSelection, setTitleSelection] = useState<string>("");
|
||||||
|
|
||||||
|
// Validations
|
||||||
|
const [isFormValid, setIsFormValid] = useState<boolean>(true);
|
||||||
|
|
||||||
|
//Effects
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (saving) {
|
||||||
|
let request = {};
|
||||||
|
let fields = {
|
||||||
|
name,
|
||||||
|
endpoint,
|
||||||
|
bucket,
|
||||||
|
prefix,
|
||||||
|
region,
|
||||||
|
};
|
||||||
|
|
||||||
|
let tierType = type;
|
||||||
|
|
||||||
|
if (type === "minio") {
|
||||||
|
tierType = "s3";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case "minio":
|
||||||
|
case "s3":
|
||||||
|
request = {
|
||||||
|
s3: {
|
||||||
|
...fields,
|
||||||
|
accesskey: accessKey,
|
||||||
|
secretkey: secretKey,
|
||||||
|
storageclass: storageClass,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case "gcs":
|
||||||
|
request = {
|
||||||
|
gcs: {
|
||||||
|
...fields,
|
||||||
|
creds: encodedCreds,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case "azure":
|
||||||
|
request = {
|
||||||
|
azure: {
|
||||||
|
...fields,
|
||||||
|
accountname: accountName,
|
||||||
|
accountkey: accountKey,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
let payload = {
|
||||||
|
type: tierType,
|
||||||
|
...request,
|
||||||
|
};
|
||||||
|
|
||||||
|
api
|
||||||
|
.invoke("POST", `/api/v1/admin/tiers`, payload)
|
||||||
|
.then(() => {
|
||||||
|
setSaving(false);
|
||||||
|
saveAndRefresh();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setSaving(false);
|
||||||
|
setErrorSnackMessage(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [
|
||||||
|
accessKey,
|
||||||
|
accountKey,
|
||||||
|
accountName,
|
||||||
|
bucket,
|
||||||
|
encodedCreds,
|
||||||
|
endpoint,
|
||||||
|
name,
|
||||||
|
prefix,
|
||||||
|
region,
|
||||||
|
saveAndRefresh,
|
||||||
|
saving,
|
||||||
|
secretKey,
|
||||||
|
setErrorSnackMessage,
|
||||||
|
storageClass,
|
||||||
|
type,
|
||||||
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let valid = true;
|
||||||
|
if (type === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (name === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (endpoint === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (bucket === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (prefix === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (region === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === "s3" || type === "minio") {
|
||||||
|
if (accessKey === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (secretKey === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === "gcs") {
|
||||||
|
if (encodedCreds === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === "azure") {
|
||||||
|
if (accountName === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
if (accountKey === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsFormValid(valid);
|
||||||
|
}, [
|
||||||
|
accessKey,
|
||||||
|
accountKey,
|
||||||
|
accountName,
|
||||||
|
bucket,
|
||||||
|
encodedCreds,
|
||||||
|
endpoint,
|
||||||
|
isFormValid,
|
||||||
|
name,
|
||||||
|
prefix,
|
||||||
|
region,
|
||||||
|
secretKey,
|
||||||
|
storageClass,
|
||||||
|
type,
|
||||||
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
switch (type) {
|
||||||
|
case "gcs":
|
||||||
|
setEndpoint("https://storage.googleapis.com/");
|
||||||
|
setTitleSelection("Google Cloud");
|
||||||
|
break;
|
||||||
|
case "s3":
|
||||||
|
setEndpoint("https://s3.amazonaws.com");
|
||||||
|
setTitleSelection("Amazon S3");
|
||||||
|
break;
|
||||||
|
case "azure":
|
||||||
|
setEndpoint("http://blob.core.windows.net");
|
||||||
|
setTitleSelection("Azure");
|
||||||
|
break;
|
||||||
|
case "minio":
|
||||||
|
setEndpoint("");
|
||||||
|
setTitleSelection("MinIO");
|
||||||
|
}
|
||||||
|
}, [type]);
|
||||||
|
|
||||||
|
//Fetch Actions
|
||||||
|
const submitForm = (event: React.FormEvent) => {
|
||||||
|
event.preventDefault();
|
||||||
|
setSaving(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<form noValidate onSubmit={submitForm}>
|
||||||
|
<Grid item xs={12} className={classes.customTitle}>
|
||||||
|
{titleSelection} - Add Tier Configuration
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} className={classes.settingsFormContainer}>
|
||||||
|
<Grid container>
|
||||||
|
{type !== "" && (
|
||||||
|
<Fragment>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="name"
|
||||||
|
name="name"
|
||||||
|
label="Name"
|
||||||
|
placeholder="Enter Name"
|
||||||
|
value={name}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setName(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="endpoint"
|
||||||
|
name="endpoint"
|
||||||
|
label="Endpoint"
|
||||||
|
placeholder="Enter Endpoint"
|
||||||
|
value={endpoint}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setEndpoint(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{type === "s3" ||
|
||||||
|
(type === "minio" && (
|
||||||
|
<Fragment>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="accessKey"
|
||||||
|
name="accessKey"
|
||||||
|
label="Access Key"
|
||||||
|
placeholder="Enter Access Key"
|
||||||
|
value={accessKey}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setAccessKey(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="secretKey"
|
||||||
|
name="secretKey"
|
||||||
|
label="Secret Key"
|
||||||
|
placeholder="Enter Secret Key"
|
||||||
|
value={secretKey}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setSecretKey(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
{type === "gcs" && (
|
||||||
|
<Fragment>
|
||||||
|
<FileSelector
|
||||||
|
accept=".json"
|
||||||
|
id="creds"
|
||||||
|
label="Credentials"
|
||||||
|
name="creds"
|
||||||
|
onChange={(encodedValue, fileName) => {
|
||||||
|
setEncodedCreds(encodedValue);
|
||||||
|
setCreds(fileName);
|
||||||
|
}}
|
||||||
|
value={creds}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
{type === "azure" && (
|
||||||
|
<Fragment>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="accountName"
|
||||||
|
name="accountName"
|
||||||
|
label="Account Name"
|
||||||
|
placeholder="Enter Account Name"
|
||||||
|
value={accountName}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setAccountName(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="accountKey"
|
||||||
|
name="accountKey"
|
||||||
|
label="Account Key"
|
||||||
|
placeholder="Enter Account Key"
|
||||||
|
value={accountKey}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setAccountKey(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="bucket"
|
||||||
|
name="bucket"
|
||||||
|
label="Bucket"
|
||||||
|
placeholder="Enter Bucket"
|
||||||
|
value={bucket}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setBucket(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="prefix"
|
||||||
|
name="prefix"
|
||||||
|
label="Prefix"
|
||||||
|
placeholder="Enter Prefix"
|
||||||
|
value={prefix}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setPrefix(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="region"
|
||||||
|
name="region"
|
||||||
|
label="Region"
|
||||||
|
placeholder="Enter Region"
|
||||||
|
value={region}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setRegion(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{type === "s3" ||
|
||||||
|
(type === "minio" && (
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="storageClass"
|
||||||
|
name="storageClass"
|
||||||
|
label="Storage Class"
|
||||||
|
placeholder="Enter Storage Class"
|
||||||
|
value={storageClass}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setStorageClass(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} className={classes.settingsButtonContainer}>
|
||||||
|
<Grid item xs={12} className={classes.innerSettingsButtonContainer}>
|
||||||
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
disabled={saving || !isFormValid}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</form>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = {
|
||||||
|
setErrorSnackMessage,
|
||||||
|
};
|
||||||
|
|
||||||
|
const connector = connect(null, mapDispatchToProps);
|
||||||
|
|
||||||
|
export default withStyles(styles)(connector(AddTierConfiguration));
|
||||||
@@ -0,0 +1,423 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import React, { useEffect, useState, Fragment } from "react";
|
||||||
|
import get from "lodash/get";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
|
import { TextField } from "@material-ui/core";
|
||||||
|
import Grid from "@material-ui/core/Grid";
|
||||||
|
import Button from "@material-ui/core/Button";
|
||||||
|
import InputAdornment from "@material-ui/core/InputAdornment";
|
||||||
|
import SearchIcon from "@material-ui/icons/Search";
|
||||||
|
import {
|
||||||
|
actionsTray,
|
||||||
|
containerForHeader,
|
||||||
|
searchField,
|
||||||
|
settingsCommon,
|
||||||
|
typesSelection,
|
||||||
|
} from "../../Common/FormComponents/common/styleLibrary";
|
||||||
|
import { CreateIcon } from "../../../../icons";
|
||||||
|
import { setErrorSnackMessage } from "../../../../actions";
|
||||||
|
import { ITierElement, ITierResponse } from "./types";
|
||||||
|
import api from "../../../../common/api";
|
||||||
|
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
|
||||||
|
import SlideOptions from "../../Common/SlideOptions/SlideOptions";
|
||||||
|
import BackSettingsIcon from "../../../../icons/BackSettingsIcon";
|
||||||
|
import AddTierConfiguration from "./AddTierConfiguration";
|
||||||
|
import UpdateTierCredentiasModal from "./UpdateTierCredentiasModal";
|
||||||
|
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
|
||||||
|
import ClockType from "@material-ui/pickers/constants/ClockType";
|
||||||
|
|
||||||
|
interface IListTiersConfig {
|
||||||
|
classes: any;
|
||||||
|
setErrorSnackMessage: typeof setErrorSnackMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = (theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
...actionsTray,
|
||||||
|
...searchField,
|
||||||
|
...settingsCommon,
|
||||||
|
...typesSelection,
|
||||||
|
...containerForHeader(theme.spacing(4)),
|
||||||
|
strongText: {
|
||||||
|
fontWeight: 700,
|
||||||
|
},
|
||||||
|
keyName: {
|
||||||
|
marginLeft: 5,
|
||||||
|
},
|
||||||
|
iconText: {
|
||||||
|
lineHeight: "24px",
|
||||||
|
},
|
||||||
|
customConfigurationPage: {
|
||||||
|
height: "calc(100vh - 410px)",
|
||||||
|
scrollbarWidth: "none" as const,
|
||||||
|
"&::-webkit-scrollbar": {
|
||||||
|
display: "none",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lambdaContainer: {
|
||||||
|
padding: "15px 0",
|
||||||
|
},
|
||||||
|
actionsTray: {
|
||||||
|
...actionsTray.actionsTray,
|
||||||
|
padding: "0 38px",
|
||||||
|
},
|
||||||
|
customTitle: {
|
||||||
|
...settingsCommon.customTitle,
|
||||||
|
marginTop: 0,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const ListTiersConfiguration = ({
|
||||||
|
classes,
|
||||||
|
setErrorSnackMessage,
|
||||||
|
}: IListTiersConfig) => {
|
||||||
|
const [records, setRecords] = useState<ITierElement[]>([]);
|
||||||
|
const [filter, setFilter] = useState<string>("");
|
||||||
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||||
|
const [currentPanel, setCurrentPanel] = useState<number>(0);
|
||||||
|
const [updateCredentialsOpen, setUpdateCredentialsOpen] = useState<boolean>(
|
||||||
|
false
|
||||||
|
);
|
||||||
|
const [selectedTier, setSelectedTier] = useState<ITierElement>({
|
||||||
|
type: "unsupported",
|
||||||
|
});
|
||||||
|
const [type, setType] = useState<string>("");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isLoading) {
|
||||||
|
const fetchRecords = () => {
|
||||||
|
api
|
||||||
|
.invoke("GET", `/api/v1/admin/tiers`)
|
||||||
|
.then((res: ITierResponse) => {
|
||||||
|
setRecords(res.items || []);
|
||||||
|
setIsLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setErrorSnackMessage(err);
|
||||||
|
setIsLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
fetchRecords();
|
||||||
|
}
|
||||||
|
}, [isLoading, setErrorSnackMessage]);
|
||||||
|
|
||||||
|
const filteredRecords = records.filter((b: ITierElement) => {
|
||||||
|
if (filter === "") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const getItemName = get(b, `${b.type}.name`, "");
|
||||||
|
const getItemType = get(b, `type`, "");
|
||||||
|
|
||||||
|
return getItemName.indexOf(filter) >= 0 || getItemType.indexOf(filter) >= 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
const backClick = () => {
|
||||||
|
setCurrentPanel(currentPanel - 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
const addTier = () => {
|
||||||
|
setCurrentPanel(1);
|
||||||
|
};
|
||||||
|
|
||||||
|
const tierAdded = () => {
|
||||||
|
setCurrentPanel(0);
|
||||||
|
setIsLoading(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderTierName = (item: ITierElement) => {
|
||||||
|
const name = get(item, `${item.type}.name`, "");
|
||||||
|
|
||||||
|
if (name !== null) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderTierPrefix = (item: ITierElement) => {
|
||||||
|
const prefix = get(item, `${item.type}.prefix`, "");
|
||||||
|
|
||||||
|
if (prefix !== null) {
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderTierEndpoint = (item: ITierElement) => {
|
||||||
|
const endpoint = get(item, `${item.type}.endpoint`, "");
|
||||||
|
|
||||||
|
if (endpoint !== null) {
|
||||||
|
return endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderTierBucket = (item: ITierElement) => {
|
||||||
|
const bucket = get(item, `${item.type}.bucket`, "");
|
||||||
|
|
||||||
|
if (bucket !== null) {
|
||||||
|
return bucket;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderTierRegion = (item: ITierElement) => {
|
||||||
|
const region = get(item, `${item.type}.region`, "");
|
||||||
|
|
||||||
|
if (region !== null) {
|
||||||
|
return region;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeTierCredentials = () => {
|
||||||
|
setUpdateCredentialsOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const typeSelect = (typeItem: string) => {
|
||||||
|
setType(typeItem);
|
||||||
|
setCurrentPanel(2);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
{updateCredentialsOpen && (
|
||||||
|
<UpdateTierCredentiasModal
|
||||||
|
open={updateCredentialsOpen}
|
||||||
|
tierData={selectedTier}
|
||||||
|
closeModalAndRefresh={closeTierCredentials}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Grid container>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<div className={classes.settingsOptionsContainer}>
|
||||||
|
<SlideOptions
|
||||||
|
slideOptions={[
|
||||||
|
<Fragment>
|
||||||
|
<Grid item xs={12} className={classes.customTitle}>
|
||||||
|
Tiers
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid item xs={12} className={classes.lambdaContainer}>
|
||||||
|
<Grid item xs={12} className={classes.actionsTray}>
|
||||||
|
<TextField
|
||||||
|
placeholder="Filter"
|
||||||
|
className={classes.searchField}
|
||||||
|
id="search-resource"
|
||||||
|
label=""
|
||||||
|
onChange={(event) => {
|
||||||
|
setFilter(event.target.value);
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
disableUnderline: true,
|
||||||
|
startAdornment: (
|
||||||
|
<InputAdornment position="start">
|
||||||
|
<SearchIcon />
|
||||||
|
</InputAdornment>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
startIcon={<CreateIcon />}
|
||||||
|
onClick={addTier}
|
||||||
|
>
|
||||||
|
Add Tier
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<br />
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<TableWrapper
|
||||||
|
itemActions={[
|
||||||
|
{
|
||||||
|
type: "edit",
|
||||||
|
onClick: (tierData: ITierElement) => {
|
||||||
|
setSelectedTier(tierData);
|
||||||
|
setUpdateCredentialsOpen(true);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
label: "Tier Name",
|
||||||
|
elementKey: "type",
|
||||||
|
renderFunction: renderTierName,
|
||||||
|
renderFullObject: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Type",
|
||||||
|
elementKey: "type",
|
||||||
|
width: 150,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Endpoint",
|
||||||
|
elementKey: "type",
|
||||||
|
renderFunction: renderTierEndpoint,
|
||||||
|
renderFullObject: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Bucket",
|
||||||
|
elementKey: "type",
|
||||||
|
renderFunction: renderTierBucket,
|
||||||
|
renderFullObject: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Prefix",
|
||||||
|
elementKey: "type",
|
||||||
|
renderFunction: renderTierPrefix,
|
||||||
|
renderFullObject: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Region",
|
||||||
|
elementKey: "type",
|
||||||
|
renderFunction: renderTierRegion,
|
||||||
|
renderFullObject: true,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
isLoading={isLoading}
|
||||||
|
records={filteredRecords}
|
||||||
|
entityName="Tiers"
|
||||||
|
idField="service_name"
|
||||||
|
customPaperHeight={classes.customConfigurationPage}
|
||||||
|
noBackground
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Fragment>,
|
||||||
|
<Fragment>
|
||||||
|
<Grid item xs={12} className={classes.backContainer}>
|
||||||
|
<button
|
||||||
|
onClick={backClick}
|
||||||
|
className={classes.backButton}
|
||||||
|
>
|
||||||
|
<BackSettingsIcon />
|
||||||
|
Back To Tiers
|
||||||
|
</button>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<Grid item xs={12} className={classes.customTitle}>
|
||||||
|
Add Tier Configuration
|
||||||
|
</Grid>
|
||||||
|
<Grid
|
||||||
|
item
|
||||||
|
xs={12}
|
||||||
|
className={classes.settingsFormContainer}
|
||||||
|
>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<Grid item xs={12} className={classes.centerElements}>
|
||||||
|
<div className={classes.iconContainer}>
|
||||||
|
<button
|
||||||
|
className={classes.lambdaNotif}
|
||||||
|
onClick={() => {
|
||||||
|
typeSelect("minio");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={"/minioTier.png"}
|
||||||
|
className={classes.logoButton}
|
||||||
|
alt={"MinIO"}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={classes.lambdaNotif}
|
||||||
|
onClick={() => {
|
||||||
|
typeSelect("gcs");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={"/gcs.png"}
|
||||||
|
className={classes.logoButton}
|
||||||
|
alt={"GCS"}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={classes.lambdaNotif}
|
||||||
|
onClick={() => {
|
||||||
|
typeSelect("s3");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={"/amazon.png"}
|
||||||
|
className={classes.logoButton}
|
||||||
|
alt={"s3"}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={classes.lambdaNotif}
|
||||||
|
onClick={() => {
|
||||||
|
typeSelect("azure");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={"/azure.png"}
|
||||||
|
className={classes.logoButton}
|
||||||
|
alt={"Azure"}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Fragment>,
|
||||||
|
<Fragment>
|
||||||
|
<Grid item xs={12} className={classes.backContainer}>
|
||||||
|
<button
|
||||||
|
onClick={backClick}
|
||||||
|
className={classes.backButton}
|
||||||
|
>
|
||||||
|
<BackSettingsIcon />
|
||||||
|
Back To Tier Type Selection
|
||||||
|
</button>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
{currentPanel === 2 && (
|
||||||
|
<AddTierConfiguration
|
||||||
|
type={type}
|
||||||
|
saveAndRefresh={tierAdded}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
</Fragment>,
|
||||||
|
]}
|
||||||
|
currentSlide={currentPanel}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = {
|
||||||
|
setErrorSnackMessage,
|
||||||
|
};
|
||||||
|
|
||||||
|
const connector = connect(null, mapDispatchToProps);
|
||||||
|
|
||||||
|
export default withStyles(styles)(connector(ListTiersConfiguration));
|
||||||
@@ -0,0 +1,232 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import React, { useState, useEffect, Fragment } from "react";
|
||||||
|
import get from "lodash/get";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
|
import { Button, LinearProgress } from "@material-ui/core";
|
||||||
|
import Grid from "@material-ui/core/Grid";
|
||||||
|
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
|
||||||
|
import { setModalErrorSnackMessage } from "../../../../actions";
|
||||||
|
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
|
||||||
|
import FileSelector from "../../Common/FormComponents/FileSelector/FileSelector";
|
||||||
|
import api from "../../../../common/api";
|
||||||
|
import { ITierElement } from "./types";
|
||||||
|
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
|
||||||
|
|
||||||
|
interface ITierCredentialsModal {
|
||||||
|
open: boolean;
|
||||||
|
closeModalAndRefresh: (refresh: boolean) => any;
|
||||||
|
classes: any;
|
||||||
|
tierData: ITierElement;
|
||||||
|
setModalErrorSnackMessage: typeof setModalErrorSnackMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = (theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
minTableHeader: {
|
||||||
|
color: "#393939",
|
||||||
|
"& tr": {
|
||||||
|
"& th": {
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
buttonContainer: {
|
||||||
|
textAlign: "right",
|
||||||
|
},
|
||||||
|
...modalBasic,
|
||||||
|
});
|
||||||
|
|
||||||
|
const UpdateTierCredentialsModal = ({
|
||||||
|
open,
|
||||||
|
closeModalAndRefresh,
|
||||||
|
classes,
|
||||||
|
tierData,
|
||||||
|
setModalErrorSnackMessage,
|
||||||
|
}: ITierCredentialsModal) => {
|
||||||
|
const [savingTiers, setSavingTiers] = useState<boolean>(false);
|
||||||
|
const [accessKey, setAccessKey] = useState<string>("");
|
||||||
|
const [secretKey, setSecretKey] = useState<string>("");
|
||||||
|
|
||||||
|
const [creds, setCreds] = useState<string>("");
|
||||||
|
const [encodedCreds, setEncodedCreds] = useState<string>("");
|
||||||
|
|
||||||
|
const [accountName, setAccountName] = useState<string>("");
|
||||||
|
const [accountKey, setAccountKey] = useState<string>("");
|
||||||
|
|
||||||
|
// Validations
|
||||||
|
const [isFormValid, setIsFormValid] = useState<boolean>(true);
|
||||||
|
|
||||||
|
const type = get(tierData, "type", "");
|
||||||
|
const name = get(tierData, `${type}.name`, "");
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let valid = true;
|
||||||
|
|
||||||
|
if (type === "s3" || type === "azure") {
|
||||||
|
if (accountName === "" || accountKey === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
} else if (type === "gcs") {
|
||||||
|
if (encodedCreds === "") {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setIsFormValid(valid);
|
||||||
|
}, [accountKey, accountName, encodedCreds, type]);
|
||||||
|
|
||||||
|
const addRecord = () => {
|
||||||
|
let rules = {};
|
||||||
|
|
||||||
|
if (type === "s3" || type === "azure") {
|
||||||
|
rules = {
|
||||||
|
access_key: accountName,
|
||||||
|
secret_key: accountKey,
|
||||||
|
};
|
||||||
|
} else if (type === "gcs") {
|
||||||
|
rules = {
|
||||||
|
creds: encodedCreds,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (name !== "") {
|
||||||
|
api
|
||||||
|
.invoke("PUT", `/api/v1/admin/tiers/${type}/${name}/credentials`, rules)
|
||||||
|
.then(() => {
|
||||||
|
setSavingTiers(false);
|
||||||
|
closeModalAndRefresh(true);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setSavingTiers(false);
|
||||||
|
setModalErrorSnackMessage(err);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setModalErrorSnackMessage(
|
||||||
|
"There was an error retrieving tier information"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalWrapper
|
||||||
|
modalOpen={open}
|
||||||
|
onClose={() => {
|
||||||
|
closeModalAndRefresh(false);
|
||||||
|
}}
|
||||||
|
title={`Update Credentials - ${type} / ${name}`}
|
||||||
|
>
|
||||||
|
<form
|
||||||
|
noValidate
|
||||||
|
autoComplete="off"
|
||||||
|
onSubmit={(e: React.FormEvent<HTMLFormElement>) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setSavingTiers(true);
|
||||||
|
addRecord();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid container>
|
||||||
|
<Grid item xs={12} className={classes.formScrollable}>
|
||||||
|
{type === "s3" && (
|
||||||
|
<Fragment>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="accessKey"
|
||||||
|
name="accessKey"
|
||||||
|
label="Access Key"
|
||||||
|
placeholder="Enter Access Key"
|
||||||
|
value={accessKey}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setAccessKey(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="secretKey"
|
||||||
|
name="secretKey"
|
||||||
|
label="Secret Key"
|
||||||
|
placeholder="Enter Secret Key"
|
||||||
|
value={secretKey}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setSecretKey(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
{type === "gcs" && (
|
||||||
|
<Fragment>
|
||||||
|
<FileSelector
|
||||||
|
accept=".json"
|
||||||
|
id="creds"
|
||||||
|
label="Credentials"
|
||||||
|
name="creds"
|
||||||
|
onChange={(encodedValue, fileName) => {
|
||||||
|
setEncodedCreds(encodedValue);
|
||||||
|
setCreds(fileName);
|
||||||
|
}}
|
||||||
|
value={creds}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
{type === "azure" && (
|
||||||
|
<Fragment>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="accountName"
|
||||||
|
name="accountName"
|
||||||
|
label="Account Name"
|
||||||
|
placeholder="Enter Account Name"
|
||||||
|
value={accountName}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setAccountName(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<InputBoxWrapper
|
||||||
|
id="accountKey"
|
||||||
|
name="accountKey"
|
||||||
|
label="Account Key"
|
||||||
|
placeholder="Enter Account Key"
|
||||||
|
value={accountKey}
|
||||||
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setAccountKey(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} className={classes.buttonContainer}>
|
||||||
|
<Button
|
||||||
|
type="submit"
|
||||||
|
variant="contained"
|
||||||
|
color="primary"
|
||||||
|
disabled={savingTiers || !isFormValid}
|
||||||
|
>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
{savingTiers && (
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<LinearProgress />
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
</form>
|
||||||
|
</ModalWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const connector = connect(null, {
|
||||||
|
setModalErrorSnackMessage,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default withStyles(styles)(connector(UpdateTierCredentialsModal));
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
export interface ITierS3 {
|
||||||
|
name: string;
|
||||||
|
endpoint: string;
|
||||||
|
accesskey: string;
|
||||||
|
secretkey: string;
|
||||||
|
bucket: string;
|
||||||
|
prefix: string;
|
||||||
|
region: string;
|
||||||
|
storageclass: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITierGCS {
|
||||||
|
name: string;
|
||||||
|
endpoint: string;
|
||||||
|
creds: string;
|
||||||
|
bucket: string;
|
||||||
|
prefix: string;
|
||||||
|
region: string;
|
||||||
|
storageclass: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITierAzure {
|
||||||
|
name: string;
|
||||||
|
endpoint: string;
|
||||||
|
accountname: string;
|
||||||
|
accountkey: string;
|
||||||
|
bucket: string;
|
||||||
|
prefix: string;
|
||||||
|
region: string;
|
||||||
|
storageclass: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITierElement {
|
||||||
|
type: "s3" | "gcs" | "azure" | "unsupported";
|
||||||
|
s3?: ITierS3;
|
||||||
|
gcs?: ITierGCS;
|
||||||
|
azure?: ITierAzure;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITierResponse {
|
||||||
|
items: ITierElement[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ITierUpdateCreds {
|
||||||
|
access_key: string;
|
||||||
|
secret_key: string;
|
||||||
|
creds: string;
|
||||||
|
}
|
||||||
359
restapi/admin_tiers.go
Normal file
@@ -0,0 +1,359 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package restapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/base64"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/minio/minio/pkg/madmin"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
"github.com/minio/console/restapi/operations"
|
||||||
|
"github.com/minio/console/restapi/operations/admin_api"
|
||||||
|
)
|
||||||
|
|
||||||
|
func registerAdminTiersHandlers(api *operations.ConsoleAPI) {
|
||||||
|
// return a list of notification endpoints
|
||||||
|
api.AdminAPITiersListHandler = admin_api.TiersListHandlerFunc(func(params admin_api.TiersListParams, session *models.Principal) middleware.Responder {
|
||||||
|
tierList, err := getTiersResponse(session)
|
||||||
|
if err != nil {
|
||||||
|
return admin_api.NewTiersListDefault(int(err.Code)).WithPayload(err)
|
||||||
|
}
|
||||||
|
return admin_api.NewTiersListOK().WithPayload(tierList)
|
||||||
|
})
|
||||||
|
// add a new tiers
|
||||||
|
api.AdminAPIAddTierHandler = admin_api.AddTierHandlerFunc(func(params admin_api.AddTierParams, session *models.Principal) middleware.Responder {
|
||||||
|
err := getAddTierResponse(session, ¶ms)
|
||||||
|
if err != nil {
|
||||||
|
return admin_api.NewAddTierDefault(int(err.Code)).WithPayload(err)
|
||||||
|
}
|
||||||
|
return admin_api.NewAddTierCreated()
|
||||||
|
})
|
||||||
|
// get a tier
|
||||||
|
api.AdminAPIGetTierHandler = admin_api.GetTierHandlerFunc(func(params admin_api.GetTierParams, session *models.Principal) middleware.Responder {
|
||||||
|
notifEndpoints, err := getGetTierResponse(session, ¶ms)
|
||||||
|
if err != nil {
|
||||||
|
return admin_api.NewGetTierDefault(int(err.Code)).WithPayload(err)
|
||||||
|
}
|
||||||
|
return admin_api.NewGetTierOK().WithPayload(notifEndpoints)
|
||||||
|
})
|
||||||
|
// edit credentials for a tier
|
||||||
|
api.AdminAPIEditTierCredentialsHandler = admin_api.EditTierCredentialsHandlerFunc(func(params admin_api.EditTierCredentialsParams, session *models.Principal) middleware.Responder {
|
||||||
|
err := getEditTierCredentialsResponse(session, ¶ms)
|
||||||
|
if err != nil {
|
||||||
|
return admin_api.NewEditTierCredentialsDefault(int(err.Code)).WithPayload(err)
|
||||||
|
}
|
||||||
|
return admin_api.NewEditTierCredentialsOK()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// getNotificationEndpoints invokes admin info and returns a list of notification endpoints
|
||||||
|
func getTiers(ctx context.Context, client MinioAdmin) (*models.TierListResponse, error) {
|
||||||
|
tiers, err := client.listTiers(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var tiersList []*models.Tier
|
||||||
|
for i := range tiers {
|
||||||
|
|
||||||
|
switch tiers[i].Type {
|
||||||
|
case madmin.S3:
|
||||||
|
tiersList = append(tiersList, &models.Tier{
|
||||||
|
Type: models.TierTypeS3,
|
||||||
|
S3: &models.TierS3{
|
||||||
|
Accesskey: tiers[i].S3.AccessKey,
|
||||||
|
Bucket: tiers[i].S3.Bucket,
|
||||||
|
Endpoint: tiers[i].S3.Endpoint,
|
||||||
|
Name: tiers[i].Name,
|
||||||
|
Prefix: tiers[i].S3.Prefix,
|
||||||
|
Region: tiers[i].S3.Region,
|
||||||
|
Secretkey: tiers[i].S3.SecretKey,
|
||||||
|
Storageclass: tiers[i].S3.StorageClass,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
case madmin.GCS:
|
||||||
|
tiersList = append(tiersList, &models.Tier{
|
||||||
|
Type: models.TierTypeGcs,
|
||||||
|
Gcs: &models.TierGcs{
|
||||||
|
Bucket: tiers[i].GCS.Bucket,
|
||||||
|
Creds: tiers[i].GCS.Creds,
|
||||||
|
Endpoint: tiers[i].GCS.Endpoint,
|
||||||
|
Name: tiers[i].Name,
|
||||||
|
Prefix: tiers[i].GCS.Prefix,
|
||||||
|
Region: tiers[i].GCS.Region,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
case madmin.Azure:
|
||||||
|
tiersList = append(tiersList, &models.Tier{
|
||||||
|
Type: models.TierTypeAzure,
|
||||||
|
Azure: &models.TierAzure{
|
||||||
|
Accountkey: tiers[i].Azure.AccountKey,
|
||||||
|
Accountname: tiers[i].Azure.AccountName,
|
||||||
|
Bucket: tiers[i].Azure.Bucket,
|
||||||
|
Endpoint: tiers[i].Azure.Endpoint,
|
||||||
|
Name: tiers[i].Name,
|
||||||
|
Prefix: tiers[i].Azure.Prefix,
|
||||||
|
Region: tiers[i].Azure.Region,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
case madmin.Unsupported:
|
||||||
|
tiersList = append(tiersList, &models.Tier{
|
||||||
|
Type: models.TierTypeUnsupported,
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// build response
|
||||||
|
return &models.TierListResponse{
|
||||||
|
Items: tiersList,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// getTiersResponse returns a response with a list of tiers
|
||||||
|
func getTiersResponse(session *models.Principal) (*models.TierListResponse, *models.Error) {
|
||||||
|
mAdmin, err := newMAdminClient(session)
|
||||||
|
if err != nil {
|
||||||
|
return nil, prepareError(err)
|
||||||
|
}
|
||||||
|
// create a minioClient interface implementation
|
||||||
|
// defining the client to be used
|
||||||
|
adminClient := adminClient{client: mAdmin}
|
||||||
|
// 20 seconds timeout
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
// serialize output
|
||||||
|
tiersResp, err := getTiers(ctx, adminClient)
|
||||||
|
if err != nil {
|
||||||
|
return nil, prepareError(err)
|
||||||
|
}
|
||||||
|
return tiersResp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func addTier(ctx context.Context, client MinioAdmin, params *admin_api.AddTierParams) error {
|
||||||
|
|
||||||
|
var cfg *madmin.TierConfig
|
||||||
|
var err error
|
||||||
|
|
||||||
|
switch params.Body.Type {
|
||||||
|
case models.TierTypeS3:
|
||||||
|
cfg, err = madmin.NewTierS3(
|
||||||
|
params.Body.S3.Name,
|
||||||
|
params.Body.S3.Accesskey,
|
||||||
|
params.Body.S3.Secretkey,
|
||||||
|
params.Body.S3.Bucket,
|
||||||
|
madmin.S3Region(params.Body.S3.Region),
|
||||||
|
madmin.S3Prefix(params.Body.S3.Prefix),
|
||||||
|
madmin.S3Endpoint(params.Body.S3.Endpoint),
|
||||||
|
madmin.S3StorageClass(params.Body.S3.Storageclass),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
case models.TierTypeGcs:
|
||||||
|
gcsOpts := []madmin.GCSOptions{}
|
||||||
|
prefix := params.Body.Gcs.Prefix
|
||||||
|
if prefix != "" {
|
||||||
|
gcsOpts = append(gcsOpts, madmin.GCSPrefix(prefix))
|
||||||
|
}
|
||||||
|
|
||||||
|
region := params.Body.Gcs.Region
|
||||||
|
if region != "" {
|
||||||
|
gcsOpts = append(gcsOpts, madmin.GCSRegion(region))
|
||||||
|
}
|
||||||
|
base64Text := make([]byte, base64.StdEncoding.EncodedLen(len(params.Body.Gcs.Creds)))
|
||||||
|
l, _ := base64.StdEncoding.Decode(base64Text, []byte(params.Body.Gcs.Creds))
|
||||||
|
|
||||||
|
cfg, err = madmin.NewTierGCS(
|
||||||
|
params.Body.Gcs.Name,
|
||||||
|
base64Text[:l],
|
||||||
|
params.Body.Gcs.Bucket,
|
||||||
|
gcsOpts...,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
case models.TierTypeAzure:
|
||||||
|
cfg, err = madmin.NewTierAzure(
|
||||||
|
params.Body.Azure.Name,
|
||||||
|
params.Body.Azure.Accountname,
|
||||||
|
params.Body.Azure.Accountkey,
|
||||||
|
params.Body.Azure.Bucket,
|
||||||
|
madmin.AzurePrefix(params.Body.Azure.Prefix),
|
||||||
|
madmin.AzureEndpoint(params.Body.Azure.Endpoint),
|
||||||
|
madmin.AzureRegion(params.Body.Azure.Region),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
case models.TierTypeUnsupported:
|
||||||
|
cfg = &madmin.TierConfig{
|
||||||
|
Type: madmin.Unsupported,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
err = client.addTier(ctx, cfg)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// getAddTierResponse returns the response of admin tier
|
||||||
|
func getAddTierResponse(session *models.Principal, params *admin_api.AddTierParams) *models.Error {
|
||||||
|
mAdmin, err := newMAdminClient(session)
|
||||||
|
if err != nil {
|
||||||
|
return prepareError(err)
|
||||||
|
}
|
||||||
|
// create a minioClient interface implementation
|
||||||
|
// defining the client to be used
|
||||||
|
adminClient := adminClient{client: mAdmin}
|
||||||
|
// 20 seconds timeout
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
// serialize output
|
||||||
|
errTier := addTier(ctx, adminClient, params)
|
||||||
|
if errTier != nil {
|
||||||
|
return prepareError(errTier)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTier(ctx context.Context, client MinioAdmin, params *admin_api.GetTierParams) (*models.Tier, error) {
|
||||||
|
|
||||||
|
tiers, err := client.listTiers(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for i := range tiers {
|
||||||
|
switch tiers[i].Type {
|
||||||
|
case madmin.S3:
|
||||||
|
if params.Type != models.TierTypeS3 || tiers[i].Name != params.Name {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
return &models.Tier{
|
||||||
|
Type: models.TierTypeS3,
|
||||||
|
S3: &models.TierS3{
|
||||||
|
Accesskey: tiers[i].S3.AccessKey,
|
||||||
|
Bucket: tiers[i].S3.Bucket,
|
||||||
|
Endpoint: tiers[i].S3.Endpoint,
|
||||||
|
Name: tiers[i].Name,
|
||||||
|
Prefix: tiers[i].S3.Prefix,
|
||||||
|
Region: tiers[i].S3.Region,
|
||||||
|
Secretkey: tiers[i].S3.SecretKey,
|
||||||
|
Storageclass: tiers[i].S3.StorageClass,
|
||||||
|
},
|
||||||
|
}, err
|
||||||
|
case madmin.GCS:
|
||||||
|
if params.Type != models.TierTypeGcs || tiers[i].Name != params.Name {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
return &models.Tier{
|
||||||
|
Type: models.TierTypeGcs,
|
||||||
|
Gcs: &models.TierGcs{
|
||||||
|
Bucket: tiers[i].GCS.Bucket,
|
||||||
|
Creds: tiers[i].GCS.Creds,
|
||||||
|
Endpoint: tiers[i].GCS.Endpoint,
|
||||||
|
Name: tiers[i].Name,
|
||||||
|
Prefix: tiers[i].GCS.Prefix,
|
||||||
|
Region: tiers[i].GCS.Region,
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
case madmin.Azure:
|
||||||
|
if params.Type != models.TierTypeAzure || tiers[i].Name != params.Name {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
return &models.Tier{
|
||||||
|
Type: models.TierTypeAzure,
|
||||||
|
Azure: &models.TierAzure{
|
||||||
|
Accountkey: tiers[i].Azure.AccountKey,
|
||||||
|
Accountname: tiers[i].Azure.AccountName,
|
||||||
|
Bucket: tiers[i].Azure.Bucket,
|
||||||
|
Endpoint: tiers[i].Azure.Endpoint,
|
||||||
|
Name: tiers[i].Name,
|
||||||
|
Prefix: tiers[i].Azure.Prefix,
|
||||||
|
Region: tiers[i].Azure.Region,
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// build response
|
||||||
|
return nil, ErrorGenericNotFound
|
||||||
|
}
|
||||||
|
|
||||||
|
// getGetTierResponse returns a tier
|
||||||
|
func getGetTierResponse(session *models.Principal, params *admin_api.GetTierParams) (*models.Tier, *models.Error) {
|
||||||
|
mAdmin, err := newMAdminClient(session)
|
||||||
|
if err != nil {
|
||||||
|
return nil, prepareError(err)
|
||||||
|
}
|
||||||
|
// create a minioClient interface implementation
|
||||||
|
// defining the client to be used
|
||||||
|
adminClient := adminClient{client: mAdmin}
|
||||||
|
// 20 seconds timeout
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
// serialize output
|
||||||
|
addTierResp, err := getTier(ctx, adminClient, params)
|
||||||
|
if err != nil {
|
||||||
|
return nil, prepareError(err)
|
||||||
|
}
|
||||||
|
return addTierResp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func editTierCredentials(ctx context.Context, client MinioAdmin, params *admin_api.EditTierCredentialsParams) error {
|
||||||
|
base64Text := make([]byte, base64.StdEncoding.EncodedLen(len(params.Body.Creds)))
|
||||||
|
l, err := base64.StdEncoding.Decode(base64Text, []byte(params.Body.Creds))
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
creds := madmin.TierCreds{
|
||||||
|
AccessKey: params.Body.AccessKey,
|
||||||
|
SecretKey: params.Body.SecretKey,
|
||||||
|
CredsJSON: base64Text[:l],
|
||||||
|
}
|
||||||
|
return client.editTierCreds(ctx, params.Name, creds)
|
||||||
|
}
|
||||||
|
|
||||||
|
// getEditTierCredentialsResponse returns the result of editing credentials for a tier
|
||||||
|
func getEditTierCredentialsResponse(session *models.Principal, params *admin_api.EditTierCredentialsParams) *models.Error {
|
||||||
|
mAdmin, err := newMAdminClient(session)
|
||||||
|
if err != nil {
|
||||||
|
return prepareError(err)
|
||||||
|
}
|
||||||
|
// create a minioClient interface implementation
|
||||||
|
// defining the client to be used
|
||||||
|
adminClient := adminClient{client: mAdmin}
|
||||||
|
// 20 seconds timeout
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
// serialize output
|
||||||
|
err = editTierCredentials(ctx, adminClient, params)
|
||||||
|
if err != nil {
|
||||||
|
return prepareError(err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
235
restapi/admin_tiers_test.go
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package restapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
"github.com/minio/console/restapi/operations/admin_api"
|
||||||
|
"github.com/minio/minio/pkg/madmin"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
// assigning mock at runtime instead of compile time
|
||||||
|
var minioListTiersMock func(ctx context.Context) ([]*madmin.TierConfig, error)
|
||||||
|
|
||||||
|
// mock function of listTiers()
|
||||||
|
func (ac adminClientMock) listTiers(ctx context.Context) ([]*madmin.TierConfig, error) {
|
||||||
|
return minioListTiersMock(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// assigning mock at runtime instead of compile time
|
||||||
|
var minioAddTiersMock func(ctx context.Context, tier *madmin.TierConfig) error
|
||||||
|
|
||||||
|
// mock function of addTier()
|
||||||
|
func (ac adminClientMock) addTier(ctx context.Context, tier *madmin.TierConfig) error {
|
||||||
|
return minioAddTiersMock(ctx, tier)
|
||||||
|
}
|
||||||
|
|
||||||
|
// assigning mock at runtime instead of compile time
|
||||||
|
var minioEditTiersMock func(ctx context.Context, tierName string, creds madmin.TierCreds) error
|
||||||
|
|
||||||
|
// mock function of editTierCreds()
|
||||||
|
func (ac adminClientMock) editTierCreds(ctx context.Context, tierName string, creds madmin.TierCreds) error {
|
||||||
|
return minioEditTiersMock(ctx, tierName, creds)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetTiers(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
// mock minIO client
|
||||||
|
adminClient := adminClientMock{}
|
||||||
|
|
||||||
|
function := "getTiers()"
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
// Test-1 : getBucketLifecycle() get list of tiers
|
||||||
|
// mock lifecycle response from MinIO
|
||||||
|
returnListMock := []*madmin.TierConfig{
|
||||||
|
{
|
||||||
|
Version: "V1",
|
||||||
|
Type: madmin.TierType(0),
|
||||||
|
Name: "S3 Tier",
|
||||||
|
S3: &madmin.TierS3{
|
||||||
|
Endpoint: "https://s3tier.test.com/",
|
||||||
|
AccessKey: "Access Key",
|
||||||
|
SecretKey: "Secret Key",
|
||||||
|
Bucket: "buckets3",
|
||||||
|
Prefix: "pref1",
|
||||||
|
Region: "us-west-1",
|
||||||
|
StorageClass: "TT1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
expectedOutput := &models.TierListResponse{
|
||||||
|
Items: []*models.Tier{
|
||||||
|
{
|
||||||
|
Type: "S3",
|
||||||
|
S3: &models.TierS3{
|
||||||
|
Accesskey: "Access Key",
|
||||||
|
Secretkey: "Secret Key",
|
||||||
|
Bucket: "buckets3",
|
||||||
|
Endpoint: "https://s3tier.test.com/",
|
||||||
|
Name: "S3 Tier",
|
||||||
|
Prefix: "pref1",
|
||||||
|
Region: "us-west-1",
|
||||||
|
Storageclass: "TT1",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
minioListTiersMock = func(ctx context.Context) ([]*madmin.TierConfig, error) {
|
||||||
|
return returnListMock, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
tiersList, err := getTiers(ctx, adminClient)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Failed on %s:, error occurred: %s", function, err.Error())
|
||||||
|
}
|
||||||
|
// verify length of tiers list is correct
|
||||||
|
assert.Equal(len(tiersList.Items), len(returnListMock), fmt.Sprintf("Failed on %s: length of lists is not the same", function))
|
||||||
|
for i, conf := range returnListMock {
|
||||||
|
if conf.Type == madmin.TierType(0) {
|
||||||
|
// S3
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Name, conf.Name)
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Bucket, conf.S3.Bucket)
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Prefix, conf.S3.Prefix)
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Accesskey, conf.S3.AccessKey)
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Secretkey, conf.S3.SecretKey)
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Endpoint, conf.S3.Endpoint)
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Region, conf.S3.Region)
|
||||||
|
assert.Equal(expectedOutput.Items[i].S3.Storageclass, conf.S3.StorageClass)
|
||||||
|
} else if conf.Type == madmin.TierType(1) {
|
||||||
|
// Azure
|
||||||
|
assert.Equal(expectedOutput.Items[i].Azure.Name, conf.Name)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Azure.Bucket, conf.Azure.Bucket)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Azure.Prefix, conf.Azure.Prefix)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Azure.Accountkey, conf.Azure.AccountKey)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Azure.Accountname, conf.Azure.AccountName)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Azure.Endpoint, conf.Azure.Endpoint)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Azure.Region, conf.Azure.Region)
|
||||||
|
} else if conf.Type == madmin.TierType(2) {
|
||||||
|
// GCS
|
||||||
|
assert.Equal(expectedOutput.Items[i].Gcs.Name, conf.Name)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Gcs.Bucket, conf.GCS.Bucket)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Gcs.Prefix, conf.GCS.Prefix)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Gcs.Creds, conf.GCS.Creds)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Gcs.Endpoint, conf.GCS.Endpoint)
|
||||||
|
assert.Equal(expectedOutput.Items[i].Gcs.Region, conf.GCS.Region)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test-2 : getBucketLifecycle() list is empty
|
||||||
|
returnListMockT2 := []*madmin.TierConfig{}
|
||||||
|
|
||||||
|
minioListTiersMock = func(ctx context.Context) ([]*madmin.TierConfig, error) {
|
||||||
|
return returnListMockT2, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
tiersListT2, err := getTiers(ctx, adminClient)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Failed on %s:, error occurred: %s", function, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(tiersListT2.Items) != 0 {
|
||||||
|
t.Errorf("Failed on %s:, returned list was not empty", function)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAddTier(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
// mock minIO client
|
||||||
|
adminClient := adminClientMock{}
|
||||||
|
|
||||||
|
function := "addTier()"
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
// Test-1: addTier() add new Tier
|
||||||
|
minioAddTiersMock = func(ctx context.Context, tier *madmin.TierConfig) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
paramsToAdd := admin_api.AddTierParams{
|
||||||
|
Body: &models.Tier{
|
||||||
|
Type: "S3",
|
||||||
|
S3: &models.TierS3{
|
||||||
|
Accesskey: "TestAK",
|
||||||
|
Bucket: "bucket1",
|
||||||
|
Endpoint: "https://test.com/",
|
||||||
|
Name: "TIERS3",
|
||||||
|
Prefix: "Pr1",
|
||||||
|
Region: "us-west-1",
|
||||||
|
Secretkey: "SecretK",
|
||||||
|
Storageclass: "STCLASS",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
err := addTier(ctx, adminClient, ¶msToAdd)
|
||||||
|
assert.Equal(nil, err, fmt.Sprintf("Failed on %s: Error returned", function))
|
||||||
|
|
||||||
|
// Test-2: addTier() error adding Tier
|
||||||
|
minioAddTiersMock = func(ctx context.Context, tier *madmin.TierConfig) error {
|
||||||
|
return errors.New("error setting new tier")
|
||||||
|
}
|
||||||
|
|
||||||
|
err2 := addTier(ctx, adminClient, ¶msToAdd)
|
||||||
|
|
||||||
|
assert.Equal(errors.New("error setting new tier"), err2, fmt.Sprintf("Failed on %s: Error returned", function))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestUpdateTierCreds(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
// mock minIO client
|
||||||
|
adminClient := adminClientMock{}
|
||||||
|
|
||||||
|
function := "editTierCredentials()"
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
// Test-1: editTierCredentials() update Tier configuration
|
||||||
|
minioEditTiersMock = func(ctx context.Context, tierName string, creds madmin.TierCreds) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
params := &admin_api.EditTierCredentialsParams{
|
||||||
|
Name: "TESTTIER",
|
||||||
|
Body: &models.TierCredentialsRequest{
|
||||||
|
AccessKey: "New Key",
|
||||||
|
SecretKey: "Secret Key",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
err := editTierCredentials(ctx, adminClient, params)
|
||||||
|
|
||||||
|
assert.Equal(nil, err, fmt.Sprintf("Failed on %s: Error returned", function))
|
||||||
|
|
||||||
|
// Test-2: editTierCredentials() update Tier configuration failure
|
||||||
|
minioEditTiersMock = func(ctx context.Context, tierName string, creds madmin.TierCreds) error {
|
||||||
|
return errors.New("error message")
|
||||||
|
}
|
||||||
|
|
||||||
|
errT2 := editTierCredentials(ctx, adminClient, params)
|
||||||
|
|
||||||
|
assert.Equal(errors.New("error message"), errT2, fmt.Sprintf("Failed on %s: Error returned", function))
|
||||||
|
}
|
||||||
@@ -105,6 +105,12 @@ type MinioAdmin interface {
|
|||||||
changePassword(ctx context.Context, accessKey, secretKey string) error
|
changePassword(ctx context.Context, accessKey, secretKey string) error
|
||||||
|
|
||||||
serverHealthInfo(ctx context.Context, healthDataTypes []madmin.HealthDataType, deadline time.Duration) <-chan madmin.HealthInfo
|
serverHealthInfo(ctx context.Context, healthDataTypes []madmin.HealthDataType, deadline time.Duration) <-chan madmin.HealthInfo
|
||||||
|
// List Tiers
|
||||||
|
listTiers(ctx context.Context) ([]*madmin.TierConfig, error)
|
||||||
|
// Add Tier
|
||||||
|
addTier(ctx context.Context, tier *madmin.TierConfig) error
|
||||||
|
// Edit Tier Credentials
|
||||||
|
editTierCreds(ctx context.Context, tierName string, creds madmin.TierCreds) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface implementation
|
// Interface implementation
|
||||||
@@ -226,7 +232,15 @@ func (ac adminClient) stopProfiling(ctx context.Context) (io.ReadCloser, error)
|
|||||||
|
|
||||||
// implements madmin.ServiceTrace()
|
// implements madmin.ServiceTrace()
|
||||||
func (ac adminClient) serviceTrace(ctx context.Context, allTrace, errTrace bool) <-chan madmin.ServiceTraceInfo {
|
func (ac adminClient) serviceTrace(ctx context.Context, allTrace, errTrace bool) <-chan madmin.ServiceTraceInfo {
|
||||||
return ac.client.ServiceTrace(ctx, allTrace, errTrace)
|
tracingOptions := madmin.ServiceTraceOpts{
|
||||||
|
S3: true,
|
||||||
|
OnlyErrors: errTrace,
|
||||||
|
Internal: allTrace,
|
||||||
|
Storage: allTrace,
|
||||||
|
OS: allTrace,
|
||||||
|
}
|
||||||
|
|
||||||
|
return ac.client.ServiceTrace(ctx, tracingOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// implements madmin.GetLogs()
|
// implements madmin.GetLogs()
|
||||||
@@ -236,12 +250,19 @@ func (ac adminClient) getLogs(ctx context.Context, node string, lineCnt int, log
|
|||||||
|
|
||||||
// implements madmin.AddServiceAccount()
|
// implements madmin.AddServiceAccount()
|
||||||
func (ac adminClient) addServiceAccount(ctx context.Context, policy *iampolicy.Policy) (mauth.Credentials, error) {
|
func (ac adminClient) addServiceAccount(ctx context.Context, policy *iampolicy.Policy) (mauth.Credentials, error) {
|
||||||
return ac.client.AddServiceAccount(ctx, policy)
|
// TODO: Fix this
|
||||||
|
return ac.client.AddServiceAccount(ctx, madmin.AddServiceAccountReq{
|
||||||
|
Policy: policy,
|
||||||
|
TargetUser: "",
|
||||||
|
AccessKey: "",
|
||||||
|
SecretKey: "",
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// implements madmin.ListServiceAccounts()
|
// implements madmin.ListServiceAccounts()
|
||||||
func (ac adminClient) listServiceAccounts(ctx context.Context) (madmin.ListServiceAccountsResp, error) {
|
func (ac adminClient) listServiceAccounts(ctx context.Context) (madmin.ListServiceAccountsResp, error) {
|
||||||
return ac.client.ListServiceAccounts(ctx)
|
// TODO: Fix this
|
||||||
|
return ac.client.ListServiceAccounts(ctx, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
// implements madmin.DeleteServiceAccount()
|
// implements madmin.DeleteServiceAccount()
|
||||||
@@ -295,6 +316,21 @@ func (ac adminClient) serverHealthInfo(ctx context.Context, healthDataTypes []ma
|
|||||||
return ac.client.ServerHealthInfo(ctx, healthDataTypes, deadline)
|
return ac.client.ServerHealthInfo(ctx, healthDataTypes, deadline)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// implements madmin.listTiers()
|
||||||
|
func (ac adminClient) listTiers(ctx context.Context) ([]*madmin.TierConfig, error) {
|
||||||
|
return ac.client.ListTiers(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
|
// implements madmin.AddTier()
|
||||||
|
func (ac adminClient) addTier(ctx context.Context, cfg *madmin.TierConfig) error {
|
||||||
|
return ac.client.AddTier(ctx, cfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// implements madmin.EditTier()
|
||||||
|
func (ac adminClient) editTierCreds(ctx context.Context, tierName string, creds madmin.TierCreds) error {
|
||||||
|
return ac.client.EditTier(ctx, tierName, creds)
|
||||||
|
}
|
||||||
|
|
||||||
func newMAdminClient(sessionClaims *models.Principal) (*madmin.AdminClient, error) {
|
func newMAdminClient(sessionClaims *models.Principal) (*madmin.AdminClient, error) {
|
||||||
adminClient, err := newAdminFromClaims(sessionClaims)
|
adminClient, err := newAdminFromClaims(sessionClaims)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import (
|
|||||||
"github.com/minio/mc/pkg/probe"
|
"github.com/minio/mc/pkg/probe"
|
||||||
"github.com/minio/minio-go/v7"
|
"github.com/minio/minio-go/v7"
|
||||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||||
|
"github.com/minio/minio-go/v7/pkg/lifecycle"
|
||||||
"github.com/minio/minio-go/v7/pkg/notification"
|
"github.com/minio/minio-go/v7/pkg/notification"
|
||||||
"github.com/minio/minio-go/v7/pkg/tags"
|
"github.com/minio/minio-go/v7/pkg/tags"
|
||||||
)
|
)
|
||||||
@@ -72,6 +73,8 @@ type MinioClient interface {
|
|||||||
setObjectLockConfig(ctx context.Context, bucketName string, mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit) error
|
setObjectLockConfig(ctx context.Context, bucketName string, mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit) error
|
||||||
getBucketObjectLockConfig(ctx context.Context, bucketName string) (mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit, err error)
|
getBucketObjectLockConfig(ctx context.Context, bucketName string) (mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit, err error)
|
||||||
getObjectLockConfig(ctx context.Context, bucketName string) (lock string, mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit, err error)
|
getObjectLockConfig(ctx context.Context, bucketName string) (lock string, mode *minio.RetentionMode, validity *uint, unit *minio.ValidityUnit, err error)
|
||||||
|
getLifecycleRules(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error)
|
||||||
|
setBucketLifecycle(ctx context.Context, bucketName string, config *lifecycle.Configuration) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface implementation
|
// Interface implementation
|
||||||
@@ -185,6 +188,14 @@ func (c minioClient) getObjectLockConfig(ctx context.Context, bucketName string)
|
|||||||
return c.client.GetObjectLockConfig(ctx, bucketName)
|
return c.client.GetObjectLockConfig(ctx, bucketName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c minioClient) getLifecycleRules(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error) {
|
||||||
|
return c.client.GetBucketLifecycle(ctx, bucketName)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c minioClient) setBucketLifecycle(ctx context.Context, bucketName string, config *lifecycle.Configuration) error {
|
||||||
|
return c.client.SetBucketLifecycle(ctx, bucketName, config)
|
||||||
|
}
|
||||||
|
|
||||||
// MCClient interface with all functions to be implemented
|
// MCClient interface with all functions to be implemented
|
||||||
// by mock when testing, it should include all mc/S3Client respective api calls
|
// by mock when testing, it should include all mc/S3Client respective api calls
|
||||||
// that are used within this project.
|
// that are used within this project.
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ func configureAPI(api *operations.ConsoleAPI) http.Handler {
|
|||||||
registerConfigHandlers(api)
|
registerConfigHandlers(api)
|
||||||
// Register bucket events handlers
|
// Register bucket events handlers
|
||||||
registerBucketEventsHandlers(api)
|
registerBucketEventsHandlers(api)
|
||||||
|
// Register bucket lifecycle handlers
|
||||||
|
registerBucketsLifecycleHandlers(api)
|
||||||
// Register service handlers
|
// Register service handlers
|
||||||
registerServiceHandlers(api)
|
registerServiceHandlers(api)
|
||||||
// Register profiling handlers
|
// Register profiling handlers
|
||||||
@@ -123,6 +125,8 @@ func configureAPI(api *operations.ConsoleAPI) http.Handler {
|
|||||||
registerLogSearchHandlers(api)
|
registerLogSearchHandlers(api)
|
||||||
// Register admin subscription handlers
|
// Register admin subscription handlers
|
||||||
registerSubscriptionHandlers(api)
|
registerSubscriptionHandlers(api)
|
||||||
|
// Register Account handlers
|
||||||
|
registerAdminTiersHandlers(api)
|
||||||
|
|
||||||
// Operator Console
|
// Operator Console
|
||||||
// Register tenant handlers
|
// Register tenant handlers
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ var (
|
|||||||
errorGenericInvalidSession = errors.New("invalid session")
|
errorGenericInvalidSession = errors.New("invalid session")
|
||||||
errorGenericUnauthorized = errors.New("unauthorized")
|
errorGenericUnauthorized = errors.New("unauthorized")
|
||||||
errorGenericForbidden = errors.New("forbidden")
|
errorGenericForbidden = errors.New("forbidden")
|
||||||
ErrorGenericNotFound = errors.New("not found")
|
// ErrorGenericNotFound Generic error for not found
|
||||||
|
ErrorGenericNotFound = errors.New("not found")
|
||||||
// Explicit error messages
|
// Explicit error messages
|
||||||
errorInvalidErasureCodingValue = errors.New("invalid Erasure Coding Value")
|
errorInvalidErasureCodingValue = errors.New("invalid Erasure Coding Value")
|
||||||
errorUnableToGetTenantUsage = errors.New("unable to get tenant usage")
|
errorUnableToGetTenantUsage = errors.New("unable to get tenant usage")
|
||||||
@@ -56,6 +57,10 @@ func prepareError(err ...error) *models.Error {
|
|||||||
errorCode = 404
|
errorCode = 404
|
||||||
errorMessage = ErrorGenericNotFound.Error()
|
errorMessage = ErrorGenericNotFound.Error()
|
||||||
}
|
}
|
||||||
|
if err[0] == ErrorGenericNotFound {
|
||||||
|
errorCode = 404
|
||||||
|
errorMessage = ErrorGenericNotFound.Error()
|
||||||
|
}
|
||||||
if errors.Is(err[0], errInvalidCredentials) {
|
if errors.Is(err[0], errInvalidCredentials) {
|
||||||
errorCode = 401
|
errorCode = 401
|
||||||
errorMessage = errInvalidCredentials.Error()
|
errorMessage = errInvalidCredentials.Error()
|
||||||
@@ -133,6 +138,11 @@ func prepareError(err ...error) *models.Error {
|
|||||||
if len(err) > 2 && err[2] != nil {
|
if len(err) > 2 && err[2] != nil {
|
||||||
log.Print("debugging error: ", err[2].Error())
|
log.Print("debugging error: ", err[2].Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
errRemoteTierExists := errors.New("Specified remote tier already exists") //nolint
|
||||||
|
if errors.Is(err[0], errRemoteTierExists) {
|
||||||
|
errorMessage = err[0].Error()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return &models.Error{Code: errorCode, Message: swag.String(errorMessage)}
|
return &models.Error{Code: errorCode, Message: swag.String(errorMessage)}
|
||||||
}
|
}
|
||||||
|
|||||||
90
restapi/operations/admin_api/add_tier.go
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddTierHandlerFunc turns a function with the right signature into a add tier handler
|
||||||
|
type AddTierHandlerFunc func(AddTierParams, *models.Principal) middleware.Responder
|
||||||
|
|
||||||
|
// Handle executing the request and returning a response
|
||||||
|
func (fn AddTierHandlerFunc) Handle(params AddTierParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return fn(params, principal)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddTierHandler interface for that can handle valid add tier params
|
||||||
|
type AddTierHandler interface {
|
||||||
|
Handle(AddTierParams, *models.Principal) middleware.Responder
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAddTier creates a new http.Handler for the add tier operation
|
||||||
|
func NewAddTier(ctx *middleware.Context, handler AddTierHandler) *AddTier {
|
||||||
|
return &AddTier{Context: ctx, Handler: handler}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*AddTier swagger:route POST /admin/tiers AdminAPI addTier
|
||||||
|
|
||||||
|
Allows to configure a new tier
|
||||||
|
|
||||||
|
*/
|
||||||
|
type AddTier struct {
|
||||||
|
Context *middleware.Context
|
||||||
|
Handler AddTierHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *AddTier) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||||
|
if rCtx != nil {
|
||||||
|
r = rCtx
|
||||||
|
}
|
||||||
|
var Params = NewAddTierParams()
|
||||||
|
|
||||||
|
uprinc, aCtx, err := o.Context.Authorize(r, route)
|
||||||
|
if err != nil {
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if aCtx != nil {
|
||||||
|
r = aCtx
|
||||||
|
}
|
||||||
|
var principal *models.Principal
|
||||||
|
if uprinc != nil {
|
||||||
|
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := o.Handler.Handle(Params, principal) // actually handle the request
|
||||||
|
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||||
|
|
||||||
|
}
|
||||||
94
restapi/operations/admin_api/add_tier_parameters.go
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewAddTierParams creates a new AddTierParams object
|
||||||
|
// no default values defined in spec.
|
||||||
|
func NewAddTierParams() AddTierParams {
|
||||||
|
|
||||||
|
return AddTierParams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddTierParams contains all the bound params for the add tier operation
|
||||||
|
// typically these are obtained from a http.Request
|
||||||
|
//
|
||||||
|
// swagger:parameters AddTier
|
||||||
|
type AddTierParams struct {
|
||||||
|
|
||||||
|
// HTTP Request Object
|
||||||
|
HTTPRequest *http.Request `json:"-"`
|
||||||
|
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: body
|
||||||
|
*/
|
||||||
|
Body *models.Tier
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||||
|
// for simple values it will use straight method calls.
|
||||||
|
//
|
||||||
|
// To ensure default values, the struct must have been initialized with NewAddTierParams() beforehand.
|
||||||
|
func (o *AddTierParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
o.HTTPRequest = r
|
||||||
|
|
||||||
|
if runtime.HasBody(r) {
|
||||||
|
defer r.Body.Close()
|
||||||
|
var body models.Tier
|
||||||
|
if err := route.Consumer.Consume(r.Body, &body); err != nil {
|
||||||
|
if err == io.EOF {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.NewParseError("body", "body", "", err))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// validate body object
|
||||||
|
if err := body.Validate(route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) == 0 {
|
||||||
|
o.Body = &body
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
}
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
113
restapi/operations/admin_api/add_tier_responses.go
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddTierCreatedCode is the HTTP code returned for type AddTierCreated
|
||||||
|
const AddTierCreatedCode int = 201
|
||||||
|
|
||||||
|
/*AddTierCreated A successful response.
|
||||||
|
|
||||||
|
swagger:response addTierCreated
|
||||||
|
*/
|
||||||
|
type AddTierCreated struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAddTierCreated creates AddTierCreated with default headers values
|
||||||
|
func NewAddTierCreated() *AddTierCreated {
|
||||||
|
|
||||||
|
return &AddTierCreated{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *AddTierCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
|
||||||
|
|
||||||
|
rw.WriteHeader(201)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*AddTierDefault Generic error response.
|
||||||
|
|
||||||
|
swagger:response addTierDefault
|
||||||
|
*/
|
||||||
|
type AddTierDefault struct {
|
||||||
|
_statusCode int
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Error `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAddTierDefault creates AddTierDefault with default headers values
|
||||||
|
func NewAddTierDefault(code int) *AddTierDefault {
|
||||||
|
if code <= 0 {
|
||||||
|
code = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
return &AddTierDefault{
|
||||||
|
_statusCode: code,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatusCode adds the status to the add tier default response
|
||||||
|
func (o *AddTierDefault) WithStatusCode(code int) *AddTierDefault {
|
||||||
|
o._statusCode = code
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusCode sets the status to the add tier default response
|
||||||
|
func (o *AddTierDefault) SetStatusCode(code int) {
|
||||||
|
o._statusCode = code
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the add tier default response
|
||||||
|
func (o *AddTierDefault) WithPayload(payload *models.Error) *AddTierDefault {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the add tier default response
|
||||||
|
func (o *AddTierDefault) SetPayload(payload *models.Error) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *AddTierDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(o._statusCode)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
104
restapi/operations/admin_api/add_tier_urlbuilder.go
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"net/url"
|
||||||
|
golangswaggerpaths "path"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddTierURL generates an URL for the add tier operation
|
||||||
|
type AddTierURL struct {
|
||||||
|
_basePath string
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *AddTierURL) WithBasePath(bp string) *AddTierURL {
|
||||||
|
o.SetBasePath(bp)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *AddTierURL) SetBasePath(bp string) {
|
||||||
|
o._basePath = bp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a url path and query string
|
||||||
|
func (o *AddTierURL) Build() (*url.URL, error) {
|
||||||
|
var _result url.URL
|
||||||
|
|
||||||
|
var _path = "/admin/tiers"
|
||||||
|
|
||||||
|
_basePath := o._basePath
|
||||||
|
if _basePath == "" {
|
||||||
|
_basePath = "/api/v1"
|
||||||
|
}
|
||||||
|
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||||
|
|
||||||
|
return &_result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must is a helper function to panic when the url builder returns an error
|
||||||
|
func (o *AddTierURL) Must(u *url.URL, err error) *url.URL {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if u == nil {
|
||||||
|
panic("url can't be nil")
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the string representation of the path with query string
|
||||||
|
func (o *AddTierURL) String() string {
|
||||||
|
return o.Must(o.Build()).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildFull builds a full url with scheme, host, path and query string
|
||||||
|
func (o *AddTierURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||||
|
if scheme == "" {
|
||||||
|
return nil, errors.New("scheme is required for a full url on AddTierURL")
|
||||||
|
}
|
||||||
|
if host == "" {
|
||||||
|
return nil, errors.New("host is required for a full url on AddTierURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
base, err := o.Build()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Scheme = scheme
|
||||||
|
base.Host = host
|
||||||
|
return base, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFull returns the string representation of a complete url
|
||||||
|
func (o *AddTierURL) StringFull(scheme, host string) string {
|
||||||
|
return o.Must(o.BuildFull(scheme, host)).String()
|
||||||
|
}
|
||||||
90
restapi/operations/admin_api/edit_tier_credentials.go
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EditTierCredentialsHandlerFunc turns a function with the right signature into a edit tier credentials handler
|
||||||
|
type EditTierCredentialsHandlerFunc func(EditTierCredentialsParams, *models.Principal) middleware.Responder
|
||||||
|
|
||||||
|
// Handle executing the request and returning a response
|
||||||
|
func (fn EditTierCredentialsHandlerFunc) Handle(params EditTierCredentialsParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return fn(params, principal)
|
||||||
|
}
|
||||||
|
|
||||||
|
// EditTierCredentialsHandler interface for that can handle valid edit tier credentials params
|
||||||
|
type EditTierCredentialsHandler interface {
|
||||||
|
Handle(EditTierCredentialsParams, *models.Principal) middleware.Responder
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewEditTierCredentials creates a new http.Handler for the edit tier credentials operation
|
||||||
|
func NewEditTierCredentials(ctx *middleware.Context, handler EditTierCredentialsHandler) *EditTierCredentials {
|
||||||
|
return &EditTierCredentials{Context: ctx, Handler: handler}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*EditTierCredentials swagger:route PUT /admin/tiers/{type}/{name}/credentials AdminAPI editTierCredentials
|
||||||
|
|
||||||
|
Edit Tier Credentials
|
||||||
|
|
||||||
|
*/
|
||||||
|
type EditTierCredentials struct {
|
||||||
|
Context *middleware.Context
|
||||||
|
Handler EditTierCredentialsHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *EditTierCredentials) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||||
|
if rCtx != nil {
|
||||||
|
r = rCtx
|
||||||
|
}
|
||||||
|
var Params = NewEditTierCredentialsParams()
|
||||||
|
|
||||||
|
uprinc, aCtx, err := o.Context.Authorize(r, route)
|
||||||
|
if err != nil {
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if aCtx != nil {
|
||||||
|
r = aCtx
|
||||||
|
}
|
||||||
|
var principal *models.Principal
|
||||||
|
if uprinc != nil {
|
||||||
|
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := o.Handler.Handle(Params, principal) // actually handle the request
|
||||||
|
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||||
|
|
||||||
|
}
|
||||||
160
restapi/operations/admin_api/edit_tier_credentials_parameters.go
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewEditTierCredentialsParams creates a new EditTierCredentialsParams object
|
||||||
|
// no default values defined in spec.
|
||||||
|
func NewEditTierCredentialsParams() EditTierCredentialsParams {
|
||||||
|
|
||||||
|
return EditTierCredentialsParams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// EditTierCredentialsParams contains all the bound params for the edit tier credentials operation
|
||||||
|
// typically these are obtained from a http.Request
|
||||||
|
//
|
||||||
|
// swagger:parameters EditTierCredentials
|
||||||
|
type EditTierCredentialsParams struct {
|
||||||
|
|
||||||
|
// HTTP Request Object
|
||||||
|
HTTPRequest *http.Request `json:"-"`
|
||||||
|
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: body
|
||||||
|
*/
|
||||||
|
Body *models.TierCredentialsRequest
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
Name string
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
Type string
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||||
|
// for simple values it will use straight method calls.
|
||||||
|
//
|
||||||
|
// To ensure default values, the struct must have been initialized with NewEditTierCredentialsParams() beforehand.
|
||||||
|
func (o *EditTierCredentialsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
o.HTTPRequest = r
|
||||||
|
|
||||||
|
if runtime.HasBody(r) {
|
||||||
|
defer r.Body.Close()
|
||||||
|
var body models.TierCredentialsRequest
|
||||||
|
if err := route.Consumer.Consume(r.Body, &body); err != nil {
|
||||||
|
if err == io.EOF {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.NewParseError("body", "body", "", err))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// validate body object
|
||||||
|
if err := body.Validate(route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) == 0 {
|
||||||
|
o.Body = &body
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
}
|
||||||
|
rName, rhkName, _ := route.Params.GetOK("name")
|
||||||
|
if err := o.bindName(rName, rhkName, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
rType, rhkType, _ := route.Params.GetOK("type")
|
||||||
|
if err := o.bindType(rType, rhkType, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindName binds and validates parameter Name from path.
|
||||||
|
func (o *EditTierCredentialsParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.Name = raw
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindType binds and validates parameter Type from path.
|
||||||
|
func (o *EditTierCredentialsParams) bindType(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.Type = raw
|
||||||
|
|
||||||
|
if err := o.validateType(formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// validateType carries on validations for parameter Type
|
||||||
|
func (o *EditTierCredentialsParams) validateType(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.EnumCase("type", "path", o.Type, []interface{}{"s3", "gcs", "azure"}, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
113
restapi/operations/admin_api/edit_tier_credentials_responses.go
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EditTierCredentialsOKCode is the HTTP code returned for type EditTierCredentialsOK
|
||||||
|
const EditTierCredentialsOKCode int = 200
|
||||||
|
|
||||||
|
/*EditTierCredentialsOK A successful response.
|
||||||
|
|
||||||
|
swagger:response editTierCredentialsOK
|
||||||
|
*/
|
||||||
|
type EditTierCredentialsOK struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewEditTierCredentialsOK creates EditTierCredentialsOK with default headers values
|
||||||
|
func NewEditTierCredentialsOK() *EditTierCredentialsOK {
|
||||||
|
|
||||||
|
return &EditTierCredentialsOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *EditTierCredentialsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
|
||||||
|
|
||||||
|
rw.WriteHeader(200)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*EditTierCredentialsDefault Generic error response.
|
||||||
|
|
||||||
|
swagger:response editTierCredentialsDefault
|
||||||
|
*/
|
||||||
|
type EditTierCredentialsDefault struct {
|
||||||
|
_statusCode int
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Error `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewEditTierCredentialsDefault creates EditTierCredentialsDefault with default headers values
|
||||||
|
func NewEditTierCredentialsDefault(code int) *EditTierCredentialsDefault {
|
||||||
|
if code <= 0 {
|
||||||
|
code = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
return &EditTierCredentialsDefault{
|
||||||
|
_statusCode: code,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatusCode adds the status to the edit tier credentials default response
|
||||||
|
func (o *EditTierCredentialsDefault) WithStatusCode(code int) *EditTierCredentialsDefault {
|
||||||
|
o._statusCode = code
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusCode sets the status to the edit tier credentials default response
|
||||||
|
func (o *EditTierCredentialsDefault) SetStatusCode(code int) {
|
||||||
|
o._statusCode = code
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the edit tier credentials default response
|
||||||
|
func (o *EditTierCredentialsDefault) WithPayload(payload *models.Error) *EditTierCredentialsDefault {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the edit tier credentials default response
|
||||||
|
func (o *EditTierCredentialsDefault) SetPayload(payload *models.Error) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *EditTierCredentialsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(o._statusCode)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
124
restapi/operations/admin_api/edit_tier_credentials_urlbuilder.go
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"net/url"
|
||||||
|
golangswaggerpaths "path"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EditTierCredentialsURL generates an URL for the edit tier credentials operation
|
||||||
|
type EditTierCredentialsURL struct {
|
||||||
|
Name string
|
||||||
|
Type string
|
||||||
|
|
||||||
|
_basePath string
|
||||||
|
// avoid unkeyed usage
|
||||||
|
_ struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *EditTierCredentialsURL) WithBasePath(bp string) *EditTierCredentialsURL {
|
||||||
|
o.SetBasePath(bp)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *EditTierCredentialsURL) SetBasePath(bp string) {
|
||||||
|
o._basePath = bp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a url path and query string
|
||||||
|
func (o *EditTierCredentialsURL) Build() (*url.URL, error) {
|
||||||
|
var _result url.URL
|
||||||
|
|
||||||
|
var _path = "/admin/tiers/{type}/{name}/credentials"
|
||||||
|
|
||||||
|
name := o.Name
|
||||||
|
if name != "" {
|
||||||
|
_path = strings.Replace(_path, "{name}", name, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("name is required on EditTierCredentialsURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
typeVar := o.Type
|
||||||
|
if typeVar != "" {
|
||||||
|
_path = strings.Replace(_path, "{type}", typeVar, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("type is required on EditTierCredentialsURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
_basePath := o._basePath
|
||||||
|
if _basePath == "" {
|
||||||
|
_basePath = "/api/v1"
|
||||||
|
}
|
||||||
|
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||||
|
|
||||||
|
return &_result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must is a helper function to panic when the url builder returns an error
|
||||||
|
func (o *EditTierCredentialsURL) Must(u *url.URL, err error) *url.URL {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if u == nil {
|
||||||
|
panic("url can't be nil")
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the string representation of the path with query string
|
||||||
|
func (o *EditTierCredentialsURL) String() string {
|
||||||
|
return o.Must(o.Build()).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildFull builds a full url with scheme, host, path and query string
|
||||||
|
func (o *EditTierCredentialsURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||||
|
if scheme == "" {
|
||||||
|
return nil, errors.New("scheme is required for a full url on EditTierCredentialsURL")
|
||||||
|
}
|
||||||
|
if host == "" {
|
||||||
|
return nil, errors.New("host is required for a full url on EditTierCredentialsURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
base, err := o.Build()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Scheme = scheme
|
||||||
|
base.Host = host
|
||||||
|
return base, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFull returns the string representation of a complete url
|
||||||
|
func (o *EditTierCredentialsURL) StringFull(scheme, host string) string {
|
||||||
|
return o.Must(o.BuildFull(scheme, host)).String()
|
||||||
|
}
|
||||||
90
restapi/operations/admin_api/get_tier.go
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetTierHandlerFunc turns a function with the right signature into a get tier handler
|
||||||
|
type GetTierHandlerFunc func(GetTierParams, *models.Principal) middleware.Responder
|
||||||
|
|
||||||
|
// Handle executing the request and returning a response
|
||||||
|
func (fn GetTierHandlerFunc) Handle(params GetTierParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return fn(params, principal)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTierHandler interface for that can handle valid get tier params
|
||||||
|
type GetTierHandler interface {
|
||||||
|
Handle(GetTierParams, *models.Principal) middleware.Responder
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetTier creates a new http.Handler for the get tier operation
|
||||||
|
func NewGetTier(ctx *middleware.Context, handler GetTierHandler) *GetTier {
|
||||||
|
return &GetTier{Context: ctx, Handler: handler}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*GetTier swagger:route GET /admin/tiers/{type}/{name} AdminAPI getTier
|
||||||
|
|
||||||
|
Get Tier
|
||||||
|
|
||||||
|
*/
|
||||||
|
type GetTier struct {
|
||||||
|
Context *middleware.Context
|
||||||
|
Handler GetTierHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetTier) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||||
|
if rCtx != nil {
|
||||||
|
r = rCtx
|
||||||
|
}
|
||||||
|
var Params = NewGetTierParams()
|
||||||
|
|
||||||
|
uprinc, aCtx, err := o.Context.Authorize(r, route)
|
||||||
|
if err != nil {
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if aCtx != nil {
|
||||||
|
r = aCtx
|
||||||
|
}
|
||||||
|
var principal *models.Principal
|
||||||
|
if uprinc != nil {
|
||||||
|
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := o.Handler.Handle(Params, principal) // actually handle the request
|
||||||
|
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||||
|
|
||||||
|
}
|
||||||
129
restapi/operations/admin_api/get_tier_parameters.go
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetTierParams creates a new GetTierParams object
|
||||||
|
// no default values defined in spec.
|
||||||
|
func NewGetTierParams() GetTierParams {
|
||||||
|
|
||||||
|
return GetTierParams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetTierParams contains all the bound params for the get tier operation
|
||||||
|
// typically these are obtained from a http.Request
|
||||||
|
//
|
||||||
|
// swagger:parameters GetTier
|
||||||
|
type GetTierParams struct {
|
||||||
|
|
||||||
|
// HTTP Request Object
|
||||||
|
HTTPRequest *http.Request `json:"-"`
|
||||||
|
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
Name string
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
Type string
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||||
|
// for simple values it will use straight method calls.
|
||||||
|
//
|
||||||
|
// To ensure default values, the struct must have been initialized with NewGetTierParams() beforehand.
|
||||||
|
func (o *GetTierParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
o.HTTPRequest = r
|
||||||
|
|
||||||
|
rName, rhkName, _ := route.Params.GetOK("name")
|
||||||
|
if err := o.bindName(rName, rhkName, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
rType, rhkType, _ := route.Params.GetOK("type")
|
||||||
|
if err := o.bindType(rType, rhkType, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindName binds and validates parameter Name from path.
|
||||||
|
func (o *GetTierParams) bindName(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.Name = raw
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindType binds and validates parameter Type from path.
|
||||||
|
func (o *GetTierParams) bindType(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.Type = raw
|
||||||
|
|
||||||
|
if err := o.validateType(formats); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// validateType carries on validations for parameter Type
|
||||||
|
func (o *GetTierParams) validateType(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.EnumCase("type", "path", o.Type, []interface{}{"s3", "gcs", "azure"}, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
133
restapi/operations/admin_api/get_tier_responses.go
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetTierOKCode is the HTTP code returned for type GetTierOK
|
||||||
|
const GetTierOKCode int = 200
|
||||||
|
|
||||||
|
/*GetTierOK A successful response.
|
||||||
|
|
||||||
|
swagger:response getTierOK
|
||||||
|
*/
|
||||||
|
type GetTierOK struct {
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Tier `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetTierOK creates GetTierOK with default headers values
|
||||||
|
func NewGetTierOK() *GetTierOK {
|
||||||
|
|
||||||
|
return &GetTierOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the get tier o k response
|
||||||
|
func (o *GetTierOK) WithPayload(payload *models.Tier) *GetTierOK {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the get tier o k response
|
||||||
|
func (o *GetTierOK) SetPayload(payload *models.Tier) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *GetTierOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(200)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*GetTierDefault Generic error response.
|
||||||
|
|
||||||
|
swagger:response getTierDefault
|
||||||
|
*/
|
||||||
|
type GetTierDefault struct {
|
||||||
|
_statusCode int
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Error `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetTierDefault creates GetTierDefault with default headers values
|
||||||
|
func NewGetTierDefault(code int) *GetTierDefault {
|
||||||
|
if code <= 0 {
|
||||||
|
code = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
return &GetTierDefault{
|
||||||
|
_statusCode: code,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatusCode adds the status to the get tier default response
|
||||||
|
func (o *GetTierDefault) WithStatusCode(code int) *GetTierDefault {
|
||||||
|
o._statusCode = code
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusCode sets the status to the get tier default response
|
||||||
|
func (o *GetTierDefault) SetStatusCode(code int) {
|
||||||
|
o._statusCode = code
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the get tier default response
|
||||||
|
func (o *GetTierDefault) WithPayload(payload *models.Error) *GetTierDefault {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the get tier default response
|
||||||
|
func (o *GetTierDefault) SetPayload(payload *models.Error) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *GetTierDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(o._statusCode)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
124
restapi/operations/admin_api/get_tier_urlbuilder.go
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"net/url"
|
||||||
|
golangswaggerpaths "path"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetTierURL generates an URL for the get tier operation
|
||||||
|
type GetTierURL struct {
|
||||||
|
Name string
|
||||||
|
Type string
|
||||||
|
|
||||||
|
_basePath string
|
||||||
|
// avoid unkeyed usage
|
||||||
|
_ struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *GetTierURL) WithBasePath(bp string) *GetTierURL {
|
||||||
|
o.SetBasePath(bp)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *GetTierURL) SetBasePath(bp string) {
|
||||||
|
o._basePath = bp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a url path and query string
|
||||||
|
func (o *GetTierURL) Build() (*url.URL, error) {
|
||||||
|
var _result url.URL
|
||||||
|
|
||||||
|
var _path = "/admin/tiers/{type}/{name}"
|
||||||
|
|
||||||
|
name := o.Name
|
||||||
|
if name != "" {
|
||||||
|
_path = strings.Replace(_path, "{name}", name, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("name is required on GetTierURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
typeVar := o.Type
|
||||||
|
if typeVar != "" {
|
||||||
|
_path = strings.Replace(_path, "{type}", typeVar, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("type is required on GetTierURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
_basePath := o._basePath
|
||||||
|
if _basePath == "" {
|
||||||
|
_basePath = "/api/v1"
|
||||||
|
}
|
||||||
|
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||||
|
|
||||||
|
return &_result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must is a helper function to panic when the url builder returns an error
|
||||||
|
func (o *GetTierURL) Must(u *url.URL, err error) *url.URL {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if u == nil {
|
||||||
|
panic("url can't be nil")
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the string representation of the path with query string
|
||||||
|
func (o *GetTierURL) String() string {
|
||||||
|
return o.Must(o.Build()).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildFull builds a full url with scheme, host, path and query string
|
||||||
|
func (o *GetTierURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||||
|
if scheme == "" {
|
||||||
|
return nil, errors.New("scheme is required for a full url on GetTierURL")
|
||||||
|
}
|
||||||
|
if host == "" {
|
||||||
|
return nil, errors.New("host is required for a full url on GetTierURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
base, err := o.Build()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Scheme = scheme
|
||||||
|
base.Host = host
|
||||||
|
return base, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFull returns the string representation of a complete url
|
||||||
|
func (o *GetTierURL) StringFull(scheme, host string) string {
|
||||||
|
return o.Must(o.BuildFull(scheme, host)).String()
|
||||||
|
}
|
||||||
90
restapi/operations/admin_api/tiers_list.go
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TiersListHandlerFunc turns a function with the right signature into a tiers list handler
|
||||||
|
type TiersListHandlerFunc func(TiersListParams, *models.Principal) middleware.Responder
|
||||||
|
|
||||||
|
// Handle executing the request and returning a response
|
||||||
|
func (fn TiersListHandlerFunc) Handle(params TiersListParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return fn(params, principal)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TiersListHandler interface for that can handle valid tiers list params
|
||||||
|
type TiersListHandler interface {
|
||||||
|
Handle(TiersListParams, *models.Principal) middleware.Responder
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewTiersList creates a new http.Handler for the tiers list operation
|
||||||
|
func NewTiersList(ctx *middleware.Context, handler TiersListHandler) *TiersList {
|
||||||
|
return &TiersList{Context: ctx, Handler: handler}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*TiersList swagger:route GET /admin/tiers AdminAPI tiersList
|
||||||
|
|
||||||
|
Returns a list of tiers for ilm
|
||||||
|
|
||||||
|
*/
|
||||||
|
type TiersList struct {
|
||||||
|
Context *middleware.Context
|
||||||
|
Handler TiersListHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *TiersList) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||||
|
if rCtx != nil {
|
||||||
|
r = rCtx
|
||||||
|
}
|
||||||
|
var Params = NewTiersListParams()
|
||||||
|
|
||||||
|
uprinc, aCtx, err := o.Context.Authorize(r, route)
|
||||||
|
if err != nil {
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if aCtx != nil {
|
||||||
|
r = aCtx
|
||||||
|
}
|
||||||
|
var principal *models.Principal
|
||||||
|
if uprinc != nil {
|
||||||
|
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := o.Handler.Handle(Params, principal) // actually handle the request
|
||||||
|
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||||
|
|
||||||
|
}
|
||||||
62
restapi/operations/admin_api/tiers_list_parameters.go
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewTiersListParams creates a new TiersListParams object
|
||||||
|
// no default values defined in spec.
|
||||||
|
func NewTiersListParams() TiersListParams {
|
||||||
|
|
||||||
|
return TiersListParams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TiersListParams contains all the bound params for the tiers list operation
|
||||||
|
// typically these are obtained from a http.Request
|
||||||
|
//
|
||||||
|
// swagger:parameters TiersList
|
||||||
|
type TiersListParams struct {
|
||||||
|
|
||||||
|
// HTTP Request Object
|
||||||
|
HTTPRequest *http.Request `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||||
|
// for simple values it will use straight method calls.
|
||||||
|
//
|
||||||
|
// To ensure default values, the struct must have been initialized with NewTiersListParams() beforehand.
|
||||||
|
func (o *TiersListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
o.HTTPRequest = r
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
133
restapi/operations/admin_api/tiers_list_responses.go
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TiersListOKCode is the HTTP code returned for type TiersListOK
|
||||||
|
const TiersListOKCode int = 200
|
||||||
|
|
||||||
|
/*TiersListOK A successful response.
|
||||||
|
|
||||||
|
swagger:response tiersListOK
|
||||||
|
*/
|
||||||
|
type TiersListOK struct {
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.TierListResponse `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewTiersListOK creates TiersListOK with default headers values
|
||||||
|
func NewTiersListOK() *TiersListOK {
|
||||||
|
|
||||||
|
return &TiersListOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the tiers list o k response
|
||||||
|
func (o *TiersListOK) WithPayload(payload *models.TierListResponse) *TiersListOK {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the tiers list o k response
|
||||||
|
func (o *TiersListOK) SetPayload(payload *models.TierListResponse) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *TiersListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(200)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*TiersListDefault Generic error response.
|
||||||
|
|
||||||
|
swagger:response tiersListDefault
|
||||||
|
*/
|
||||||
|
type TiersListDefault struct {
|
||||||
|
_statusCode int
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Error `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewTiersListDefault creates TiersListDefault with default headers values
|
||||||
|
func NewTiersListDefault(code int) *TiersListDefault {
|
||||||
|
if code <= 0 {
|
||||||
|
code = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
return &TiersListDefault{
|
||||||
|
_statusCode: code,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatusCode adds the status to the tiers list default response
|
||||||
|
func (o *TiersListDefault) WithStatusCode(code int) *TiersListDefault {
|
||||||
|
o._statusCode = code
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusCode sets the status to the tiers list default response
|
||||||
|
func (o *TiersListDefault) SetStatusCode(code int) {
|
||||||
|
o._statusCode = code
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the tiers list default response
|
||||||
|
func (o *TiersListDefault) WithPayload(payload *models.Error) *TiersListDefault {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the tiers list default response
|
||||||
|
func (o *TiersListDefault) SetPayload(payload *models.Error) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *TiersListDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(o._statusCode)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
104
restapi/operations/admin_api/tiers_list_urlbuilder.go
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package admin_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"net/url"
|
||||||
|
golangswaggerpaths "path"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TiersListURL generates an URL for the tiers list operation
|
||||||
|
type TiersListURL struct {
|
||||||
|
_basePath string
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *TiersListURL) WithBasePath(bp string) *TiersListURL {
|
||||||
|
o.SetBasePath(bp)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *TiersListURL) SetBasePath(bp string) {
|
||||||
|
o._basePath = bp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a url path and query string
|
||||||
|
func (o *TiersListURL) Build() (*url.URL, error) {
|
||||||
|
var _result url.URL
|
||||||
|
|
||||||
|
var _path = "/admin/tiers"
|
||||||
|
|
||||||
|
_basePath := o._basePath
|
||||||
|
if _basePath == "" {
|
||||||
|
_basePath = "/api/v1"
|
||||||
|
}
|
||||||
|
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||||
|
|
||||||
|
return &_result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must is a helper function to panic when the url builder returns an error
|
||||||
|
func (o *TiersListURL) Must(u *url.URL, err error) *url.URL {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if u == nil {
|
||||||
|
panic("url can't be nil")
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the string representation of the path with query string
|
||||||
|
func (o *TiersListURL) String() string {
|
||||||
|
return o.Must(o.Build()).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildFull builds a full url with scheme, host, path and query string
|
||||||
|
func (o *TiersListURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||||
|
if scheme == "" {
|
||||||
|
return nil, errors.New("scheme is required for a full url on TiersListURL")
|
||||||
|
}
|
||||||
|
if host == "" {
|
||||||
|
return nil, errors.New("host is required for a full url on TiersListURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
base, err := o.Build()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Scheme = scheme
|
||||||
|
base.Host = host
|
||||||
|
return base, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFull returns the string representation of a complete url
|
||||||
|
func (o *TiersListURL) StringFull(scheme, host string) string {
|
||||||
|
return o.Must(o.BuildFull(scheme, host)).String()
|
||||||
|
}
|
||||||
@@ -67,6 +67,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
|
|||||||
UserAPIAccountChangePasswordHandler: user_api.AccountChangePasswordHandlerFunc(func(params user_api.AccountChangePasswordParams, principal *models.Principal) middleware.Responder {
|
UserAPIAccountChangePasswordHandler: user_api.AccountChangePasswordHandlerFunc(func(params user_api.AccountChangePasswordParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation user_api.AccountChangePassword has not yet been implemented")
|
return middleware.NotImplemented("operation user_api.AccountChangePassword has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
|
UserAPIAddBucketLifecycleHandler: user_api.AddBucketLifecycleHandlerFunc(func(params user_api.AddBucketLifecycleParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation user_api.AddBucketLifecycle has not yet been implemented")
|
||||||
|
}),
|
||||||
AdminAPIAddGroupHandler: admin_api.AddGroupHandlerFunc(func(params admin_api.AddGroupParams, principal *models.Principal) middleware.Responder {
|
AdminAPIAddGroupHandler: admin_api.AddGroupHandlerFunc(func(params admin_api.AddGroupParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation admin_api.AddGroup has not yet been implemented")
|
return middleware.NotImplemented("operation admin_api.AddGroup has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
@@ -79,6 +82,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
|
|||||||
UserAPIAddRemoteBucketHandler: user_api.AddRemoteBucketHandlerFunc(func(params user_api.AddRemoteBucketParams, principal *models.Principal) middleware.Responder {
|
UserAPIAddRemoteBucketHandler: user_api.AddRemoteBucketHandlerFunc(func(params user_api.AddRemoteBucketParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation user_api.AddRemoteBucket has not yet been implemented")
|
return middleware.NotImplemented("operation user_api.AddRemoteBucket has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
|
AdminAPIAddTierHandler: admin_api.AddTierHandlerFunc(func(params admin_api.AddTierParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation admin_api.AddTier has not yet been implemented")
|
||||||
|
}),
|
||||||
AdminAPIAddUserHandler: admin_api.AddUserHandlerFunc(func(params admin_api.AddUserParams, principal *models.Principal) middleware.Responder {
|
AdminAPIAddUserHandler: admin_api.AddUserHandlerFunc(func(params admin_api.AddUserParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation admin_api.AddUser has not yet been implemented")
|
return middleware.NotImplemented("operation admin_api.AddUser has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
@@ -139,12 +145,18 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
|
|||||||
UserAPIDownloadObjectHandler: user_api.DownloadObjectHandlerFunc(func(params user_api.DownloadObjectParams, principal *models.Principal) middleware.Responder {
|
UserAPIDownloadObjectHandler: user_api.DownloadObjectHandlerFunc(func(params user_api.DownloadObjectParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation user_api.DownloadObject has not yet been implemented")
|
return middleware.NotImplemented("operation user_api.DownloadObject has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
|
AdminAPIEditTierCredentialsHandler: admin_api.EditTierCredentialsHandlerFunc(func(params admin_api.EditTierCredentialsParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation admin_api.EditTierCredentials has not yet been implemented")
|
||||||
|
}),
|
||||||
UserAPIEnableBucketEncryptionHandler: user_api.EnableBucketEncryptionHandlerFunc(func(params user_api.EnableBucketEncryptionParams, principal *models.Principal) middleware.Responder {
|
UserAPIEnableBucketEncryptionHandler: user_api.EnableBucketEncryptionHandlerFunc(func(params user_api.EnableBucketEncryptionParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation user_api.EnableBucketEncryption has not yet been implemented")
|
return middleware.NotImplemented("operation user_api.EnableBucketEncryption has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
UserAPIGetBucketEncryptionInfoHandler: user_api.GetBucketEncryptionInfoHandlerFunc(func(params user_api.GetBucketEncryptionInfoParams, principal *models.Principal) middleware.Responder {
|
UserAPIGetBucketEncryptionInfoHandler: user_api.GetBucketEncryptionInfoHandlerFunc(func(params user_api.GetBucketEncryptionInfoParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation user_api.GetBucketEncryptionInfo has not yet been implemented")
|
return middleware.NotImplemented("operation user_api.GetBucketEncryptionInfo has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
|
UserAPIGetBucketLifecycleHandler: user_api.GetBucketLifecycleHandlerFunc(func(params user_api.GetBucketLifecycleParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation user_api.GetBucketLifecycle has not yet been implemented")
|
||||||
|
}),
|
||||||
UserAPIGetBucketObjectLockingStatusHandler: user_api.GetBucketObjectLockingStatusHandlerFunc(func(params user_api.GetBucketObjectLockingStatusParams, principal *models.Principal) middleware.Responder {
|
UserAPIGetBucketObjectLockingStatusHandler: user_api.GetBucketObjectLockingStatusHandlerFunc(func(params user_api.GetBucketObjectLockingStatusParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation user_api.GetBucketObjectLockingStatus has not yet been implemented")
|
return middleware.NotImplemented("operation user_api.GetBucketObjectLockingStatus has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
@@ -178,6 +190,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
|
|||||||
AdminAPIGetTenantUsageHandler: admin_api.GetTenantUsageHandlerFunc(func(params admin_api.GetTenantUsageParams, principal *models.Principal) middleware.Responder {
|
AdminAPIGetTenantUsageHandler: admin_api.GetTenantUsageHandlerFunc(func(params admin_api.GetTenantUsageParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation admin_api.GetTenantUsage has not yet been implemented")
|
return middleware.NotImplemented("operation admin_api.GetTenantUsage has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
|
AdminAPIGetTierHandler: admin_api.GetTierHandlerFunc(func(params admin_api.GetTierParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation admin_api.GetTier has not yet been implemented")
|
||||||
|
}),
|
||||||
AdminAPIGetUserInfoHandler: admin_api.GetUserInfoHandlerFunc(func(params admin_api.GetUserInfoParams, principal *models.Principal) middleware.Responder {
|
AdminAPIGetUserInfoHandler: admin_api.GetUserInfoHandlerFunc(func(params admin_api.GetUserInfoParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation admin_api.GetUserInfo has not yet been implemented")
|
return middleware.NotImplemented("operation admin_api.GetUserInfo has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
@@ -343,6 +358,12 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
|
|||||||
AdminAPITenantUpdatePoolsHandler: admin_api.TenantUpdatePoolsHandlerFunc(func(params admin_api.TenantUpdatePoolsParams, principal *models.Principal) middleware.Responder {
|
AdminAPITenantUpdatePoolsHandler: admin_api.TenantUpdatePoolsHandlerFunc(func(params admin_api.TenantUpdatePoolsParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation admin_api.TenantUpdatePools has not yet been implemented")
|
return middleware.NotImplemented("operation admin_api.TenantUpdatePools has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
|
AdminAPITiersListHandler: admin_api.TiersListHandlerFunc(func(params admin_api.TiersListParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation admin_api.TiersList has not yet been implemented")
|
||||||
|
}),
|
||||||
|
UserAPIUpdateBucketLifecycleHandler: user_api.UpdateBucketLifecycleHandlerFunc(func(params user_api.UpdateBucketLifecycleParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation user_api.UpdateBucketLifecycle has not yet been implemented")
|
||||||
|
}),
|
||||||
AdminAPIUpdateGroupHandler: admin_api.UpdateGroupHandlerFunc(func(params admin_api.UpdateGroupParams, principal *models.Principal) middleware.Responder {
|
AdminAPIUpdateGroupHandler: admin_api.UpdateGroupHandlerFunc(func(params admin_api.UpdateGroupParams, principal *models.Principal) middleware.Responder {
|
||||||
return middleware.NotImplemented("operation admin_api.UpdateGroup has not yet been implemented")
|
return middleware.NotImplemented("operation admin_api.UpdateGroup has not yet been implemented")
|
||||||
}),
|
}),
|
||||||
@@ -409,6 +430,8 @@ type ConsoleAPI struct {
|
|||||||
|
|
||||||
// UserAPIAccountChangePasswordHandler sets the operation handler for the account change password operation
|
// UserAPIAccountChangePasswordHandler sets the operation handler for the account change password operation
|
||||||
UserAPIAccountChangePasswordHandler user_api.AccountChangePasswordHandler
|
UserAPIAccountChangePasswordHandler user_api.AccountChangePasswordHandler
|
||||||
|
// UserAPIAddBucketLifecycleHandler sets the operation handler for the add bucket lifecycle operation
|
||||||
|
UserAPIAddBucketLifecycleHandler user_api.AddBucketLifecycleHandler
|
||||||
// AdminAPIAddGroupHandler sets the operation handler for the add group operation
|
// AdminAPIAddGroupHandler sets the operation handler for the add group operation
|
||||||
AdminAPIAddGroupHandler admin_api.AddGroupHandler
|
AdminAPIAddGroupHandler admin_api.AddGroupHandler
|
||||||
// AdminAPIAddNotificationEndpointHandler sets the operation handler for the add notification endpoint operation
|
// AdminAPIAddNotificationEndpointHandler sets the operation handler for the add notification endpoint operation
|
||||||
@@ -417,6 +440,8 @@ type ConsoleAPI struct {
|
|||||||
AdminAPIAddPolicyHandler admin_api.AddPolicyHandler
|
AdminAPIAddPolicyHandler admin_api.AddPolicyHandler
|
||||||
// UserAPIAddRemoteBucketHandler sets the operation handler for the add remote bucket operation
|
// UserAPIAddRemoteBucketHandler sets the operation handler for the add remote bucket operation
|
||||||
UserAPIAddRemoteBucketHandler user_api.AddRemoteBucketHandler
|
UserAPIAddRemoteBucketHandler user_api.AddRemoteBucketHandler
|
||||||
|
// AdminAPIAddTierHandler sets the operation handler for the add tier operation
|
||||||
|
AdminAPIAddTierHandler admin_api.AddTierHandler
|
||||||
// AdminAPIAddUserHandler sets the operation handler for the add user operation
|
// AdminAPIAddUserHandler sets the operation handler for the add user operation
|
||||||
AdminAPIAddUserHandler admin_api.AddUserHandler
|
AdminAPIAddUserHandler admin_api.AddUserHandler
|
||||||
// AdminAPIAdminInfoHandler sets the operation handler for the admin info operation
|
// AdminAPIAdminInfoHandler sets the operation handler for the admin info operation
|
||||||
@@ -457,10 +482,14 @@ type ConsoleAPI struct {
|
|||||||
UserAPIDisableBucketEncryptionHandler user_api.DisableBucketEncryptionHandler
|
UserAPIDisableBucketEncryptionHandler user_api.DisableBucketEncryptionHandler
|
||||||
// UserAPIDownloadObjectHandler sets the operation handler for the download object operation
|
// UserAPIDownloadObjectHandler sets the operation handler for the download object operation
|
||||||
UserAPIDownloadObjectHandler user_api.DownloadObjectHandler
|
UserAPIDownloadObjectHandler user_api.DownloadObjectHandler
|
||||||
|
// AdminAPIEditTierCredentialsHandler sets the operation handler for the edit tier credentials operation
|
||||||
|
AdminAPIEditTierCredentialsHandler admin_api.EditTierCredentialsHandler
|
||||||
// UserAPIEnableBucketEncryptionHandler sets the operation handler for the enable bucket encryption operation
|
// UserAPIEnableBucketEncryptionHandler sets the operation handler for the enable bucket encryption operation
|
||||||
UserAPIEnableBucketEncryptionHandler user_api.EnableBucketEncryptionHandler
|
UserAPIEnableBucketEncryptionHandler user_api.EnableBucketEncryptionHandler
|
||||||
// UserAPIGetBucketEncryptionInfoHandler sets the operation handler for the get bucket encryption info operation
|
// UserAPIGetBucketEncryptionInfoHandler sets the operation handler for the get bucket encryption info operation
|
||||||
UserAPIGetBucketEncryptionInfoHandler user_api.GetBucketEncryptionInfoHandler
|
UserAPIGetBucketEncryptionInfoHandler user_api.GetBucketEncryptionInfoHandler
|
||||||
|
// UserAPIGetBucketLifecycleHandler sets the operation handler for the get bucket lifecycle operation
|
||||||
|
UserAPIGetBucketLifecycleHandler user_api.GetBucketLifecycleHandler
|
||||||
// UserAPIGetBucketObjectLockingStatusHandler sets the operation handler for the get bucket object locking status operation
|
// UserAPIGetBucketObjectLockingStatusHandler sets the operation handler for the get bucket object locking status operation
|
||||||
UserAPIGetBucketObjectLockingStatusHandler user_api.GetBucketObjectLockingStatusHandler
|
UserAPIGetBucketObjectLockingStatusHandler user_api.GetBucketObjectLockingStatusHandler
|
||||||
// UserAPIGetBucketQuotaHandler sets the operation handler for the get bucket quota operation
|
// UserAPIGetBucketQuotaHandler sets the operation handler for the get bucket quota operation
|
||||||
@@ -483,6 +512,8 @@ type ConsoleAPI struct {
|
|||||||
AdminAPIGetResourceQuotaHandler admin_api.GetResourceQuotaHandler
|
AdminAPIGetResourceQuotaHandler admin_api.GetResourceQuotaHandler
|
||||||
// AdminAPIGetTenantUsageHandler sets the operation handler for the get tenant usage operation
|
// AdminAPIGetTenantUsageHandler sets the operation handler for the get tenant usage operation
|
||||||
AdminAPIGetTenantUsageHandler admin_api.GetTenantUsageHandler
|
AdminAPIGetTenantUsageHandler admin_api.GetTenantUsageHandler
|
||||||
|
// AdminAPIGetTierHandler sets the operation handler for the get tier operation
|
||||||
|
AdminAPIGetTierHandler admin_api.GetTierHandler
|
||||||
// AdminAPIGetUserInfoHandler sets the operation handler for the get user info operation
|
// AdminAPIGetUserInfoHandler sets the operation handler for the get user info operation
|
||||||
AdminAPIGetUserInfoHandler admin_api.GetUserInfoHandler
|
AdminAPIGetUserInfoHandler admin_api.GetUserInfoHandler
|
||||||
// AdminAPIGroupInfoHandler sets the operation handler for the group info operation
|
// AdminAPIGroupInfoHandler sets the operation handler for the group info operation
|
||||||
@@ -593,6 +624,10 @@ type ConsoleAPI struct {
|
|||||||
AdminAPITenantUpdateEncryptionHandler admin_api.TenantUpdateEncryptionHandler
|
AdminAPITenantUpdateEncryptionHandler admin_api.TenantUpdateEncryptionHandler
|
||||||
// AdminAPITenantUpdatePoolsHandler sets the operation handler for the tenant update pools operation
|
// AdminAPITenantUpdatePoolsHandler sets the operation handler for the tenant update pools operation
|
||||||
AdminAPITenantUpdatePoolsHandler admin_api.TenantUpdatePoolsHandler
|
AdminAPITenantUpdatePoolsHandler admin_api.TenantUpdatePoolsHandler
|
||||||
|
// AdminAPITiersListHandler sets the operation handler for the tiers list operation
|
||||||
|
AdminAPITiersListHandler admin_api.TiersListHandler
|
||||||
|
// UserAPIUpdateBucketLifecycleHandler sets the operation handler for the update bucket lifecycle operation
|
||||||
|
UserAPIUpdateBucketLifecycleHandler user_api.UpdateBucketLifecycleHandler
|
||||||
// AdminAPIUpdateGroupHandler sets the operation handler for the update group operation
|
// AdminAPIUpdateGroupHandler sets the operation handler for the update group operation
|
||||||
AdminAPIUpdateGroupHandler admin_api.UpdateGroupHandler
|
AdminAPIUpdateGroupHandler admin_api.UpdateGroupHandler
|
||||||
// AdminAPIUpdateTenantHandler sets the operation handler for the update tenant operation
|
// AdminAPIUpdateTenantHandler sets the operation handler for the update tenant operation
|
||||||
@@ -680,6 +715,9 @@ func (o *ConsoleAPI) Validate() error {
|
|||||||
if o.UserAPIAccountChangePasswordHandler == nil {
|
if o.UserAPIAccountChangePasswordHandler == nil {
|
||||||
unregistered = append(unregistered, "user_api.AccountChangePasswordHandler")
|
unregistered = append(unregistered, "user_api.AccountChangePasswordHandler")
|
||||||
}
|
}
|
||||||
|
if o.UserAPIAddBucketLifecycleHandler == nil {
|
||||||
|
unregistered = append(unregistered, "user_api.AddBucketLifecycleHandler")
|
||||||
|
}
|
||||||
if o.AdminAPIAddGroupHandler == nil {
|
if o.AdminAPIAddGroupHandler == nil {
|
||||||
unregistered = append(unregistered, "admin_api.AddGroupHandler")
|
unregistered = append(unregistered, "admin_api.AddGroupHandler")
|
||||||
}
|
}
|
||||||
@@ -692,6 +730,9 @@ func (o *ConsoleAPI) Validate() error {
|
|||||||
if o.UserAPIAddRemoteBucketHandler == nil {
|
if o.UserAPIAddRemoteBucketHandler == nil {
|
||||||
unregistered = append(unregistered, "user_api.AddRemoteBucketHandler")
|
unregistered = append(unregistered, "user_api.AddRemoteBucketHandler")
|
||||||
}
|
}
|
||||||
|
if o.AdminAPIAddTierHandler == nil {
|
||||||
|
unregistered = append(unregistered, "admin_api.AddTierHandler")
|
||||||
|
}
|
||||||
if o.AdminAPIAddUserHandler == nil {
|
if o.AdminAPIAddUserHandler == nil {
|
||||||
unregistered = append(unregistered, "admin_api.AddUserHandler")
|
unregistered = append(unregistered, "admin_api.AddUserHandler")
|
||||||
}
|
}
|
||||||
@@ -752,12 +793,18 @@ func (o *ConsoleAPI) Validate() error {
|
|||||||
if o.UserAPIDownloadObjectHandler == nil {
|
if o.UserAPIDownloadObjectHandler == nil {
|
||||||
unregistered = append(unregistered, "user_api.DownloadObjectHandler")
|
unregistered = append(unregistered, "user_api.DownloadObjectHandler")
|
||||||
}
|
}
|
||||||
|
if o.AdminAPIEditTierCredentialsHandler == nil {
|
||||||
|
unregistered = append(unregistered, "admin_api.EditTierCredentialsHandler")
|
||||||
|
}
|
||||||
if o.UserAPIEnableBucketEncryptionHandler == nil {
|
if o.UserAPIEnableBucketEncryptionHandler == nil {
|
||||||
unregistered = append(unregistered, "user_api.EnableBucketEncryptionHandler")
|
unregistered = append(unregistered, "user_api.EnableBucketEncryptionHandler")
|
||||||
}
|
}
|
||||||
if o.UserAPIGetBucketEncryptionInfoHandler == nil {
|
if o.UserAPIGetBucketEncryptionInfoHandler == nil {
|
||||||
unregistered = append(unregistered, "user_api.GetBucketEncryptionInfoHandler")
|
unregistered = append(unregistered, "user_api.GetBucketEncryptionInfoHandler")
|
||||||
}
|
}
|
||||||
|
if o.UserAPIGetBucketLifecycleHandler == nil {
|
||||||
|
unregistered = append(unregistered, "user_api.GetBucketLifecycleHandler")
|
||||||
|
}
|
||||||
if o.UserAPIGetBucketObjectLockingStatusHandler == nil {
|
if o.UserAPIGetBucketObjectLockingStatusHandler == nil {
|
||||||
unregistered = append(unregistered, "user_api.GetBucketObjectLockingStatusHandler")
|
unregistered = append(unregistered, "user_api.GetBucketObjectLockingStatusHandler")
|
||||||
}
|
}
|
||||||
@@ -791,6 +838,9 @@ func (o *ConsoleAPI) Validate() error {
|
|||||||
if o.AdminAPIGetTenantUsageHandler == nil {
|
if o.AdminAPIGetTenantUsageHandler == nil {
|
||||||
unregistered = append(unregistered, "admin_api.GetTenantUsageHandler")
|
unregistered = append(unregistered, "admin_api.GetTenantUsageHandler")
|
||||||
}
|
}
|
||||||
|
if o.AdminAPIGetTierHandler == nil {
|
||||||
|
unregistered = append(unregistered, "admin_api.GetTierHandler")
|
||||||
|
}
|
||||||
if o.AdminAPIGetUserInfoHandler == nil {
|
if o.AdminAPIGetUserInfoHandler == nil {
|
||||||
unregistered = append(unregistered, "admin_api.GetUserInfoHandler")
|
unregistered = append(unregistered, "admin_api.GetUserInfoHandler")
|
||||||
}
|
}
|
||||||
@@ -956,6 +1006,12 @@ func (o *ConsoleAPI) Validate() error {
|
|||||||
if o.AdminAPITenantUpdatePoolsHandler == nil {
|
if o.AdminAPITenantUpdatePoolsHandler == nil {
|
||||||
unregistered = append(unregistered, "admin_api.TenantUpdatePoolsHandler")
|
unregistered = append(unregistered, "admin_api.TenantUpdatePoolsHandler")
|
||||||
}
|
}
|
||||||
|
if o.AdminAPITiersListHandler == nil {
|
||||||
|
unregistered = append(unregistered, "admin_api.TiersListHandler")
|
||||||
|
}
|
||||||
|
if o.UserAPIUpdateBucketLifecycleHandler == nil {
|
||||||
|
unregistered = append(unregistered, "user_api.UpdateBucketLifecycleHandler")
|
||||||
|
}
|
||||||
if o.AdminAPIUpdateGroupHandler == nil {
|
if o.AdminAPIUpdateGroupHandler == nil {
|
||||||
unregistered = append(unregistered, "admin_api.UpdateGroupHandler")
|
unregistered = append(unregistered, "admin_api.UpdateGroupHandler")
|
||||||
}
|
}
|
||||||
@@ -1077,6 +1133,10 @@ func (o *ConsoleAPI) initHandlerCache() {
|
|||||||
if o.handlers["POST"] == nil {
|
if o.handlers["POST"] == nil {
|
||||||
o.handlers["POST"] = make(map[string]http.Handler)
|
o.handlers["POST"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
|
o.handlers["POST"]["/buckets/{bucket_name}/lifecycle"] = user_api.NewAddBucketLifecycle(o.context, o.UserAPIAddBucketLifecycleHandler)
|
||||||
|
if o.handlers["POST"] == nil {
|
||||||
|
o.handlers["POST"] = make(map[string]http.Handler)
|
||||||
|
}
|
||||||
o.handlers["POST"]["/groups"] = admin_api.NewAddGroup(o.context, o.AdminAPIAddGroupHandler)
|
o.handlers["POST"]["/groups"] = admin_api.NewAddGroup(o.context, o.AdminAPIAddGroupHandler)
|
||||||
if o.handlers["POST"] == nil {
|
if o.handlers["POST"] == nil {
|
||||||
o.handlers["POST"] = make(map[string]http.Handler)
|
o.handlers["POST"] = make(map[string]http.Handler)
|
||||||
@@ -1093,6 +1153,10 @@ func (o *ConsoleAPI) initHandlerCache() {
|
|||||||
if o.handlers["POST"] == nil {
|
if o.handlers["POST"] == nil {
|
||||||
o.handlers["POST"] = make(map[string]http.Handler)
|
o.handlers["POST"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
|
o.handlers["POST"]["/admin/tiers"] = admin_api.NewAddTier(o.context, o.AdminAPIAddTierHandler)
|
||||||
|
if o.handlers["POST"] == nil {
|
||||||
|
o.handlers["POST"] = make(map[string]http.Handler)
|
||||||
|
}
|
||||||
o.handlers["POST"]["/users"] = admin_api.NewAddUser(o.context, o.AdminAPIAddUserHandler)
|
o.handlers["POST"]["/users"] = admin_api.NewAddUser(o.context, o.AdminAPIAddUserHandler)
|
||||||
if o.handlers["GET"] == nil {
|
if o.handlers["GET"] == nil {
|
||||||
o.handlers["GET"] = make(map[string]http.Handler)
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
@@ -1170,6 +1234,10 @@ func (o *ConsoleAPI) initHandlerCache() {
|
|||||||
o.handlers["GET"] = make(map[string]http.Handler)
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
o.handlers["GET"]["/buckets/{bucket_name}/objects/download"] = user_api.NewDownloadObject(o.context, o.UserAPIDownloadObjectHandler)
|
o.handlers["GET"]["/buckets/{bucket_name}/objects/download"] = user_api.NewDownloadObject(o.context, o.UserAPIDownloadObjectHandler)
|
||||||
|
if o.handlers["PUT"] == nil {
|
||||||
|
o.handlers["PUT"] = make(map[string]http.Handler)
|
||||||
|
}
|
||||||
|
o.handlers["PUT"]["/admin/tiers/{type}/{name}/credentials"] = admin_api.NewEditTierCredentials(o.context, o.AdminAPIEditTierCredentialsHandler)
|
||||||
if o.handlers["POST"] == nil {
|
if o.handlers["POST"] == nil {
|
||||||
o.handlers["POST"] = make(map[string]http.Handler)
|
o.handlers["POST"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
@@ -1181,6 +1249,10 @@ func (o *ConsoleAPI) initHandlerCache() {
|
|||||||
if o.handlers["GET"] == nil {
|
if o.handlers["GET"] == nil {
|
||||||
o.handlers["GET"] = make(map[string]http.Handler)
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
|
o.handlers["GET"]["/buckets/{bucket_name}/lifecycle"] = user_api.NewGetBucketLifecycle(o.context, o.UserAPIGetBucketLifecycleHandler)
|
||||||
|
if o.handlers["GET"] == nil {
|
||||||
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
|
}
|
||||||
o.handlers["GET"]["/buckets/{bucket_name}/object-locking"] = user_api.NewGetBucketObjectLockingStatus(o.context, o.UserAPIGetBucketObjectLockingStatusHandler)
|
o.handlers["GET"]["/buckets/{bucket_name}/object-locking"] = user_api.NewGetBucketObjectLockingStatus(o.context, o.UserAPIGetBucketObjectLockingStatusHandler)
|
||||||
if o.handlers["GET"] == nil {
|
if o.handlers["GET"] == nil {
|
||||||
o.handlers["GET"] = make(map[string]http.Handler)
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
@@ -1225,6 +1297,10 @@ func (o *ConsoleAPI) initHandlerCache() {
|
|||||||
if o.handlers["GET"] == nil {
|
if o.handlers["GET"] == nil {
|
||||||
o.handlers["GET"] = make(map[string]http.Handler)
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
|
o.handlers["GET"]["/admin/tiers/{type}/{name}"] = admin_api.NewGetTier(o.context, o.AdminAPIGetTierHandler)
|
||||||
|
if o.handlers["GET"] == nil {
|
||||||
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
|
}
|
||||||
o.handlers["GET"]["/users/{name}"] = admin_api.NewGetUserInfo(o.context, o.AdminAPIGetUserInfoHandler)
|
o.handlers["GET"]["/users/{name}"] = admin_api.NewGetUserInfo(o.context, o.AdminAPIGetUserInfoHandler)
|
||||||
if o.handlers["GET"] == nil {
|
if o.handlers["GET"] == nil {
|
||||||
o.handlers["GET"] = make(map[string]http.Handler)
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
@@ -1442,6 +1518,14 @@ func (o *ConsoleAPI) initHandlerCache() {
|
|||||||
o.handlers["PUT"] = make(map[string]http.Handler)
|
o.handlers["PUT"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
o.handlers["PUT"]["/namespaces/{namespace}/tenants/{tenant}/pools"] = admin_api.NewTenantUpdatePools(o.context, o.AdminAPITenantUpdatePoolsHandler)
|
o.handlers["PUT"]["/namespaces/{namespace}/tenants/{tenant}/pools"] = admin_api.NewTenantUpdatePools(o.context, o.AdminAPITenantUpdatePoolsHandler)
|
||||||
|
if o.handlers["GET"] == nil {
|
||||||
|
o.handlers["GET"] = make(map[string]http.Handler)
|
||||||
|
}
|
||||||
|
o.handlers["GET"]["/admin/tiers"] = admin_api.NewTiersList(o.context, o.AdminAPITiersListHandler)
|
||||||
|
if o.handlers["PUT"] == nil {
|
||||||
|
o.handlers["PUT"] = make(map[string]http.Handler)
|
||||||
|
}
|
||||||
|
o.handlers["PUT"]["/buckets/{bucket_name}/lifecycle/{lifecycle_id}"] = user_api.NewUpdateBucketLifecycle(o.context, o.UserAPIUpdateBucketLifecycleHandler)
|
||||||
if o.handlers["PUT"] == nil {
|
if o.handlers["PUT"] == nil {
|
||||||
o.handlers["PUT"] = make(map[string]http.Handler)
|
o.handlers["PUT"] = make(map[string]http.Handler)
|
||||||
}
|
}
|
||||||
|
|||||||
90
restapi/operations/user_api/add_bucket_lifecycle.go
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddBucketLifecycleHandlerFunc turns a function with the right signature into a add bucket lifecycle handler
|
||||||
|
type AddBucketLifecycleHandlerFunc func(AddBucketLifecycleParams, *models.Principal) middleware.Responder
|
||||||
|
|
||||||
|
// Handle executing the request and returning a response
|
||||||
|
func (fn AddBucketLifecycleHandlerFunc) Handle(params AddBucketLifecycleParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return fn(params, principal)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddBucketLifecycleHandler interface for that can handle valid add bucket lifecycle params
|
||||||
|
type AddBucketLifecycleHandler interface {
|
||||||
|
Handle(AddBucketLifecycleParams, *models.Principal) middleware.Responder
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAddBucketLifecycle creates a new http.Handler for the add bucket lifecycle operation
|
||||||
|
func NewAddBucketLifecycle(ctx *middleware.Context, handler AddBucketLifecycleHandler) *AddBucketLifecycle {
|
||||||
|
return &AddBucketLifecycle{Context: ctx, Handler: handler}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*AddBucketLifecycle swagger:route POST /buckets/{bucket_name}/lifecycle UserAPI addBucketLifecycle
|
||||||
|
|
||||||
|
Add Bucket Lifecycle
|
||||||
|
|
||||||
|
*/
|
||||||
|
type AddBucketLifecycle struct {
|
||||||
|
Context *middleware.Context
|
||||||
|
Handler AddBucketLifecycleHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *AddBucketLifecycle) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||||
|
if rCtx != nil {
|
||||||
|
r = rCtx
|
||||||
|
}
|
||||||
|
var Params = NewAddBucketLifecycleParams()
|
||||||
|
|
||||||
|
uprinc, aCtx, err := o.Context.Authorize(r, route)
|
||||||
|
if err != nil {
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if aCtx != nil {
|
||||||
|
r = aCtx
|
||||||
|
}
|
||||||
|
var principal *models.Principal
|
||||||
|
if uprinc != nil {
|
||||||
|
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := o.Handler.Handle(Params, principal) // actually handle the request
|
||||||
|
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||||
|
|
||||||
|
}
|
||||||
120
restapi/operations/user_api/add_bucket_lifecycle_parameters.go
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewAddBucketLifecycleParams creates a new AddBucketLifecycleParams object
|
||||||
|
// no default values defined in spec.
|
||||||
|
func NewAddBucketLifecycleParams() AddBucketLifecycleParams {
|
||||||
|
|
||||||
|
return AddBucketLifecycleParams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddBucketLifecycleParams contains all the bound params for the add bucket lifecycle operation
|
||||||
|
// typically these are obtained from a http.Request
|
||||||
|
//
|
||||||
|
// swagger:parameters AddBucketLifecycle
|
||||||
|
type AddBucketLifecycleParams struct {
|
||||||
|
|
||||||
|
// HTTP Request Object
|
||||||
|
HTTPRequest *http.Request `json:"-"`
|
||||||
|
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: body
|
||||||
|
*/
|
||||||
|
Body *models.AddBucketLifecycle
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
BucketName string
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||||
|
// for simple values it will use straight method calls.
|
||||||
|
//
|
||||||
|
// To ensure default values, the struct must have been initialized with NewAddBucketLifecycleParams() beforehand.
|
||||||
|
func (o *AddBucketLifecycleParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
o.HTTPRequest = r
|
||||||
|
|
||||||
|
if runtime.HasBody(r) {
|
||||||
|
defer r.Body.Close()
|
||||||
|
var body models.AddBucketLifecycle
|
||||||
|
if err := route.Consumer.Consume(r.Body, &body); err != nil {
|
||||||
|
if err == io.EOF {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.NewParseError("body", "body", "", err))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// validate body object
|
||||||
|
if err := body.Validate(route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) == 0 {
|
||||||
|
o.Body = &body
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
}
|
||||||
|
rBucketName, rhkBucketName, _ := route.Params.GetOK("bucket_name")
|
||||||
|
if err := o.bindBucketName(rBucketName, rhkBucketName, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindBucketName binds and validates parameter BucketName from path.
|
||||||
|
func (o *AddBucketLifecycleParams) bindBucketName(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.BucketName = raw
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
113
restapi/operations/user_api/add_bucket_lifecycle_responses.go
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddBucketLifecycleCreatedCode is the HTTP code returned for type AddBucketLifecycleCreated
|
||||||
|
const AddBucketLifecycleCreatedCode int = 201
|
||||||
|
|
||||||
|
/*AddBucketLifecycleCreated A successful response.
|
||||||
|
|
||||||
|
swagger:response addBucketLifecycleCreated
|
||||||
|
*/
|
||||||
|
type AddBucketLifecycleCreated struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAddBucketLifecycleCreated creates AddBucketLifecycleCreated with default headers values
|
||||||
|
func NewAddBucketLifecycleCreated() *AddBucketLifecycleCreated {
|
||||||
|
|
||||||
|
return &AddBucketLifecycleCreated{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *AddBucketLifecycleCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
|
||||||
|
|
||||||
|
rw.WriteHeader(201)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*AddBucketLifecycleDefault Generic error response.
|
||||||
|
|
||||||
|
swagger:response addBucketLifecycleDefault
|
||||||
|
*/
|
||||||
|
type AddBucketLifecycleDefault struct {
|
||||||
|
_statusCode int
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Error `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewAddBucketLifecycleDefault creates AddBucketLifecycleDefault with default headers values
|
||||||
|
func NewAddBucketLifecycleDefault(code int) *AddBucketLifecycleDefault {
|
||||||
|
if code <= 0 {
|
||||||
|
code = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
return &AddBucketLifecycleDefault{
|
||||||
|
_statusCode: code,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatusCode adds the status to the add bucket lifecycle default response
|
||||||
|
func (o *AddBucketLifecycleDefault) WithStatusCode(code int) *AddBucketLifecycleDefault {
|
||||||
|
o._statusCode = code
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusCode sets the status to the add bucket lifecycle default response
|
||||||
|
func (o *AddBucketLifecycleDefault) SetStatusCode(code int) {
|
||||||
|
o._statusCode = code
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the add bucket lifecycle default response
|
||||||
|
func (o *AddBucketLifecycleDefault) WithPayload(payload *models.Error) *AddBucketLifecycleDefault {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the add bucket lifecycle default response
|
||||||
|
func (o *AddBucketLifecycleDefault) SetPayload(payload *models.Error) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *AddBucketLifecycleDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(o._statusCode)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
116
restapi/operations/user_api/add_bucket_lifecycle_urlbuilder.go
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"net/url"
|
||||||
|
golangswaggerpaths "path"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddBucketLifecycleURL generates an URL for the add bucket lifecycle operation
|
||||||
|
type AddBucketLifecycleURL struct {
|
||||||
|
BucketName string
|
||||||
|
|
||||||
|
_basePath string
|
||||||
|
// avoid unkeyed usage
|
||||||
|
_ struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *AddBucketLifecycleURL) WithBasePath(bp string) *AddBucketLifecycleURL {
|
||||||
|
o.SetBasePath(bp)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *AddBucketLifecycleURL) SetBasePath(bp string) {
|
||||||
|
o._basePath = bp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a url path and query string
|
||||||
|
func (o *AddBucketLifecycleURL) Build() (*url.URL, error) {
|
||||||
|
var _result url.URL
|
||||||
|
|
||||||
|
var _path = "/buckets/{bucket_name}/lifecycle"
|
||||||
|
|
||||||
|
bucketName := o.BucketName
|
||||||
|
if bucketName != "" {
|
||||||
|
_path = strings.Replace(_path, "{bucket_name}", bucketName, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("bucketName is required on AddBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
_basePath := o._basePath
|
||||||
|
if _basePath == "" {
|
||||||
|
_basePath = "/api/v1"
|
||||||
|
}
|
||||||
|
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||||
|
|
||||||
|
return &_result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must is a helper function to panic when the url builder returns an error
|
||||||
|
func (o *AddBucketLifecycleURL) Must(u *url.URL, err error) *url.URL {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if u == nil {
|
||||||
|
panic("url can't be nil")
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the string representation of the path with query string
|
||||||
|
func (o *AddBucketLifecycleURL) String() string {
|
||||||
|
return o.Must(o.Build()).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildFull builds a full url with scheme, host, path and query string
|
||||||
|
func (o *AddBucketLifecycleURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||||
|
if scheme == "" {
|
||||||
|
return nil, errors.New("scheme is required for a full url on AddBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
if host == "" {
|
||||||
|
return nil, errors.New("host is required for a full url on AddBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
base, err := o.Build()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Scheme = scheme
|
||||||
|
base.Host = host
|
||||||
|
return base, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFull returns the string representation of a complete url
|
||||||
|
func (o *AddBucketLifecycleURL) StringFull(scheme, host string) string {
|
||||||
|
return o.Must(o.BuildFull(scheme, host)).String()
|
||||||
|
}
|
||||||
90
restapi/operations/user_api/get_bucket_lifecycle.go
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetBucketLifecycleHandlerFunc turns a function with the right signature into a get bucket lifecycle handler
|
||||||
|
type GetBucketLifecycleHandlerFunc func(GetBucketLifecycleParams, *models.Principal) middleware.Responder
|
||||||
|
|
||||||
|
// Handle executing the request and returning a response
|
||||||
|
func (fn GetBucketLifecycleHandlerFunc) Handle(params GetBucketLifecycleParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return fn(params, principal)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBucketLifecycleHandler interface for that can handle valid get bucket lifecycle params
|
||||||
|
type GetBucketLifecycleHandler interface {
|
||||||
|
Handle(GetBucketLifecycleParams, *models.Principal) middleware.Responder
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetBucketLifecycle creates a new http.Handler for the get bucket lifecycle operation
|
||||||
|
func NewGetBucketLifecycle(ctx *middleware.Context, handler GetBucketLifecycleHandler) *GetBucketLifecycle {
|
||||||
|
return &GetBucketLifecycle{Context: ctx, Handler: handler}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*GetBucketLifecycle swagger:route GET /buckets/{bucket_name}/lifecycle UserAPI getBucketLifecycle
|
||||||
|
|
||||||
|
Bucket Lifecycle
|
||||||
|
|
||||||
|
*/
|
||||||
|
type GetBucketLifecycle struct {
|
||||||
|
Context *middleware.Context
|
||||||
|
Handler GetBucketLifecycleHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetBucketLifecycle) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||||
|
if rCtx != nil {
|
||||||
|
r = rCtx
|
||||||
|
}
|
||||||
|
var Params = NewGetBucketLifecycleParams()
|
||||||
|
|
||||||
|
uprinc, aCtx, err := o.Context.Authorize(r, route)
|
||||||
|
if err != nil {
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if aCtx != nil {
|
||||||
|
r = aCtx
|
||||||
|
}
|
||||||
|
var principal *models.Principal
|
||||||
|
if uprinc != nil {
|
||||||
|
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := o.Handler.Handle(Params, principal) // actually handle the request
|
||||||
|
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewGetBucketLifecycleParams creates a new GetBucketLifecycleParams object
|
||||||
|
// no default values defined in spec.
|
||||||
|
func NewGetBucketLifecycleParams() GetBucketLifecycleParams {
|
||||||
|
|
||||||
|
return GetBucketLifecycleParams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBucketLifecycleParams contains all the bound params for the get bucket lifecycle operation
|
||||||
|
// typically these are obtained from a http.Request
|
||||||
|
//
|
||||||
|
// swagger:parameters GetBucketLifecycle
|
||||||
|
type GetBucketLifecycleParams struct {
|
||||||
|
|
||||||
|
// HTTP Request Object
|
||||||
|
HTTPRequest *http.Request `json:"-"`
|
||||||
|
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
BucketName string
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||||
|
// for simple values it will use straight method calls.
|
||||||
|
//
|
||||||
|
// To ensure default values, the struct must have been initialized with NewGetBucketLifecycleParams() beforehand.
|
||||||
|
func (o *GetBucketLifecycleParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
o.HTTPRequest = r
|
||||||
|
|
||||||
|
rBucketName, rhkBucketName, _ := route.Params.GetOK("bucket_name")
|
||||||
|
if err := o.bindBucketName(rBucketName, rhkBucketName, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindBucketName binds and validates parameter BucketName from path.
|
||||||
|
func (o *GetBucketLifecycleParams) bindBucketName(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.BucketName = raw
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
133
restapi/operations/user_api/get_bucket_lifecycle_responses.go
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetBucketLifecycleOKCode is the HTTP code returned for type GetBucketLifecycleOK
|
||||||
|
const GetBucketLifecycleOKCode int = 200
|
||||||
|
|
||||||
|
/*GetBucketLifecycleOK A successful response.
|
||||||
|
|
||||||
|
swagger:response getBucketLifecycleOK
|
||||||
|
*/
|
||||||
|
type GetBucketLifecycleOK struct {
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.BucketLifecycleResponse `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetBucketLifecycleOK creates GetBucketLifecycleOK with default headers values
|
||||||
|
func NewGetBucketLifecycleOK() *GetBucketLifecycleOK {
|
||||||
|
|
||||||
|
return &GetBucketLifecycleOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the get bucket lifecycle o k response
|
||||||
|
func (o *GetBucketLifecycleOK) WithPayload(payload *models.BucketLifecycleResponse) *GetBucketLifecycleOK {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the get bucket lifecycle o k response
|
||||||
|
func (o *GetBucketLifecycleOK) SetPayload(payload *models.BucketLifecycleResponse) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *GetBucketLifecycleOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(200)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*GetBucketLifecycleDefault Generic error response.
|
||||||
|
|
||||||
|
swagger:response getBucketLifecycleDefault
|
||||||
|
*/
|
||||||
|
type GetBucketLifecycleDefault struct {
|
||||||
|
_statusCode int
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Error `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetBucketLifecycleDefault creates GetBucketLifecycleDefault with default headers values
|
||||||
|
func NewGetBucketLifecycleDefault(code int) *GetBucketLifecycleDefault {
|
||||||
|
if code <= 0 {
|
||||||
|
code = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
return &GetBucketLifecycleDefault{
|
||||||
|
_statusCode: code,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatusCode adds the status to the get bucket lifecycle default response
|
||||||
|
func (o *GetBucketLifecycleDefault) WithStatusCode(code int) *GetBucketLifecycleDefault {
|
||||||
|
o._statusCode = code
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusCode sets the status to the get bucket lifecycle default response
|
||||||
|
func (o *GetBucketLifecycleDefault) SetStatusCode(code int) {
|
||||||
|
o._statusCode = code
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the get bucket lifecycle default response
|
||||||
|
func (o *GetBucketLifecycleDefault) WithPayload(payload *models.Error) *GetBucketLifecycleDefault {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the get bucket lifecycle default response
|
||||||
|
func (o *GetBucketLifecycleDefault) SetPayload(payload *models.Error) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *GetBucketLifecycleDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(o._statusCode)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
116
restapi/operations/user_api/get_bucket_lifecycle_urlbuilder.go
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"net/url"
|
||||||
|
golangswaggerpaths "path"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetBucketLifecycleURL generates an URL for the get bucket lifecycle operation
|
||||||
|
type GetBucketLifecycleURL struct {
|
||||||
|
BucketName string
|
||||||
|
|
||||||
|
_basePath string
|
||||||
|
// avoid unkeyed usage
|
||||||
|
_ struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *GetBucketLifecycleURL) WithBasePath(bp string) *GetBucketLifecycleURL {
|
||||||
|
o.SetBasePath(bp)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *GetBucketLifecycleURL) SetBasePath(bp string) {
|
||||||
|
o._basePath = bp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a url path and query string
|
||||||
|
func (o *GetBucketLifecycleURL) Build() (*url.URL, error) {
|
||||||
|
var _result url.URL
|
||||||
|
|
||||||
|
var _path = "/buckets/{bucket_name}/lifecycle"
|
||||||
|
|
||||||
|
bucketName := o.BucketName
|
||||||
|
if bucketName != "" {
|
||||||
|
_path = strings.Replace(_path, "{bucket_name}", bucketName, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("bucketName is required on GetBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
_basePath := o._basePath
|
||||||
|
if _basePath == "" {
|
||||||
|
_basePath = "/api/v1"
|
||||||
|
}
|
||||||
|
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||||
|
|
||||||
|
return &_result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must is a helper function to panic when the url builder returns an error
|
||||||
|
func (o *GetBucketLifecycleURL) Must(u *url.URL, err error) *url.URL {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if u == nil {
|
||||||
|
panic("url can't be nil")
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the string representation of the path with query string
|
||||||
|
func (o *GetBucketLifecycleURL) String() string {
|
||||||
|
return o.Must(o.Build()).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildFull builds a full url with scheme, host, path and query string
|
||||||
|
func (o *GetBucketLifecycleURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||||
|
if scheme == "" {
|
||||||
|
return nil, errors.New("scheme is required for a full url on GetBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
if host == "" {
|
||||||
|
return nil, errors.New("host is required for a full url on GetBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
base, err := o.Build()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Scheme = scheme
|
||||||
|
base.Host = host
|
||||||
|
return base, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFull returns the string representation of a complete url
|
||||||
|
func (o *GetBucketLifecycleURL) StringFull(scheme, host string) string {
|
||||||
|
return o.Must(o.BuildFull(scheme, host)).String()
|
||||||
|
}
|
||||||
90
restapi/operations/user_api/update_bucket_lifecycle.go
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateBucketLifecycleHandlerFunc turns a function with the right signature into a update bucket lifecycle handler
|
||||||
|
type UpdateBucketLifecycleHandlerFunc func(UpdateBucketLifecycleParams, *models.Principal) middleware.Responder
|
||||||
|
|
||||||
|
// Handle executing the request and returning a response
|
||||||
|
func (fn UpdateBucketLifecycleHandlerFunc) Handle(params UpdateBucketLifecycleParams, principal *models.Principal) middleware.Responder {
|
||||||
|
return fn(params, principal)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateBucketLifecycleHandler interface for that can handle valid update bucket lifecycle params
|
||||||
|
type UpdateBucketLifecycleHandler interface {
|
||||||
|
Handle(UpdateBucketLifecycleParams, *models.Principal) middleware.Responder
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUpdateBucketLifecycle creates a new http.Handler for the update bucket lifecycle operation
|
||||||
|
func NewUpdateBucketLifecycle(ctx *middleware.Context, handler UpdateBucketLifecycleHandler) *UpdateBucketLifecycle {
|
||||||
|
return &UpdateBucketLifecycle{Context: ctx, Handler: handler}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*UpdateBucketLifecycle swagger:route PUT /buckets/{bucket_name}/lifecycle/{lifecycle_id} UserAPI updateBucketLifecycle
|
||||||
|
|
||||||
|
Update Lifecycle rule
|
||||||
|
|
||||||
|
*/
|
||||||
|
type UpdateBucketLifecycle struct {
|
||||||
|
Context *middleware.Context
|
||||||
|
Handler UpdateBucketLifecycleHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *UpdateBucketLifecycle) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
route, rCtx, _ := o.Context.RouteInfo(r)
|
||||||
|
if rCtx != nil {
|
||||||
|
r = rCtx
|
||||||
|
}
|
||||||
|
var Params = NewUpdateBucketLifecycleParams()
|
||||||
|
|
||||||
|
uprinc, aCtx, err := o.Context.Authorize(r, route)
|
||||||
|
if err != nil {
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if aCtx != nil {
|
||||||
|
r = aCtx
|
||||||
|
}
|
||||||
|
var principal *models.Principal
|
||||||
|
if uprinc != nil {
|
||||||
|
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
res := o.Handler.Handle(Params, principal) // actually handle the request
|
||||||
|
|
||||||
|
o.Context.Respond(rw, r, route.Produces, route, res)
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewUpdateBucketLifecycleParams creates a new UpdateBucketLifecycleParams object
|
||||||
|
// no default values defined in spec.
|
||||||
|
func NewUpdateBucketLifecycleParams() UpdateBucketLifecycleParams {
|
||||||
|
|
||||||
|
return UpdateBucketLifecycleParams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateBucketLifecycleParams contains all the bound params for the update bucket lifecycle operation
|
||||||
|
// typically these are obtained from a http.Request
|
||||||
|
//
|
||||||
|
// swagger:parameters UpdateBucketLifecycle
|
||||||
|
type UpdateBucketLifecycleParams struct {
|
||||||
|
|
||||||
|
// HTTP Request Object
|
||||||
|
HTTPRequest *http.Request `json:"-"`
|
||||||
|
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: body
|
||||||
|
*/
|
||||||
|
Body *models.UpdateBucketLifecycle
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
BucketName string
|
||||||
|
/*
|
||||||
|
Required: true
|
||||||
|
In: path
|
||||||
|
*/
|
||||||
|
LifecycleID string
|
||||||
|
}
|
||||||
|
|
||||||
|
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||||
|
// for simple values it will use straight method calls.
|
||||||
|
//
|
||||||
|
// To ensure default values, the struct must have been initialized with NewUpdateBucketLifecycleParams() beforehand.
|
||||||
|
func (o *UpdateBucketLifecycleParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
o.HTTPRequest = r
|
||||||
|
|
||||||
|
if runtime.HasBody(r) {
|
||||||
|
defer r.Body.Close()
|
||||||
|
var body models.UpdateBucketLifecycle
|
||||||
|
if err := route.Consumer.Consume(r.Body, &body); err != nil {
|
||||||
|
if err == io.EOF {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.NewParseError("body", "body", "", err))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// validate body object
|
||||||
|
if err := body.Validate(route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) == 0 {
|
||||||
|
o.Body = &body
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res = append(res, errors.Required("body", "body", ""))
|
||||||
|
}
|
||||||
|
rBucketName, rhkBucketName, _ := route.Params.GetOK("bucket_name")
|
||||||
|
if err := o.bindBucketName(rBucketName, rhkBucketName, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
rLifecycleID, rhkLifecycleID, _ := route.Params.GetOK("lifecycle_id")
|
||||||
|
if err := o.bindLifecycleID(rLifecycleID, rhkLifecycleID, route.Formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindBucketName binds and validates parameter BucketName from path.
|
||||||
|
func (o *UpdateBucketLifecycleParams) bindBucketName(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.BucketName = raw
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// bindLifecycleID binds and validates parameter LifecycleID from path.
|
||||||
|
func (o *UpdateBucketLifecycleParams) bindLifecycleID(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||||
|
var raw string
|
||||||
|
if len(rawData) > 0 {
|
||||||
|
raw = rawData[len(rawData)-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Required: true
|
||||||
|
// Parameter is provided by construction from the route
|
||||||
|
|
||||||
|
o.LifecycleID = raw
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
113
restapi/operations/user_api/update_bucket_lifecycle_responses.go
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateBucketLifecycleOKCode is the HTTP code returned for type UpdateBucketLifecycleOK
|
||||||
|
const UpdateBucketLifecycleOKCode int = 200
|
||||||
|
|
||||||
|
/*UpdateBucketLifecycleOK A successful response.
|
||||||
|
|
||||||
|
swagger:response updateBucketLifecycleOK
|
||||||
|
*/
|
||||||
|
type UpdateBucketLifecycleOK struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUpdateBucketLifecycleOK creates UpdateBucketLifecycleOK with default headers values
|
||||||
|
func NewUpdateBucketLifecycleOK() *UpdateBucketLifecycleOK {
|
||||||
|
|
||||||
|
return &UpdateBucketLifecycleOK{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *UpdateBucketLifecycleOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
|
||||||
|
|
||||||
|
rw.WriteHeader(200)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*UpdateBucketLifecycleDefault Generic error response.
|
||||||
|
|
||||||
|
swagger:response updateBucketLifecycleDefault
|
||||||
|
*/
|
||||||
|
type UpdateBucketLifecycleDefault struct {
|
||||||
|
_statusCode int
|
||||||
|
|
||||||
|
/*
|
||||||
|
In: Body
|
||||||
|
*/
|
||||||
|
Payload *models.Error `json:"body,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewUpdateBucketLifecycleDefault creates UpdateBucketLifecycleDefault with default headers values
|
||||||
|
func NewUpdateBucketLifecycleDefault(code int) *UpdateBucketLifecycleDefault {
|
||||||
|
if code <= 0 {
|
||||||
|
code = 500
|
||||||
|
}
|
||||||
|
|
||||||
|
return &UpdateBucketLifecycleDefault{
|
||||||
|
_statusCode: code,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithStatusCode adds the status to the update bucket lifecycle default response
|
||||||
|
func (o *UpdateBucketLifecycleDefault) WithStatusCode(code int) *UpdateBucketLifecycleDefault {
|
||||||
|
o._statusCode = code
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusCode sets the status to the update bucket lifecycle default response
|
||||||
|
func (o *UpdateBucketLifecycleDefault) SetStatusCode(code int) {
|
||||||
|
o._statusCode = code
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithPayload adds the payload to the update bucket lifecycle default response
|
||||||
|
func (o *UpdateBucketLifecycleDefault) WithPayload(payload *models.Error) *UpdateBucketLifecycleDefault {
|
||||||
|
o.Payload = payload
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetPayload sets the payload to the update bucket lifecycle default response
|
||||||
|
func (o *UpdateBucketLifecycleDefault) SetPayload(payload *models.Error) {
|
||||||
|
o.Payload = payload
|
||||||
|
}
|
||||||
|
|
||||||
|
// WriteResponse to the client
|
||||||
|
func (o *UpdateBucketLifecycleDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
||||||
|
|
||||||
|
rw.WriteHeader(o._statusCode)
|
||||||
|
if o.Payload != nil {
|
||||||
|
payload := o.Payload
|
||||||
|
if err := producer.Produce(rw, payload); err != nil {
|
||||||
|
panic(err) // let the recovery middleware deal with this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
|
||||||
|
package user_api
|
||||||
|
|
||||||
|
// This file was generated by the swagger tool.
|
||||||
|
// Editing this file might prove futile when you re-run the generate command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"net/url"
|
||||||
|
golangswaggerpaths "path"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateBucketLifecycleURL generates an URL for the update bucket lifecycle operation
|
||||||
|
type UpdateBucketLifecycleURL struct {
|
||||||
|
BucketName string
|
||||||
|
LifecycleID string
|
||||||
|
|
||||||
|
_basePath string
|
||||||
|
// avoid unkeyed usage
|
||||||
|
_ struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *UpdateBucketLifecycleURL) WithBasePath(bp string) *UpdateBucketLifecycleURL {
|
||||||
|
o.SetBasePath(bp)
|
||||||
|
return o
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetBasePath sets the base path for this url builder, only required when it's different from the
|
||||||
|
// base path specified in the swagger spec.
|
||||||
|
// When the value of the base path is an empty string
|
||||||
|
func (o *UpdateBucketLifecycleURL) SetBasePath(bp string) {
|
||||||
|
o._basePath = bp
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a url path and query string
|
||||||
|
func (o *UpdateBucketLifecycleURL) Build() (*url.URL, error) {
|
||||||
|
var _result url.URL
|
||||||
|
|
||||||
|
var _path = "/buckets/{bucket_name}/lifecycle/{lifecycle_id}"
|
||||||
|
|
||||||
|
bucketName := o.BucketName
|
||||||
|
if bucketName != "" {
|
||||||
|
_path = strings.Replace(_path, "{bucket_name}", bucketName, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("bucketName is required on UpdateBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
lifecycleID := o.LifecycleID
|
||||||
|
if lifecycleID != "" {
|
||||||
|
_path = strings.Replace(_path, "{lifecycle_id}", lifecycleID, -1)
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("lifecycleId is required on UpdateBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
_basePath := o._basePath
|
||||||
|
if _basePath == "" {
|
||||||
|
_basePath = "/api/v1"
|
||||||
|
}
|
||||||
|
_result.Path = golangswaggerpaths.Join(_basePath, _path)
|
||||||
|
|
||||||
|
return &_result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must is a helper function to panic when the url builder returns an error
|
||||||
|
func (o *UpdateBucketLifecycleURL) Must(u *url.URL, err error) *url.URL {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if u == nil {
|
||||||
|
panic("url can't be nil")
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
}
|
||||||
|
|
||||||
|
// String returns the string representation of the path with query string
|
||||||
|
func (o *UpdateBucketLifecycleURL) String() string {
|
||||||
|
return o.Must(o.Build()).String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildFull builds a full url with scheme, host, path and query string
|
||||||
|
func (o *UpdateBucketLifecycleURL) BuildFull(scheme, host string) (*url.URL, error) {
|
||||||
|
if scheme == "" {
|
||||||
|
return nil, errors.New("scheme is required for a full url on UpdateBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
if host == "" {
|
||||||
|
return nil, errors.New("host is required for a full url on UpdateBucketLifecycleURL")
|
||||||
|
}
|
||||||
|
|
||||||
|
base, err := o.Build()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
base.Scheme = scheme
|
||||||
|
base.Host = host
|
||||||
|
return base, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// StringFull returns the string representation of a complete url
|
||||||
|
func (o *UpdateBucketLifecycleURL) StringFull(scheme, host string) string {
|
||||||
|
return o.Must(o.BuildFull(scheme, host)).String()
|
||||||
|
}
|
||||||
248
restapi/user_buckets_lifecycle.go
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package restapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/rs/xid"
|
||||||
|
|
||||||
|
"github.com/minio/mc/pkg/probe"
|
||||||
|
|
||||||
|
"github.com/minio/mc/cmd/ilm"
|
||||||
|
|
||||||
|
"github.com/minio/minio-go/v7"
|
||||||
|
"github.com/minio/minio-go/v7/pkg/lifecycle"
|
||||||
|
|
||||||
|
"github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
"github.com/minio/console/restapi/operations"
|
||||||
|
"github.com/minio/console/restapi/operations/user_api"
|
||||||
|
)
|
||||||
|
|
||||||
|
func registerBucketsLifecycleHandlers(api *operations.ConsoleAPI) {
|
||||||
|
api.UserAPIGetBucketLifecycleHandler = user_api.GetBucketLifecycleHandlerFunc(func(params user_api.GetBucketLifecycleParams, session *models.Principal) middleware.Responder {
|
||||||
|
listBucketLifecycleResponse, err := getBucketLifecycleResponse(session, params)
|
||||||
|
if err != nil {
|
||||||
|
return user_api.NewGetBucketLifecycleDefault(int(err.Code)).WithPayload(err)
|
||||||
|
}
|
||||||
|
return user_api.NewGetBucketLifecycleOK().WithPayload(listBucketLifecycleResponse)
|
||||||
|
})
|
||||||
|
api.UserAPIAddBucketLifecycleHandler = user_api.AddBucketLifecycleHandlerFunc(func(params user_api.AddBucketLifecycleParams, session *models.Principal) middleware.Responder {
|
||||||
|
err := getAddBucketLifecycleResponse(session, params)
|
||||||
|
if err != nil {
|
||||||
|
return user_api.NewAddBucketLifecycleDefault(int(err.Code)).WithPayload(err)
|
||||||
|
}
|
||||||
|
return user_api.NewAddBucketLifecycleCreated()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// getBucketLifecycle() gets lifecycle lists for a bucket from MinIO API and returns their implementations
|
||||||
|
func getBucketLifecycle(ctx context.Context, client MinioClient, bucketName string) (*models.BucketLifecycleResponse, error) {
|
||||||
|
lifecycleList, err := client.getLifecycleRules(ctx, bucketName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var rules []*models.ObjectBucketLifecycle
|
||||||
|
|
||||||
|
for _, rule := range lifecycleList.Rules {
|
||||||
|
|
||||||
|
var tags []*models.LifecycleTag
|
||||||
|
|
||||||
|
for _, tagData := range rule.RuleFilter.And.Tags {
|
||||||
|
tags = append(tags, &models.LifecycleTag{
|
||||||
|
Key: tagData.Key,
|
||||||
|
Value: tagData.Value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
rules = append(rules, &models.ObjectBucketLifecycle{
|
||||||
|
ID: rule.ID,
|
||||||
|
Status: rule.Status,
|
||||||
|
Prefix: rule.RuleFilter.And.Prefix,
|
||||||
|
Expiration: &models.ExpirationResponse{Date: rule.Expiration.Date.Format(time.RFC3339), Days: int64(rule.Expiration.Days), DeleteMarker: rule.Expiration.DeleteMarker.IsEnabled()},
|
||||||
|
Transition: &models.TransitionResponse{Date: rule.Transition.Date.Format(time.RFC3339), Days: int64(rule.Transition.Days), StorageClass: rule.Transition.StorageClass},
|
||||||
|
Tags: tags,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// serialize output
|
||||||
|
lifecycleBucketsResponse := &models.BucketLifecycleResponse{
|
||||||
|
Lifecycle: rules,
|
||||||
|
}
|
||||||
|
|
||||||
|
return lifecycleBucketsResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// getBucketLifecycleResponse performs getBucketLifecycle() and serializes it to the handler's output
|
||||||
|
func getBucketLifecycleResponse(session *models.Principal, params user_api.GetBucketLifecycleParams) (*models.BucketLifecycleResponse, *models.Error) {
|
||||||
|
ctx := context.Background()
|
||||||
|
mClient, err := newMinioClient(session)
|
||||||
|
if err != nil {
|
||||||
|
return nil, prepareError(err)
|
||||||
|
}
|
||||||
|
// create a minioClient interface implementation
|
||||||
|
// defining the client to be used
|
||||||
|
minioClient := minioClient{client: mClient}
|
||||||
|
|
||||||
|
bucketEvents, err := getBucketLifecycle(ctx, minioClient, params.BucketName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, prepareError(err)
|
||||||
|
}
|
||||||
|
return bucketEvents, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// addBucketLifecycle gets lifecycle lists for a bucket from MinIO API and returns their implementations
|
||||||
|
func addBucketLifecycle(ctx context.Context, client MinioClient, params user_api.AddBucketLifecycleParams) error {
|
||||||
|
// Configuration that is already set.
|
||||||
|
lfcCfg, err := client.getLifecycleRules(ctx, params.BucketName)
|
||||||
|
if err != nil {
|
||||||
|
if e := err; minio.ToErrorResponse(e).Code == "NoSuchLifecycleConfiguration" {
|
||||||
|
lfcCfg = lifecycle.NewConfiguration()
|
||||||
|
} else {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
id := xid.New().String()
|
||||||
|
|
||||||
|
opts := ilm.LifecycleOptions{}
|
||||||
|
|
||||||
|
// Verify if transition items are set
|
||||||
|
if params.Body.ExpiryDate == "" && params.Body.ExpiryDays == 0 {
|
||||||
|
if params.Body.TransitionDate != "" && params.Body.TransitionDays != 0 {
|
||||||
|
return errors.New("only one transition configuration can be set (days or date)")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Body.ExpiryDate != "" || params.Body.ExpiryDays != 0 {
|
||||||
|
return errors.New("expiry cannot be set when transition is being configured")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Body.NoncurrentversionExpirationDays != 0 {
|
||||||
|
return errors.New("non current version Expiration Days cannot be set when transition is being configured")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Body.TransitionDate != "" {
|
||||||
|
opts = ilm.LifecycleOptions{
|
||||||
|
ID: id,
|
||||||
|
Prefix: params.Body.Prefix,
|
||||||
|
Status: !params.Body.Disable,
|
||||||
|
IsTagsSet: params.Body.Tags != "",
|
||||||
|
IsStorageClassSet: params.Body.StorageClass != "",
|
||||||
|
Tags: params.Body.Tags,
|
||||||
|
TransitionDate: params.Body.TransitionDate,
|
||||||
|
StorageClass: strings.ToUpper(params.Body.StorageClass),
|
||||||
|
ExpiredObjectDeleteMarker: params.Body.ExpiredObjectDeleteMarker,
|
||||||
|
NoncurrentVersionTransitionDays: int(params.Body.NoncurrentversionTransitionDays),
|
||||||
|
NoncurrentVersionTransitionStorageClass: strings.ToUpper(params.Body.NoncurrentversionTransitionStorageClass),
|
||||||
|
}
|
||||||
|
} else if params.Body.TransitionDays != 0 {
|
||||||
|
opts = ilm.LifecycleOptions{
|
||||||
|
ID: id,
|
||||||
|
Prefix: params.Body.Prefix,
|
||||||
|
Status: !params.Body.Disable,
|
||||||
|
IsTagsSet: params.Body.Tags != "",
|
||||||
|
IsStorageClassSet: params.Body.StorageClass != "",
|
||||||
|
Tags: params.Body.Tags,
|
||||||
|
TransitionDays: strconv.Itoa(int(params.Body.TransitionDays)),
|
||||||
|
StorageClass: strings.ToUpper(params.Body.StorageClass),
|
||||||
|
ExpiredObjectDeleteMarker: params.Body.ExpiredObjectDeleteMarker,
|
||||||
|
NoncurrentVersionTransitionDays: int(params.Body.NoncurrentversionTransitionDays),
|
||||||
|
NoncurrentVersionTransitionStorageClass: strings.ToUpper(params.Body.NoncurrentversionTransitionStorageClass),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if params.Body.TransitionDate == "" && params.Body.TransitionDays == 0 {
|
||||||
|
// Verify if expiry items are set
|
||||||
|
if params.Body.ExpiryDate != "" && params.Body.ExpiryDays != 0 {
|
||||||
|
return errors.New("only one expiry configuration can be set (days or date)")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Body.TransitionDate != "" || params.Body.TransitionDays != 0 {
|
||||||
|
return errors.New("transition cannot be set when expiry is being configured")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Body.NoncurrentversionTransitionDays != 0 {
|
||||||
|
return errors.New("non current version Transition Days cannot be set when expiry is being configured")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Body.NoncurrentversionTransitionStorageClass != "" {
|
||||||
|
return errors.New("non current version Transition Storage Class cannot be set when expiry is being configured")
|
||||||
|
}
|
||||||
|
|
||||||
|
if params.Body.ExpiryDate != "" {
|
||||||
|
opts = ilm.LifecycleOptions{
|
||||||
|
ID: id,
|
||||||
|
Prefix: params.Body.Prefix,
|
||||||
|
Status: !params.Body.Disable,
|
||||||
|
IsTagsSet: params.Body.Tags != "",
|
||||||
|
IsStorageClassSet: params.Body.StorageClass != "",
|
||||||
|
Tags: params.Body.Tags,
|
||||||
|
ExpiryDate: params.Body.ExpiryDate,
|
||||||
|
ExpiredObjectDeleteMarker: params.Body.ExpiredObjectDeleteMarker,
|
||||||
|
NoncurrentVersionExpirationDays: int(params.Body.NoncurrentversionExpirationDays),
|
||||||
|
}
|
||||||
|
} else if params.Body.ExpiryDays != 0 {
|
||||||
|
opts = ilm.LifecycleOptions{
|
||||||
|
ID: id,
|
||||||
|
Prefix: params.Body.Prefix,
|
||||||
|
Status: !params.Body.Disable,
|
||||||
|
IsTagsSet: params.Body.Tags != "",
|
||||||
|
IsStorageClassSet: params.Body.StorageClass != "",
|
||||||
|
Tags: params.Body.Tags,
|
||||||
|
ExpiryDays: strconv.Itoa(int(params.Body.ExpiryDays)),
|
||||||
|
ExpiredObjectDeleteMarker: params.Body.ExpiredObjectDeleteMarker,
|
||||||
|
NoncurrentVersionExpirationDays: int(params.Body.NoncurrentversionExpirationDays),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Non set, we return error
|
||||||
|
return errors.New("no valid configuration is set")
|
||||||
|
}
|
||||||
|
|
||||||
|
var err2 *probe.Error
|
||||||
|
lfcCfg, err2 = opts.ToConfig(lfcCfg)
|
||||||
|
if err2.ToGoError() != nil {
|
||||||
|
return err2.ToGoError()
|
||||||
|
}
|
||||||
|
|
||||||
|
return client.setBucketLifecycle(ctx, params.BucketName, lfcCfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// getAddBucketLifecycleResponse returns the respose of adding a bucket lifecycle response
|
||||||
|
func getAddBucketLifecycleResponse(session *models.Principal, params user_api.AddBucketLifecycleParams) *models.Error {
|
||||||
|
ctx := context.Background()
|
||||||
|
mClient, err := newMinioClient(session)
|
||||||
|
if err != nil {
|
||||||
|
return prepareError(err)
|
||||||
|
}
|
||||||
|
// create a minioClient interface implementation
|
||||||
|
// defining the client to be used
|
||||||
|
minioClient := minioClient{client: mClient}
|
||||||
|
|
||||||
|
err = addBucketLifecycle(ctx, minioClient, params)
|
||||||
|
if err != nil {
|
||||||
|
return prepareError(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
200
restapi/user_buckets_lifecycle_test.go
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2021 MinIO, Inc.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package restapi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/minio/console/models"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
"github.com/minio/console/restapi/operations/user_api"
|
||||||
|
"github.com/minio/minio-go/v7/pkg/lifecycle"
|
||||||
|
)
|
||||||
|
|
||||||
|
// assigning mock at runtime instead of compile time
|
||||||
|
var minioGetLifecycleRulesMock func(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error)
|
||||||
|
|
||||||
|
// mock function of getLifecycleRules()
|
||||||
|
func (ac minioClientMock) getLifecycleRules(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error) {
|
||||||
|
return minioGetLifecycleRulesMock(ctx, bucketName)
|
||||||
|
}
|
||||||
|
|
||||||
|
// assign mock for set Bucket Lifecycle
|
||||||
|
var minioSetBucketLifecycleMock func(ctx context.Context, bucketName string, config *lifecycle.Configuration) error
|
||||||
|
|
||||||
|
// mock function of setBucketLifecycle()
|
||||||
|
func (ac minioClientMock) setBucketLifecycle(ctx context.Context, bucketName string, config *lifecycle.Configuration) error {
|
||||||
|
return minioSetBucketLifecycleMock(ctx, bucketName, config)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetLifecycleRules(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
// mock minIO client
|
||||||
|
minClient := minioClientMock{}
|
||||||
|
|
||||||
|
function := "getBucketLifecycle()"
|
||||||
|
bucketName := "testBucket"
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
// Test-1 : getBucketLifecycle() get list of events for a particular bucket only one config
|
||||||
|
// mock lifecycle response from MinIO
|
||||||
|
mockLifecycle := lifecycle.Configuration{
|
||||||
|
Rules: []lifecycle.Rule{
|
||||||
|
{
|
||||||
|
ID: "TESTRULE",
|
||||||
|
Expiration: lifecycle.Expiration{Days: 15},
|
||||||
|
Status: "Enabled",
|
||||||
|
RuleFilter: lifecycle.Filter{Tag: lifecycle.Tag{Key: "tag1", Value: "val1"}, And: lifecycle.And{Prefix: "prefix1"}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
expectedOutput := models.BucketLifecycleResponse{
|
||||||
|
Lifecycle: []*models.ObjectBucketLifecycle{
|
||||||
|
{
|
||||||
|
ID: "TESTRULE",
|
||||||
|
Status: "Enabled",
|
||||||
|
Prefix: "prefix1",
|
||||||
|
Expiration: &models.ExpirationResponse{Days: int64(15)},
|
||||||
|
Transition: &models.TransitionResponse{},
|
||||||
|
Tags: []*models.LifecycleTag{{Key: "tag1", Value: "val1"}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
minioGetLifecycleRulesMock = func(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error) {
|
||||||
|
return &mockLifecycle, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
lifeCycleConfigs, err := getBucketLifecycle(ctx, minClient, bucketName)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Failed on %s:, error occurred: %s", function, err.Error())
|
||||||
|
}
|
||||||
|
// verify length of buckets is correct
|
||||||
|
assert.Equal(len(expectedOutput.Lifecycle), len(lifeCycleConfigs.Lifecycle), fmt.Sprintf("Failed on %s: length of lists is not the same", function))
|
||||||
|
for i, conf := range lifeCycleConfigs.Lifecycle {
|
||||||
|
assert.Equal(expectedOutput.Lifecycle[i].ID, conf.ID)
|
||||||
|
assert.Equal(expectedOutput.Lifecycle[i].Status, conf.Status)
|
||||||
|
assert.Equal(expectedOutput.Lifecycle[i].Prefix, conf.Prefix)
|
||||||
|
assert.Equal(expectedOutput.Lifecycle[i].Expiration.Days, conf.Expiration.Days)
|
||||||
|
for j, event := range conf.Tags {
|
||||||
|
assert.Equal(expectedOutput.Lifecycle[i].Tags[j], event)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test-2 : getBucketLifecycle() get list of events is empty
|
||||||
|
mockLifecycleT2 := lifecycle.Configuration{
|
||||||
|
Rules: []lifecycle.Rule{},
|
||||||
|
}
|
||||||
|
|
||||||
|
expectedOutputT2 := models.BucketLifecycleResponse{
|
||||||
|
Lifecycle: []*models.ObjectBucketLifecycle{},
|
||||||
|
}
|
||||||
|
|
||||||
|
minioGetLifecycleRulesMock = func(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error) {
|
||||||
|
return &mockLifecycleT2, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
lifeCycleConfigsT2, err := getBucketLifecycle(ctx, minClient, bucketName)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Failed on %s:, error occurred: %s", function, err.Error())
|
||||||
|
}
|
||||||
|
// verify length of buckets is correct
|
||||||
|
assert.Equal(len(expectedOutputT2.Lifecycle), len(lifeCycleConfigsT2.Lifecycle), fmt.Sprintf("Failed on %s: length of lists is not the same", function))
|
||||||
|
|
||||||
|
// Test-3 : getBucketLifecycle() get list of events returns an error
|
||||||
|
|
||||||
|
minioGetLifecycleRulesMock = func(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error) {
|
||||||
|
return nil, errors.New("error returned")
|
||||||
|
}
|
||||||
|
|
||||||
|
_, errT3 := getBucketLifecycle(ctx, minClient, bucketName)
|
||||||
|
|
||||||
|
errorCompare := errors.New("error returned")
|
||||||
|
|
||||||
|
assert.Equal(errorCompare, errT3, fmt.Sprintf("Failed on %s: Invalid error message", function))
|
||||||
|
|
||||||
|
// verify length of buckets is correct
|
||||||
|
assert.Equal(len(expectedOutputT2.Lifecycle), len(lifeCycleConfigsT2.Lifecycle), fmt.Sprintf("Failed on %s: length of lists is not the same", function))
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSetLifecycleRule(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
// mock minIO client
|
||||||
|
minClient := minioClientMock{}
|
||||||
|
|
||||||
|
function := "addBucketLifecycle()"
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
// Test-1 : addBucketLifecycle() get list of events for a particular bucket only one config
|
||||||
|
// mock create request
|
||||||
|
mockLifecycle := lifecycle.Configuration{
|
||||||
|
Rules: []lifecycle.Rule{
|
||||||
|
{
|
||||||
|
ID: "TESTRULE",
|
||||||
|
Expiration: lifecycle.Expiration{Days: 15},
|
||||||
|
Status: "Enabled",
|
||||||
|
RuleFilter: lifecycle.Filter{Tag: lifecycle.Tag{Key: "tag1", Value: "val1"}, And: lifecycle.And{Prefix: "prefix1"}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
minioGetLifecycleRulesMock = func(ctx context.Context, bucketName string) (lifecycle *lifecycle.Configuration, err error) {
|
||||||
|
return &mockLifecycle, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
insertMock := user_api.AddBucketLifecycleParams{
|
||||||
|
BucketName: "testBucket",
|
||||||
|
Body: &models.AddBucketLifecycle{
|
||||||
|
Disable: false,
|
||||||
|
ExpiredObjectDeleteMarker: false,
|
||||||
|
ExpiryDays: int32(16),
|
||||||
|
NoncurrentversionExpirationDays: 0,
|
||||||
|
NoncurrentversionTransitionDays: 0,
|
||||||
|
NoncurrentversionTransitionStorageClass: "",
|
||||||
|
Prefix: "pref1",
|
||||||
|
StorageClass: "",
|
||||||
|
Tags: "",
|
||||||
|
TransitionDate: "",
|
||||||
|
TransitionDays: 0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
minioSetBucketLifecycleMock = func(ctx context.Context, bucketName string, config *lifecycle.Configuration) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
err := addBucketLifecycle(ctx, minClient, insertMock)
|
||||||
|
|
||||||
|
assert.Equal(nil, err, fmt.Sprintf("Failed on %s: Error returned", function))
|
||||||
|
|
||||||
|
// Test-2 : addBucketLifecycle() returns error
|
||||||
|
|
||||||
|
minioSetBucketLifecycleMock = func(ctx context.Context, bucketName string, config *lifecycle.Configuration) error {
|
||||||
|
return errors.New("error setting lifecycle")
|
||||||
|
}
|
||||||
|
|
||||||
|
err2 := addBucketLifecycle(ctx, minClient, insertMock)
|
||||||
|
|
||||||
|
assert.Equal(errors.New("error setting lifecycle"), err2, fmt.Sprintf("Failed on %s: Error returned", function))
|
||||||
|
}
|
||||||
@@ -118,7 +118,7 @@ func TestListBucket(t *testing.T) {
|
|||||||
// Test-1 : getaAcountUsageInfo() Get response from minio client with two buckets
|
// Test-1 : getaAcountUsageInfo() Get response from minio client with two buckets
|
||||||
mockBucketList := madmin.AccountInfo{
|
mockBucketList := madmin.AccountInfo{
|
||||||
AccountName: "test",
|
AccountName: "test",
|
||||||
Buckets: []madmin.BucketUsageInfo{
|
Buckets: []madmin.BucketAccessInfo{
|
||||||
{Name: "bucket-1", Created: time.Now(), Size: 1024},
|
{Name: "bucket-1", Created: time.Now(), Size: 1024},
|
||||||
{Name: "bucket-2", Created: time.Now().Add(time.Hour * 1), Size: 0},
|
{Name: "bucket-2", Created: time.Now().Add(time.Hour * 1), Size: 0},
|
||||||
},
|
},
|
||||||
|
|||||||
370
swagger.yml
@@ -927,6 +927,76 @@ paths:
|
|||||||
tags:
|
tags:
|
||||||
- UserAPI
|
- UserAPI
|
||||||
|
|
||||||
|
/buckets/{bucket_name}/lifecycle:
|
||||||
|
get:
|
||||||
|
summary: Bucket Lifecycle
|
||||||
|
operationId: GetBucketLifecycle
|
||||||
|
parameters:
|
||||||
|
- name: bucket_name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: A successful response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/bucketLifecycleResponse"
|
||||||
|
default:
|
||||||
|
description: Generic error response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/error"
|
||||||
|
tags:
|
||||||
|
- UserAPI
|
||||||
|
post:
|
||||||
|
summary: Add Bucket Lifecycle
|
||||||
|
operationId: AddBucketLifecycle
|
||||||
|
parameters:
|
||||||
|
- name: bucket_name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/addBucketLifecycle"
|
||||||
|
responses:
|
||||||
|
201:
|
||||||
|
description: A successful response.
|
||||||
|
default:
|
||||||
|
description: Generic error response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/error"
|
||||||
|
tags:
|
||||||
|
- UserAPI
|
||||||
|
/buckets/{bucket_name}/lifecycle/{lifecycle_id}:
|
||||||
|
put:
|
||||||
|
summary: Update Lifecycle rule
|
||||||
|
operationId: UpdateBucketLifecycle
|
||||||
|
parameters:
|
||||||
|
- name: bucket_name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- name: lifecycle_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/updateBucketLifecycle"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: A successful response.
|
||||||
|
default:
|
||||||
|
description: Generic error response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/error"
|
||||||
|
tags:
|
||||||
|
- UserAPI
|
||||||
|
|
||||||
/service-accounts:
|
/service-accounts:
|
||||||
get:
|
get:
|
||||||
summary: List User's Service Accounts
|
summary: List User's Service Accounts
|
||||||
@@ -1755,6 +1825,101 @@ paths:
|
|||||||
tags:
|
tags:
|
||||||
- AdminAPI
|
- AdminAPI
|
||||||
|
|
||||||
|
/admin/tiers:
|
||||||
|
get:
|
||||||
|
summary: Returns a list of tiers for ilm
|
||||||
|
operationId: TiersList
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: A successful response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/tierListResponse"
|
||||||
|
default:
|
||||||
|
description: Generic error response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/error"
|
||||||
|
tags:
|
||||||
|
- AdminAPI
|
||||||
|
post:
|
||||||
|
summary: Allows to configure a new tier
|
||||||
|
operationId: AddTier
|
||||||
|
parameters:
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/tier"
|
||||||
|
responses:
|
||||||
|
201:
|
||||||
|
description: A successful response.
|
||||||
|
default:
|
||||||
|
description: Generic error response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/error"
|
||||||
|
tags:
|
||||||
|
- AdminAPI
|
||||||
|
|
||||||
|
/admin/tiers/{type}/{name}:
|
||||||
|
get:
|
||||||
|
summary: Get Tier
|
||||||
|
operationId: GetTier
|
||||||
|
parameters:
|
||||||
|
- name: type
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- s3
|
||||||
|
- gcs
|
||||||
|
- azure
|
||||||
|
- name: name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: A successful response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/tier"
|
||||||
|
default:
|
||||||
|
description: Generic error response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/error"
|
||||||
|
tags:
|
||||||
|
- AdminAPI
|
||||||
|
|
||||||
|
/admin/tiers/{type}/{name}/credentials:
|
||||||
|
put:
|
||||||
|
summary: Edit Tier Credentials
|
||||||
|
operationId: EditTierCredentials
|
||||||
|
parameters:
|
||||||
|
- name: type
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- s3
|
||||||
|
- gcs
|
||||||
|
- azure
|
||||||
|
- name: name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- name: body
|
||||||
|
in: body
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/tierCredentialsRequest"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: A successful response.
|
||||||
|
default:
|
||||||
|
description: Generic error response.
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/error"
|
||||||
|
tags:
|
||||||
|
- AdminAPI
|
||||||
|
|
||||||
/remote-buckets:
|
/remote-buckets:
|
||||||
get:
|
get:
|
||||||
summary: List Remote Buckets
|
summary: List Remote Buckets
|
||||||
@@ -4234,6 +4399,119 @@ definitions:
|
|||||||
validity:
|
validity:
|
||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
|
|
||||||
|
bucketLifecycleResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
lifecycle:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/objectBucketLifecycle"
|
||||||
|
|
||||||
|
expirationResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
date:
|
||||||
|
type: string
|
||||||
|
days:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
delete_marker:
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
transitionResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
date:
|
||||||
|
type: string
|
||||||
|
storage_class:
|
||||||
|
type: string
|
||||||
|
days:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
|
||||||
|
lifecycleTag:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
objectBucketLifecycle:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
prefix:
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
type: string
|
||||||
|
expiration:
|
||||||
|
$ref: "#/definitions/expirationResponse"
|
||||||
|
transition:
|
||||||
|
$ref: "#/definitions/transitionResponse"
|
||||||
|
tags:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/lifecycleTag"
|
||||||
|
|
||||||
|
|
||||||
|
addBucketLifecycle:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
prefix:
|
||||||
|
description: Non required field, it matches a prefix to perform ILM operations on it
|
||||||
|
type: string
|
||||||
|
tags:
|
||||||
|
description: Non required field, tags to match ILM files
|
||||||
|
type: string
|
||||||
|
expiry_date:
|
||||||
|
description: Required in case of expiry_days or transition fields are not set. it defines an expiry date for ILM
|
||||||
|
type: string
|
||||||
|
expiry_days:
|
||||||
|
description: Required in case of expiry_date or transition fields are not set. it defines an expiry days for ILM
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
default: 0
|
||||||
|
transition_date:
|
||||||
|
description: Required in case of transition_days or expiry fields are not set. it defines a transition date for ILM
|
||||||
|
type: string
|
||||||
|
transition_days:
|
||||||
|
description: Required in case of transition_date or expiry fields are not set. it defines a transition days for ILM
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
default: 0
|
||||||
|
storage_class:
|
||||||
|
description: Required only in case of transition is set. it refers to a tier
|
||||||
|
type: string
|
||||||
|
disable:
|
||||||
|
description: Non required, toggle to disable or enable rule
|
||||||
|
type: boolean
|
||||||
|
expired_object_delete_marker:
|
||||||
|
description: Non required, toggle to disable or enable rule
|
||||||
|
type: boolean
|
||||||
|
noncurrentversion_expiration_days:
|
||||||
|
description: Non required, can be set in case of expiration is enabled
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
default: 0
|
||||||
|
noncurrentversion_transition_days:
|
||||||
|
description: Non required, can be set in case of transition is enabled
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
default: 0
|
||||||
|
noncurrentversion_transition_storage_class:
|
||||||
|
description: Non required, can be set in case of transition is enabled
|
||||||
|
type: string
|
||||||
|
|
||||||
|
updateBucketLifecycle:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
tags:
|
||||||
|
type: string
|
||||||
|
disable:
|
||||||
|
type: boolean
|
||||||
|
|
||||||
setConfigResponse:
|
setConfigResponse:
|
||||||
type: object
|
type: object
|
||||||
@@ -4371,3 +4649,95 @@ definitions:
|
|||||||
storageSize:
|
storageSize:
|
||||||
type: number
|
type: number
|
||||||
default: 5
|
default: 5
|
||||||
|
tier_s3:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
endpoint:
|
||||||
|
type: string
|
||||||
|
accesskey:
|
||||||
|
type: string
|
||||||
|
secretkey:
|
||||||
|
type: string
|
||||||
|
bucket:
|
||||||
|
type: string
|
||||||
|
prefix:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
storageclass:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
tier_azure:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
endpoint:
|
||||||
|
type: string
|
||||||
|
accountname:
|
||||||
|
type: string
|
||||||
|
accountkey:
|
||||||
|
type: string
|
||||||
|
bucket:
|
||||||
|
type: string
|
||||||
|
prefix:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
tier_gcs:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
endpoint:
|
||||||
|
type: string
|
||||||
|
creds:
|
||||||
|
type: string
|
||||||
|
bucket:
|
||||||
|
type: string
|
||||||
|
prefix:
|
||||||
|
type: string
|
||||||
|
region:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
tier:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- s3
|
||||||
|
- gcs
|
||||||
|
- azure
|
||||||
|
- unsupported
|
||||||
|
s3:
|
||||||
|
type: object
|
||||||
|
$ref: "#/definitions/tier_s3"
|
||||||
|
gcs:
|
||||||
|
type: object
|
||||||
|
$ref: "#/definitions/tier_gcs"
|
||||||
|
azure:
|
||||||
|
type: object
|
||||||
|
$ref: "#/definitions/tier_azure"
|
||||||
|
|
||||||
|
tierListResponse:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
items:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/tier"
|
||||||
|
|
||||||
|
tierCredentialsRequest:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
access_key:
|
||||||
|
type: string
|
||||||
|
secret_key:
|
||||||
|
type: string
|
||||||
|
creds:
|
||||||
|
type: string
|
||||||
|
description: a base64 encoded value
|
||||||
|
|||||||