Compare commits
238 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a96ec8177 | ||
|
|
85398eec53 | ||
|
|
e7f220b069 | ||
|
|
1bb7658294 | ||
|
|
39b7b3292a | ||
|
|
38cf606371 | ||
|
|
5e3f9acff9 | ||
|
|
2305c0563a | ||
|
|
b5a3398a69 | ||
|
|
c787110e17 | ||
|
|
1a83797a86 | ||
|
|
68e0f1d6a2 | ||
|
|
2d3a3c396c | ||
|
|
d6aceb5430 | ||
|
|
1c109769df | ||
|
|
f3bcfc327d | ||
|
|
fd779c2ffa | ||
|
|
58903e8337 | ||
|
|
5b98bb8fd6 | ||
|
|
c98d5c06d0 | ||
|
|
33c979783d | ||
|
|
eeb95b2bf6 | ||
|
|
e5c96a0787 | ||
|
|
e3c6e22b4e | ||
|
|
9789ec36db | ||
|
|
51ba86fa46 | ||
|
|
f5922bb68b | ||
|
|
40812fc086 | ||
|
|
8b34b81a61 | ||
|
|
04e1c4573f | ||
|
|
d7de170105 | ||
|
|
369ae9342e | ||
|
|
2b1d17e38f | ||
|
|
d5c01fcd7d | ||
|
|
d97d18ebab | ||
|
|
aa2714d118 | ||
|
|
06f259f190 | ||
|
|
77e74917ca | ||
|
|
d582cc96b7 | ||
|
|
0288215fbb | ||
|
|
d3e84e5824 | ||
|
|
dd91c793e2 | ||
|
|
b495148a69 | ||
|
|
e0f3e4513d | ||
|
|
6512a51119 | ||
|
|
90c54221d6 | ||
|
|
3f023f9771 | ||
|
|
a4ad341a18 | ||
|
|
2d6f949359 | ||
|
|
7577703d64 | ||
|
|
b24d62a695 | ||
|
|
e541446631 | ||
|
|
e2d86354fc | ||
|
|
1ce18043d5 | ||
|
|
4005c20f7e | ||
|
|
5bcf245ed9 | ||
|
|
402e07c844 | ||
|
|
8404baecd8 | ||
|
|
3c0e3a1208 | ||
|
|
cb35dcf971 | ||
|
|
41418bcf45 | ||
|
|
132b08b40e | ||
|
|
dbbaae78f7 | ||
|
|
585780d415 | ||
|
|
44b9979f02 | ||
|
|
0749c87ce7 | ||
|
|
e5f7059a5e | ||
|
|
d15472f417 | ||
|
|
726bfe623c | ||
|
|
e47a57af8c | ||
|
|
f673f17407 | ||
|
|
829833f242 | ||
|
|
94c3ade7fc | ||
|
|
4a27ef4b2c | ||
|
|
59b43884ff | ||
|
|
219fe55356 | ||
|
|
9136c2a167 | ||
|
|
114bc364e3 | ||
|
|
2caad9964f | ||
|
|
d573007747 | ||
|
|
f054b1c251 | ||
|
|
7a2358272a | ||
|
|
8a6a75b7a2 | ||
|
|
8cf678fb27 | ||
|
|
a20c6dc907 | ||
|
|
37ff8bb60d | ||
|
|
b6ac055857 | ||
|
|
12e53a1468 | ||
|
|
b21123e1cd | ||
|
|
f1db949abc | ||
|
|
761c6529a2 | ||
|
|
1f832fa294 | ||
|
|
be569aee4f | ||
|
|
419e94ccec | ||
|
|
12bc5265b8 | ||
|
|
32898f0c57 | ||
|
|
125c9abf56 | ||
|
|
bc27db4a69 | ||
|
|
dd8e2b13d3 | ||
|
|
005e3b941c | ||
|
|
efa614c773 | ||
|
|
63350e5492 | ||
|
|
255c128b67 | ||
|
|
06f333395e | ||
|
|
3cd024ea2c | ||
|
|
9c0a407db6 | ||
|
|
dc3c619f3f | ||
|
|
5000aafba6 | ||
|
|
b9f2a39d50 | ||
|
|
df321191f4 | ||
|
|
547eb41e96 | ||
|
|
afbb83e081 | ||
|
|
b599968570 | ||
|
|
24cc60f34e | ||
|
|
f967058409 | ||
|
|
078e09ba76 | ||
|
|
d6f97841d4 | ||
|
|
619ac124b3 | ||
|
|
a2180e123d | ||
|
|
0325bb7e2d | ||
|
|
fce361e5bd | ||
|
|
ed6d6e8b9d | ||
|
|
406709f66b | ||
|
|
3ac45a2211 | ||
|
|
716f886780 | ||
|
|
4ef498f0c3 | ||
|
|
5e764e61ba | ||
|
|
1466632fd6 | ||
|
|
0c43e5c3f4 | ||
|
|
7e9d581277 | ||
|
|
c928972137 | ||
|
|
78884e3806 | ||
|
|
f6ac7e047e | ||
|
|
e1fdf3fb28 | ||
|
|
e4510cbc18 | ||
|
|
2c14142e19 | ||
|
|
1caa3f2ce8 | ||
|
|
6501a4b13f | ||
|
|
2f51621e69 | ||
|
|
7e6e64c729 | ||
|
|
9007c7dd14 | ||
|
|
850fd3e371 | ||
|
|
6d8f1c439e | ||
|
|
7166717688 | ||
|
|
f91346dc5b | ||
|
|
dccdfb5533 | ||
|
|
4f065bdedf | ||
|
|
4a02c5848b | ||
|
|
e16a926ef8 | ||
|
|
78f4978a9a | ||
|
|
42d617caf9 | ||
|
|
28eb8784a9 | ||
|
|
fcf5d5c9f7 | ||
|
|
a42f1ff4ee | ||
|
|
98f897ed5b | ||
|
|
7afd608faa | ||
|
|
8313a62f17 | ||
|
|
459e2bf61c | ||
|
|
858d363e97 | ||
|
|
47704189d1 | ||
|
|
b72d424ec9 | ||
|
|
86426e95f7 | ||
|
|
e5f7870f5e | ||
|
|
c0ee739624 | ||
|
|
1dc99498d9 | ||
|
|
319d96c725 | ||
|
|
6d58290a89 | ||
|
|
666904f902 | ||
|
|
064533d8aa | ||
|
|
1768af9026 | ||
|
|
cb7513e9f0 | ||
|
|
645b45cf35 | ||
|
|
9f6d965ba2 | ||
|
|
5348400665 | ||
|
|
812fd5f253 | ||
|
|
da9b393e1b | ||
|
|
aeaa1a23ce | ||
|
|
a8d403a216 | ||
|
|
7bd898b2c7 | ||
|
|
dad66db49a | ||
|
|
adf3f929a4 | ||
|
|
3b23e877b5 | ||
|
|
af4bebb6eb | ||
|
|
8530eb5368 | ||
|
|
0ba1e76400 | ||
|
|
94096ee657 | ||
|
|
c59387c2b4 | ||
|
|
c5a3eff745 | ||
|
|
624891ae1f | ||
|
|
83435e1ab9 | ||
|
|
2b4606e773 | ||
|
|
30f5943f8a | ||
|
|
412ac0a603 | ||
|
|
b2aa1349f8 | ||
|
|
8b62aec7fb | ||
|
|
83fe33b499 | ||
|
|
54d0a1d342 | ||
|
|
c59737a71d | ||
|
|
7c2ba707eb | ||
|
|
545a890c45 | ||
|
|
4b42308484 | ||
|
|
5a95fed35b | ||
|
|
f880e3976f | ||
|
|
25fa2f3275 | ||
|
|
9f005b7537 | ||
|
|
1ad6e977f2 | ||
|
|
e9a64c5479 | ||
|
|
a2e7259ccb | ||
|
|
d28e66a353 | ||
|
|
e0ff6623bb | ||
|
|
3d59e9ac30 | ||
|
|
cff712f071 | ||
|
|
b8bca9d2fe | ||
|
|
a6ccae52d2 | ||
|
|
bdfa6dc9bf | ||
|
|
6eb5731eb5 | ||
|
|
953574f7a3 | ||
|
|
8ec6d695de | ||
|
|
47274817fa | ||
|
|
3b123c6182 | ||
|
|
d7f72e0c41 | ||
|
|
c0bf9c5da8 | ||
|
|
16a6524b11 | ||
|
|
c1963c6122 | ||
|
|
73154e8dd7 | ||
|
|
e2e8cbe46c | ||
|
|
b9b776c278 | ||
|
|
7710df62ee | ||
|
|
63e1c554b7 | ||
|
|
a9d8f3fc41 | ||
|
|
59bf546b4a | ||
|
|
c3e34dc220 | ||
|
|
cd547e9425 | ||
|
|
d98b70f0ca | ||
|
|
7ff009ec43 | ||
|
|
3760c783d0 | ||
|
|
a8be3c72aa | ||
|
|
ee8242d72a |
@@ -4,3 +4,4 @@ target/
|
|||||||
console
|
console
|
||||||
!console/
|
!console/
|
||||||
portal-ui/node_modules/
|
portal-ui/node_modules/
|
||||||
|
.git/
|
||||||
|
|||||||
7
.github/workflows/go.yml
vendored
7
.github/workflows/go.yml
vendored
@@ -3,10 +3,10 @@ name: Go
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.13.x, 1.14.x]
|
go-version: [1.15.x]
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
||||||
@@ -33,4 +33,5 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make verifiers
|
make verifiers
|
||||||
make test
|
make test
|
||||||
|
make crosscompile
|
||||||
make console
|
make console
|
||||||
|
|||||||
15
.github/workflows/react.yml
vendored
Normal file
15
.github/workflows/react.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
name: "React Tests"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install modules
|
||||||
|
working-directory: ./portal-ui
|
||||||
|
run: yarn
|
||||||
|
- name: Run tests
|
||||||
|
working-directory: ./portal-ui
|
||||||
|
run: yarn test
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -24,6 +24,11 @@ console
|
|||||||
|
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
|
# Ignore node_modules
|
||||||
|
|
||||||
|
portal-ui/node_modules/
|
||||||
|
portal-ui/build/
|
||||||
|
|
||||||
# Ignore tls cert and key
|
# Ignore tls cert and key
|
||||||
private.key
|
private.key
|
||||||
public.crt
|
public.crt
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ linters:
|
|||||||
- structcheck
|
- structcheck
|
||||||
|
|
||||||
service:
|
service:
|
||||||
golangci-lint-version: 1.21.0 # use the fixed version to not introduce new linters unexpectedly
|
golangci-lint-version: 1.27.0 # use the fixed version to not introduce new linters unexpectedly
|
||||||
|
|
||||||
run:
|
run:
|
||||||
skip-dirs:
|
skip-dirs:
|
||||||
|
|||||||
122
.goreleaser.yml
122
.goreleaser.yml
@@ -3,10 +3,12 @@
|
|||||||
project_name: console
|
project_name: console
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name_template: "Version {{.Version}}"
|
name_template: "Release version {{.Version}}"
|
||||||
github:
|
github:
|
||||||
owner: minio
|
owner: minio
|
||||||
name: console
|
name: console
|
||||||
|
extra_files:
|
||||||
|
- glob: "*.minisig"
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
@@ -16,45 +18,58 @@ before:
|
|||||||
builds:
|
builds:
|
||||||
-
|
-
|
||||||
goos:
|
goos:
|
||||||
- freebsd
|
|
||||||
- windows
|
|
||||||
- linux
|
- linux
|
||||||
- darwin
|
- darwin
|
||||||
|
- windows
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
|
- ppc64le
|
||||||
|
- s390x
|
||||||
- arm64
|
- arm64
|
||||||
|
ignore:
|
||||||
|
- goos: darwin
|
||||||
|
goarch: arm64
|
||||||
|
- goos: darwin
|
||||||
|
goarch: arm
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm64
|
||||||
|
- goos: windows
|
||||||
|
goarch: arm
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
|
|
||||||
main: ./cmd/console/
|
main: ./cmd/console/
|
||||||
|
|
||||||
flags:
|
flags:
|
||||||
- -trimpath
|
- -trimpath
|
||||||
- --tags=kqueue
|
- --tags=kqueue
|
||||||
|
|
||||||
ldflags:
|
ldflags:
|
||||||
- -s -w -X github.com/minio/console/pkg.ReleaseTag={{.Tag}} -X github.com/minio/console/pkg.CommitID={{.FullCommit}} -X github.com/minio/console/pkg.Version={{.Version}} -X github.com/minio/console/pkg.ShortCommitID={{.ShortCommit}} -X github.com/minio/console/pkg.ReleaseTime={{.Date}}
|
- -s -w -X github.com/minio/console/pkg.ReleaseTag={{.Tag}} -X github.com/minio/console/pkg.CommitID={{.FullCommit}} -X github.com/minio/console/pkg.Version={{.Version}} -X github.com/minio/console/pkg.ShortCommitID={{.ShortCommit}} -X github.com/minio/console/pkg.ReleaseTime={{.Date}}
|
||||||
|
|
||||||
archives:
|
archives:
|
||||||
-
|
-
|
||||||
|
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
|
||||||
|
format: binary
|
||||||
replacements:
|
replacements:
|
||||||
darwin: Darwin
|
arm: arm
|
||||||
linux: Linux
|
|
||||||
windows: Windows
|
signs:
|
||||||
freebsd: FreeBSD
|
-
|
||||||
amd64: x86_64
|
signature: "${artifact}.minisig"
|
||||||
format_overrides:
|
cmd: "sh"
|
||||||
- goos: windows
|
args:
|
||||||
format: zip
|
- '-c'
|
||||||
files:
|
- 'minisign -s /media/${USER}/minio/minisign.key -Sm ${artifact} < /media/${USER}/minio/minisign-passphrase'
|
||||||
- README.md
|
artifacts: all
|
||||||
- LICENSE
|
|
||||||
checksum:
|
|
||||||
name_template: 'checksums.txt'
|
|
||||||
snapshot:
|
snapshot:
|
||||||
name_template: 'snapshot-{{ time "2006-01-02" }}'
|
name_template: v0.0.0@{{.ShortCommit}}
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
sort: asc
|
sort: asc
|
||||||
filters:
|
|
||||||
exclude:
|
|
||||||
- '^docs:'
|
|
||||||
- '^test:'
|
|
||||||
nfpms:
|
nfpms:
|
||||||
-
|
-
|
||||||
vendor: MinIO Inc.
|
vendor: MinIO Inc.
|
||||||
@@ -65,18 +80,55 @@ nfpms:
|
|||||||
formats:
|
formats:
|
||||||
- deb
|
- deb
|
||||||
- rpm
|
- rpm
|
||||||
replacements:
|
|
||||||
darwin: Darwin
|
|
||||||
linux: Linux
|
|
||||||
freebsd: FreeBSD
|
|
||||||
amd64: x86_64
|
|
||||||
dockers:
|
dockers:
|
||||||
-
|
- image_templates:
|
||||||
# GOOS of the built binary that should be used.
|
- "minio/console:{{ .Tag }}-amd64"
|
||||||
goos: linux
|
use_buildx: true
|
||||||
# GOARCH of the built binary that should be used.
|
dockerfile: Dockerfile.release
|
||||||
goarch: amd64
|
extra_files:
|
||||||
dockerfile: Dockerfile.release
|
- LICENSE
|
||||||
image_templates:
|
- CREDITS
|
||||||
- "minio/console:{{ .Tag }}"
|
build_flag_templates:
|
||||||
- "minio/console:latest"
|
- "--platform=linux/amd64"
|
||||||
|
- image_templates:
|
||||||
|
- "minio/console:{{ .Tag }}-ppc64le"
|
||||||
|
use_buildx: true
|
||||||
|
dockerfile: Dockerfile.release
|
||||||
|
extra_files:
|
||||||
|
- LICENSE
|
||||||
|
- CREDITS
|
||||||
|
build_flag_templates:
|
||||||
|
- "--platform=linux/ppc64le"
|
||||||
|
- image_templates:
|
||||||
|
- "minio/console:{{ .Tag }}-s390x"
|
||||||
|
use_buildx: true
|
||||||
|
dockerfile: Dockerfile.release
|
||||||
|
extra_files:
|
||||||
|
- LICENSE
|
||||||
|
- CREDITS
|
||||||
|
build_flag_templates:
|
||||||
|
- "--platform=linux/s390x"
|
||||||
|
- image_templates:
|
||||||
|
- "minio/console:{{ .Tag }}-arm64"
|
||||||
|
use_buildx: true
|
||||||
|
goarch: arm64
|
||||||
|
dockerfile: Dockerfile.release
|
||||||
|
extra_files:
|
||||||
|
- LICENSE
|
||||||
|
- CREDITS
|
||||||
|
build_flag_templates:
|
||||||
|
- "--platform=linux/arm64"
|
||||||
|
docker_manifests:
|
||||||
|
- name_template: minio/console:{{ .Tag }}
|
||||||
|
image_templates:
|
||||||
|
- minio/console:{{ .Tag }}-amd64
|
||||||
|
- minio/console:{{ .Tag }}-arm64
|
||||||
|
- minio/console:{{ .Tag }}-ppc64le
|
||||||
|
- minio/console:{{ .Tag }}-s390x
|
||||||
|
- name_template: minio/console:latest
|
||||||
|
image_templates:
|
||||||
|
- minio/console:{{ .Tag }}-amd64
|
||||||
|
- minio/console:{{ .Tag }}-arm64
|
||||||
|
- minio/console:{{ .Tag }}-ppc64le
|
||||||
|
- minio/console:{{ .Tag }}-s390x
|
||||||
|
|||||||
@@ -11,40 +11,7 @@ $ docker run --rm -p 389:389 -p 636:636 --name my-openldap-container --detach os
|
|||||||
Run the `billy.ldif` file using `ldapadd` command to create a new user and assign it to a group.
|
Run the `billy.ldif` file using `ldapadd` command to create a new user and assign it to a group.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ cat > billy.ldif << EOF
|
$ docker cp console/docs/ldap/billy.ldif my-openldap-container:/container/service/slapd/assets/test/billy.ldif
|
||||||
# LDIF fragment to create group branch under root
|
|
||||||
dn: uid=billy,dc=example,dc=org
|
|
||||||
uid: billy
|
|
||||||
cn: billy
|
|
||||||
sn: 3
|
|
||||||
objectClass: top
|
|
||||||
objectClass: posixAccount
|
|
||||||
objectClass: inetOrgPerson
|
|
||||||
loginShell: /bin/bash
|
|
||||||
homeDirectory: /home/billy
|
|
||||||
uidNumber: 14583102
|
|
||||||
gidNumber: 14564100
|
|
||||||
userPassword: {SSHA}j3lBh1Seqe4rqF1+NuWmjhvtAni1JC5A
|
|
||||||
mail: billy@example.org
|
|
||||||
gecos: Billy User
|
|
||||||
# Create base group
|
|
||||||
dn: ou=groups,dc=example,dc=org
|
|
||||||
objectclass:organizationalunit
|
|
||||||
ou: groups
|
|
||||||
description: generic groups branch
|
|
||||||
# create consoleAdmin group (this already exists on minio and have a policy of s3::*)
|
|
||||||
dn: cn=consoleAdmin,ou=groups,dc=example,dc=org
|
|
||||||
objectClass: top
|
|
||||||
objectClass: posixGroup
|
|
||||||
gidNumber: 678
|
|
||||||
# Assing group to new user
|
|
||||||
dn: cn=consoleAdmin,ou=groups,dc=example,dc=org
|
|
||||||
changetype: modify
|
|
||||||
add: memberuid
|
|
||||||
memberuid: billy
|
|
||||||
EOF
|
|
||||||
|
|
||||||
$ docker cp billy.ldif my-openldap-container:/container/service/slapd/assets/test/billy.ldif
|
|
||||||
$ docker exec my-openldap-container ldapadd -x -D "cn=admin,dc=example,dc=org" -w admin -f /container/service/slapd/assets/test/billy.ldif -H ldap://localhost -ZZ
|
$ docker exec my-openldap-container ldapadd -x -D "cn=admin,dc=example,dc=org" -w admin -f /container/service/slapd/assets/test/billy.ldif -H ldap://localhost -ZZ
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -119,9 +86,6 @@ export MINIO_IDENTITY_LDAP_SERVER_INSECURE=on
|
|||||||
## Run Console
|
## Run Console
|
||||||
|
|
||||||
```
|
```
|
||||||
export CONSOLE_ACCESS_KEY=minio
|
|
||||||
export CONSOLE_SECRET_KEY=minio123
|
|
||||||
...
|
|
||||||
export CONSOLE_LDAP_ENABLED=on
|
export CONSOLE_LDAP_ENABLED=on
|
||||||
./console server
|
./console server
|
||||||
```
|
```
|
||||||
|
|||||||
29
Dockerfile
29
Dockerfile
@@ -1,4 +1,25 @@
|
|||||||
FROM golang:1.13
|
FROM golang:1.15 as binlayer
|
||||||
|
|
||||||
|
RUN go get github.com/go-bindata/go-bindata/... && go get github.com/elazarl/go-bindata-assetfs/...
|
||||||
|
|
||||||
|
FROM node:10 as uilayer
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=binlayer /go/bin/go-bindata-assetfs /bin/
|
||||||
|
COPY --from=binlayer /go/bin/go-bindata /bin/
|
||||||
|
|
||||||
|
COPY ./portal-ui/package.json ./
|
||||||
|
COPY ./portal-ui/yarn.lock ./
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
COPY ./portal-ui .
|
||||||
|
|
||||||
|
RUN yarn install && make build-static
|
||||||
|
|
||||||
|
USER node
|
||||||
|
|
||||||
|
FROM golang:1.15 as golayer
|
||||||
|
|
||||||
RUN apt-get update -y && apt-get install -y ca-certificates
|
RUN apt-get update -y && apt-get install -y ca-certificates
|
||||||
|
|
||||||
@@ -12,6 +33,8 @@ RUN go mod download
|
|||||||
ADD . /go/src/github.com/minio/console/
|
ADD . /go/src/github.com/minio/console/
|
||||||
WORKDIR /go/src/github.com/minio/console/
|
WORKDIR /go/src/github.com/minio/console/
|
||||||
|
|
||||||
|
COPY --from=uilayer /app/bindata_assetfs.go /go/src/github.com/minio/console/portal-ui/bindata_assetfs.go
|
||||||
|
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
|
|
||||||
RUN go build -ldflags "-w -s" -a -o console ./cmd/console
|
RUN go build -ldflags "-w -s" -a -o console ./cmd/console
|
||||||
@@ -20,7 +43,7 @@ FROM scratch
|
|||||||
MAINTAINER MinIO Development "dev@min.io"
|
MAINTAINER MinIO Development "dev@min.io"
|
||||||
EXPOSE 9090
|
EXPOSE 9090
|
||||||
|
|
||||||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=golayer /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
COPY --from=0 /go/src/github.com/minio/console/console .
|
COPY --from=golayer /go/src/github.com/minio/console/console .
|
||||||
|
|
||||||
ENTRYPOINT ["/console"]
|
ENTRYPOINT ["/console"]
|
||||||
|
|||||||
20
Dockerfile.assets
Normal file
20
Dockerfile.assets
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
FROM golang:1.15 as binlayer
|
||||||
|
|
||||||
|
RUN go get github.com/go-bindata/go-bindata/... && go get github.com/elazarl/go-bindata-assetfs/...
|
||||||
|
|
||||||
|
FROM node:10 as uilayer
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=binlayer /go/bin/go-bindata-assetfs /bin/
|
||||||
|
COPY --from=binlayer /go/bin/go-bindata /bin/
|
||||||
|
|
||||||
|
COPY ./portal-ui/package.json ./
|
||||||
|
COPY ./portal-ui/yarn.lock ./
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
COPY ./portal-ui .
|
||||||
|
|
||||||
|
RUN yarn install && make build-static
|
||||||
|
|
||||||
|
USER node
|
||||||
@@ -1,12 +1,21 @@
|
|||||||
FROM ubuntu:18.04 as certs
|
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
|
||||||
|
|
||||||
RUN apt-get update -y && apt-get install -y ca-certificates
|
COPY CREDITS /licenses/CREDITS
|
||||||
|
COPY LICENSE /licenses/LICENSE
|
||||||
|
|
||||||
|
LABEL name="MinIO" \
|
||||||
|
vendor="MinIO Inc <dev@min.io>" \
|
||||||
|
maintainer="MinIO Inc <dev@min.io>" \
|
||||||
|
version="v0.5.1" \
|
||||||
|
release="v0.5.1" \
|
||||||
|
summary="A graphical user interface for MinIO" \
|
||||||
|
description="MinIO object storage is fundamentally different. Designed for performance and the S3 API, it is 100% open-source. MinIO is ideal for large, private cloud environments with stringent security requirements and delivers mission-critical availability across a diverse range of workloads."
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
microdnf update --nodocs && \
|
||||||
|
microdnf install ca-certificates --nodocs
|
||||||
|
|
||||||
FROM scratch
|
|
||||||
MAINTAINER MinIO Development "dev@min.io"
|
|
||||||
EXPOSE 9090
|
EXPOSE 9090
|
||||||
COPY console /console
|
COPY console /console
|
||||||
|
|
||||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
||||||
|
|
||||||
ENTRYPOINT ["/console"]
|
ENTRYPOINT ["/console"]
|
||||||
|
|||||||
9
Makefile
9
Makefile
@@ -25,8 +25,13 @@ verifiers: getdeps fmt lint
|
|||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
@echo "Running $@ check"
|
@echo "Running $@ check"
|
||||||
@GO111MODULE=on gofmt -d cmd/
|
@GO111MODULE=on gofmt -d restapi/
|
||||||
@GO111MODULE=on gofmt -d pkg/
|
@GO111MODULE=on gofmt -d pkg/
|
||||||
|
@GO111MODULE=on gofmt -d cmd/
|
||||||
|
@GO111MODULE=on gofmt -d cluster/
|
||||||
|
|
||||||
|
crosscompile:
|
||||||
|
@(env bash $(PWD)/cross-compile.sh)
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@echo "Running $@ check"
|
@echo "Running $@ check"
|
||||||
@@ -45,7 +50,7 @@ swagger-gen:
|
|||||||
@swagger generate server -A console --main-package=console --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
|
@swagger generate server -A console --main-package=console --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
|
||||||
|
|
||||||
assets:
|
assets:
|
||||||
@(cd portal-ui; yarn install; make build-static; cd ..)
|
@(cd portal-ui; yarn install; make build-static; yarn prettier --write . --loglevel warn; cd ..)
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@(GO111MODULE=on go test -race -v github.com/minio/console/restapi/...)
|
@(GO111MODULE=on go test -race -v github.com/minio/console/restapi/...)
|
||||||
|
|||||||
53
README.md
53
README.md
@@ -3,7 +3,7 @@
|
|||||||
A graphical user interface for [MinIO](https://github.com/minio/minio)
|
A graphical user interface for [MinIO](https://github.com/minio/minio)
|
||||||
|
|
||||||
|
|
||||||
| Dashboard | Adding A User |
|
| Dashboard | Creating a bucket |
|
||||||
| ------------- | ------------- |
|
| ------------- | ------------- |
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ All `console` needs is a MinIO user with admin privileges and URL pointing to yo
|
|||||||
> Note: We don't recommend using MinIO's Operator Credentials
|
> Note: We don't recommend using MinIO's Operator Credentials
|
||||||
|
|
||||||
1. Create a user for `console` using `mc`.
|
1. Create a user for `console` using `mc`.
|
||||||
```
|
```bash
|
||||||
$ set +o history
|
$ set +o history
|
||||||
$ mc admin user add myminio console YOURCONSOLESECRET
|
$ mc admin user add myminio console YOURCONSOLESECRET
|
||||||
$ set -o history
|
$ set -o history
|
||||||
@@ -21,7 +21,7 @@ $ set -o history
|
|||||||
|
|
||||||
2. Create a policy for `console` with access to everything (for testing and debugging)
|
2. Create a policy for `console` with access to everything (for testing and debugging)
|
||||||
|
|
||||||
```
|
```json
|
||||||
$ cat > consoleAdmin.json << EOF
|
$ cat > consoleAdmin.json << EOF
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
@@ -57,7 +57,7 @@ $ mc admin policy set myminio consoleAdmin user=console
|
|||||||
|
|
||||||
### Note
|
### Note
|
||||||
Additionally, you can create policies to limit the privileges for `console` users, for example, if you want the user to only have access to dashboard, buckets, notifications and watch page, the policy should look like this:
|
Additionally, you can create policies to limit the privileges for `console` users, for example, if you want the user to only have access to dashboard, buckets, notifications and watch page, the policy should look like this:
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"Version": "2012-10-17",
|
"Version": "2012-10-17",
|
||||||
"Statement": [{
|
"Statement": [{
|
||||||
@@ -100,26 +100,53 @@ Additionally, you can create policies to limit the privileges for `console` user
|
|||||||
## Run Console server
|
## Run Console server
|
||||||
To run the server:
|
To run the server:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
export CONSOLE_HMAC_JWT_SECRET=YOURJWTSIGNINGSECRET
|
# Salt to encrypt JWT payload
|
||||||
|
|
||||||
#required to encrypt jwet payload
|
|
||||||
export CONSOLE_PBKDF_PASSPHRASE=SECRET
|
export CONSOLE_PBKDF_PASSPHRASE=SECRET
|
||||||
|
|
||||||
#required to encrypt jwet payload
|
#required to encrypt jwet payload
|
||||||
export CONSOLE_PBKDF_SALT=SECRET
|
export CONSOLE_PBKDF_SALT=SECRET
|
||||||
|
|
||||||
export CONSOLE_ACCESS_KEY=console
|
# MinIO endpoint
|
||||||
export CONSOLE_SECRET_KEY=YOURCONSOLESECRET
|
|
||||||
export CONSOLE_MINIO_SERVER=http://localhost:9000
|
export CONSOLE_MINIO_SERVER=http://localhost:9000
|
||||||
./console server
|
./console server
|
||||||
```
|
```
|
||||||
|
|
||||||
## Connect Console to a Minio using TLS and a self-signed certificate
|
## Run Console with TLS enable
|
||||||
|
|
||||||
|
Copy your `public.crt` and `private.key` to `~/.console/certs`, then:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./console server
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally, `Console` has support for multiple certificates, clients can request them using `SNI`. It expects the following structure:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
certs/
|
||||||
|
│
|
||||||
|
├─ public.crt
|
||||||
|
├─ private.key
|
||||||
|
│
|
||||||
|
├─ example.com/
|
||||||
|
│ │
|
||||||
|
│ ├─ public.crt
|
||||||
|
│ └─ private.key
|
||||||
|
└─ foobar.org/
|
||||||
|
│
|
||||||
|
├─ public.crt
|
||||||
|
└─ private.key
|
||||||
|
...
|
||||||
|
|
||||||
```
|
```
|
||||||
...
|
|
||||||
export CONSOLE_MINIO_SERVER_TLS_ROOT_CAS=<certificate_file_name>
|
Therefore, we read all filenames in the cert directory and check
|
||||||
|
for each directory whether it contains a public.crt and private.key.
|
||||||
|
|
||||||
|
## Connect Console to a Minio using TLS and a self-signed certificate
|
||||||
|
|
||||||
|
Copy the MinIO `ca.crt` under `~/.console/certs/CAs`, then:
|
||||||
|
```
|
||||||
export CONSOLE_MINIO_SERVER=https://localhost:9000
|
export CONSOLE_MINIO_SERVER=https://localhost:9000
|
||||||
./console server
|
./console server
|
||||||
```
|
```
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
|||||||
// This file is part of MinIO Kubernetes Cloud
|
// This file is part of MinIO Kubernetes Cloud
|
||||||
// Copyright (c) 2019 MinIO, Inc.
|
// Copyright (c) 2020 MinIO, Inc.
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// This file is part of MinIO Kubernetes Cloud
|
// This file is part of MinIO Kubernetes Cloud
|
||||||
// Copyright (c) 2019 MinIO, Inc.
|
// Copyright (c) 2020 MinIO, Inc.
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
@@ -31,7 +31,6 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
errCantDetermineMinIOImage = errors.New("can't determine MinIO Image")
|
errCantDetermineMinIOImage = errors.New("can't determine MinIO Image")
|
||||||
errCantDetermineMCImage = errors.New("can't determine MC Image")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetK8sAPIServer() string {
|
func GetK8sAPIServer() string {
|
||||||
@@ -64,13 +63,8 @@ func GetNsFromFile() string {
|
|||||||
return string(dat)
|
return string(dat)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This operation will run only once at console startup
|
// Namespace will run only once at console startup
|
||||||
var namespace = GetNsFromFile()
|
var Namespace = GetNsFromFile()
|
||||||
|
|
||||||
// Returns the namespace in which the controller is installed
|
|
||||||
func GetNs() string {
|
|
||||||
return env.Get(ConsoleNamespace, namespace)
|
|
||||||
}
|
|
||||||
|
|
||||||
// getLatestMinIOImage returns the latest docker image for MinIO if found on the internet
|
// getLatestMinIOImage returns the latest docker image for MinIO if found on the internet
|
||||||
func getLatestMinIOImage(client HTTPClientI) (*string, error) {
|
func getLatestMinIOImage(client HTTPClientI) (*string, error) {
|
||||||
@@ -98,7 +92,7 @@ func getLatestMinIOImage(client HTTPClientI) (*string, error) {
|
|||||||
var latestMinIOImage, errLatestMinIOImage = getLatestMinIOImage(
|
var latestMinIOImage, errLatestMinIOImage = getLatestMinIOImage(
|
||||||
&HTTPClient{
|
&HTTPClient{
|
||||||
Client: &http.Client{
|
Client: &http.Client{
|
||||||
Timeout: 4 * time.Second,
|
Timeout: 15 * time.Second,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -125,44 +119,3 @@ func GetLatestMinioImage(client HTTPClientI) (*string, error) {
|
|||||||
}
|
}
|
||||||
return latestMinIOImage, nil
|
return latestMinIOImage, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// getLatestMCImage returns the latest docker image for MC if found on the internet
|
|
||||||
func getLatestMCImage() (*string, error) {
|
|
||||||
// Create an http client with a 4 second timeout
|
|
||||||
client := http.Client{
|
|
||||||
Timeout: 4 * time.Second,
|
|
||||||
}
|
|
||||||
resp, err := client.Get("https://dl.min.io/client/mc/release/linux-amd64/")
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var re = regexp.MustCompile(`(?m)\.\/mc\.(RELEASE.*?Z)"`)
|
|
||||||
// look for a single match
|
|
||||||
matches := re.FindAllStringSubmatch(string(body), 1)
|
|
||||||
for i := range matches {
|
|
||||||
release := matches[i][1]
|
|
||||||
dockerImage := fmt.Sprintf("minio/mc:%s", release)
|
|
||||||
return &dockerImage, nil
|
|
||||||
}
|
|
||||||
return nil, errCantDetermineMCImage
|
|
||||||
}
|
|
||||||
|
|
||||||
var latestMCImage, errLatestMCImage = getLatestMCImage()
|
|
||||||
|
|
||||||
func GetMCImage() (*string, error) {
|
|
||||||
image := strings.TrimSpace(env.Get(ConsoleMCImage, ""))
|
|
||||||
// if there is a preferred image configured by the user we'll always return that
|
|
||||||
if image != "" {
|
|
||||||
return &image, nil
|
|
||||||
}
|
|
||||||
if errLatestMCImage != nil {
|
|
||||||
return nil, errLatestMCImage
|
|
||||||
}
|
|
||||||
return latestMCImage, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// This file is part of MinIO Kubernetes Cloud
|
// This file is part of MinIO Kubernetes Cloud
|
||||||
// Copyright (c) 2019 MinIO, Inc.
|
// Copyright (c) 2020 MinIO, Inc.
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
@@ -21,5 +21,4 @@ const (
|
|||||||
ConsoleK8SAPIServerTLSRootCA = "CONSOLE_K8S_API_SERVER_TLS_ROOT_CA"
|
ConsoleK8SAPIServerTLSRootCA = "CONSOLE_K8S_API_SERVER_TLS_ROOT_CA"
|
||||||
ConsoleMinioImage = "CONSOLE_MINIO_IMAGE"
|
ConsoleMinioImage = "CONSOLE_MINIO_IMAGE"
|
||||||
ConsoleMCImage = "CONSOLE_MC_IMAGE"
|
ConsoleMCImage = "CONSOLE_MC_IMAGE"
|
||||||
ConsoleNamespace = "CONSOLE_NAMESPACE"
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package cluster
|
package cluster
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -25,6 +26,8 @@ import (
|
|||||||
// that are used within this project.
|
// that are used within this project.
|
||||||
type HTTPClientI interface {
|
type HTTPClientI interface {
|
||||||
Get(url string) (resp *http.Response, err error)
|
Get(url string) (resp *http.Response, err error)
|
||||||
|
Post(url, contentType string, body io.Reader) (resp *http.Response, err error)
|
||||||
|
Do(req *http.Request) (*http.Response, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTPClient Interface implementation
|
// HTTPClient Interface implementation
|
||||||
@@ -38,3 +41,13 @@ type HTTPClient struct {
|
|||||||
func (c *HTTPClient) Get(url string) (resp *http.Response, err error) {
|
func (c *HTTPClient) Get(url string) (resp *http.Response, err error) {
|
||||||
return c.Client.Get(url)
|
return c.Client.Get(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Post implements http.Client.Post()
|
||||||
|
func (c *HTTPClient) Post(url, contentType string, body io.Reader) (resp *http.Response, err error) {
|
||||||
|
return c.Client.Post(url, contentType, body)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do implements http.Client.Do()
|
||||||
|
func (c *HTTPClient) Do(req *http.Request) (*http.Response, error) {
|
||||||
|
return c.Client.Do(req)
|
||||||
|
}
|
||||||
|
|||||||
@@ -76,21 +76,19 @@ func newApp(name string) *cli.App {
|
|||||||
|
|
||||||
findClosestCommands := func(command string) []string {
|
findClosestCommands := func(command string) []string {
|
||||||
var closestCommands []string
|
var closestCommands []string
|
||||||
for _, value := range commandsTree.PrefixMatch(command) {
|
closestCommands = append(closestCommands, commandsTree.PrefixMatch(command)...)
|
||||||
closestCommands = append(closestCommands, value.(string))
|
|
||||||
}
|
|
||||||
|
|
||||||
sort.Strings(closestCommands)
|
sort.Strings(closestCommands)
|
||||||
// Suggest other close commands - allow missed, wrongly added and
|
// Suggest other close commands - allow missed, wrongly added and
|
||||||
// even transposed characters
|
// even transposed characters
|
||||||
for _, value := range commandsTree.Walk(commandsTree.Root()) {
|
for _, value := range commandsTree.Walk(commandsTree.Root()) {
|
||||||
if sort.SearchStrings(closestCommands, value.(string)) < len(closestCommands) {
|
if sort.SearchStrings(closestCommands, value) < len(closestCommands) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// 2 is arbitrary and represents the max
|
// 2 is arbitrary and represents the max
|
||||||
// allowed number of typed errors
|
// allowed number of typed errors
|
||||||
if words.DamerauLevenshteinDistance(command, value.(string)) < 2 {
|
if words.DamerauLevenshteinDistance(command, value) < 2 {
|
||||||
closestCommands = append(closestCommands, value.(string))
|
closestCommands = append(closestCommands, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/go-openapi/loads"
|
"github.com/go-openapi/loads"
|
||||||
"github.com/jessevdk/go-flags"
|
"github.com/jessevdk/go-flags"
|
||||||
"github.com/minio/cli"
|
"github.com/minio/cli"
|
||||||
|
"github.com/minio/console/pkg/certs"
|
||||||
"github.com/minio/console/restapi"
|
"github.com/minio/console/restapi"
|
||||||
"github.com/minio/console/restapi/operations"
|
"github.com/minio/console/restapi/operations"
|
||||||
)
|
)
|
||||||
@@ -47,23 +49,18 @@ var serverCmd = cli.Command{
|
|||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "tls-host",
|
Name: "tls-host",
|
||||||
Value: restapi.GetSSLHostname(),
|
Value: restapi.GetTLSHostname(),
|
||||||
Usage: "HTTPS server hostname",
|
Usage: "HTTPS server hostname",
|
||||||
},
|
},
|
||||||
cli.IntFlag{
|
cli.IntFlag{
|
||||||
Name: "tls-port",
|
Name: "tls-port",
|
||||||
Value: restapi.GetSSLPort(),
|
Value: restapi.GetTLSPort(),
|
||||||
Usage: "HTTPS server port",
|
Usage: "HTTPS server port",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "tls-certificate",
|
Name: "certs-dir",
|
||||||
Value: "",
|
Value: certs.GlobalCertsCADir.Get(),
|
||||||
Usage: "filename of public cert",
|
Usage: "path to certs directory",
|
||||||
},
|
|
||||||
cli.StringFlag{
|
|
||||||
Name: "tls-key",
|
|
||||||
Value: "",
|
|
||||||
Usage: "filename of private key",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -82,7 +79,9 @@ func startServer(ctx *cli.Context) error {
|
|||||||
parser := flags.NewParser(server, flags.Default)
|
parser := flags.NewParser(server, flags.Default)
|
||||||
parser.ShortDescription = "MinIO Console Server"
|
parser.ShortDescription = "MinIO Console Server"
|
||||||
parser.LongDescription = swaggerSpec.Spec().Info.Description
|
parser.LongDescription = swaggerSpec.Spec().Info.Description
|
||||||
|
|
||||||
server.ConfigureFlags()
|
server.ConfigureFlags()
|
||||||
|
|
||||||
for _, optsGroup := range api.CommandLineOptionsGroups {
|
for _, optsGroup := range api.CommandLineOptionsGroups {
|
||||||
_, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
|
_, err := parser.AddGroup(optsGroup.ShortDescription, optsGroup.LongDescription, optsGroup.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -106,12 +105,18 @@ func startServer(ctx *cli.Context) error {
|
|||||||
restapi.Hostname = ctx.String("host")
|
restapi.Hostname = ctx.String("host")
|
||||||
restapi.Port = fmt.Sprintf("%v", ctx.Int("port"))
|
restapi.Port = fmt.Sprintf("%v", ctx.Int("port"))
|
||||||
|
|
||||||
tlsCertificatePath := ctx.String("tls-certificate")
|
// Set all certs and CAs directories path
|
||||||
tlsCertificateKeyPath := ctx.String("tls-key")
|
certs.GlobalCertsDir, _ = certs.NewConfigDirFromCtx(ctx, "certs-dir", certs.DefaultCertsDir.Get)
|
||||||
|
certs.GlobalCertsCADir = &certs.ConfigDir{Path: filepath.Join(certs.GlobalCertsDir.Get(), certs.CertsCADir)}
|
||||||
|
|
||||||
if tlsCertificatePath != "" && tlsCertificateKeyPath != "" {
|
// check if certs and CAs directories exists or can be created
|
||||||
server.TLSCertificate = flags.Filename(tlsCertificatePath)
|
if err := certs.MkdirAllIgnorePerm(certs.GlobalCertsCADir.Get()); err != nil {
|
||||||
server.TLSCertificateKey = flags.Filename(tlsCertificateKeyPath)
|
log.Println(fmt.Sprintf("Unable to create certs CA directory at %s", certs.GlobalCertsCADir.Get()))
|
||||||
|
}
|
||||||
|
// load the certificates and the CAs
|
||||||
|
restapi.GlobalRootCAs, restapi.GlobalPublicCerts, restapi.GlobalTLSCertsManager = certs.GetAllCertificatesAndCAs()
|
||||||
|
|
||||||
|
if len(restapi.GlobalPublicCerts) > 0 {
|
||||||
// If TLS certificates are provided enforce the HTTPS schema, meaning console will redirect
|
// If TLS certificates are provided enforce the HTTPS schema, meaning console will redirect
|
||||||
// plain HTTP connections to HTTPS server
|
// plain HTTP connections to HTTPS server
|
||||||
server.EnabledListeners = []string{"http", "https"}
|
server.EnabledListeners = []string{"http", "https"}
|
||||||
|
|||||||
34
cross-compile.sh
Executable file
34
cross-compile.sh
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
# Enable tracing if set.
|
||||||
|
[ -n "$BASH_XTRACEFD" ] && set -x
|
||||||
|
|
||||||
|
_init() {
|
||||||
|
## All binaries are static make sure to disable CGO.
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
## List of architectures and OS to test coss compilation.
|
||||||
|
SUPPORTED_OSARCH="linux/ppc64le linux/mips64 linux/arm64 linux/s390x darwin/amd64 freebsd/amd64 windows/amd64 linux/arm linux/386 netbsd/amd64"
|
||||||
|
}
|
||||||
|
|
||||||
|
_build() {
|
||||||
|
local osarch=$1
|
||||||
|
IFS=/ read -r -a arr <<<"$osarch"
|
||||||
|
os="${arr[0]}"
|
||||||
|
arch="${arr[1]}"
|
||||||
|
package=$(go list -f '{{.ImportPath}}' ./cmd/console)
|
||||||
|
printf -- "--> %15s:%s\n" "${osarch}" "${package}"
|
||||||
|
|
||||||
|
# go build -trimpath to build the binary.
|
||||||
|
GOOS=$os GOARCH=$arch GO111MODULE=on go build -trimpath --tags=kqueue --ldflags "-s -w" -o /dev/null ./cmd/console
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
echo "Testing builds for OS/Arch: ${SUPPORTED_OSARCH}"
|
||||||
|
for each_osarch in ${SUPPORTED_OSARCH}; do
|
||||||
|
_build "${each_osarch}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
_init && main "$@"
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
`Console` will authenticate against `Kubernetes`using bearer tokens via HTTP `Authorization` header. The user will provide this token once
|
`Console` will authenticate against `Kubernetes`using bearer tokens via HTTP `Authorization` header. The user will provide this token once
|
||||||
in the login form, Console will validate it against Kubernetes (list apis) and if valid will generate and return a new Console sessions
|
in the login form, Console will validate it against Kubernetes (list apis) and if valid will generate and return a new Console sessions
|
||||||
with encrypted claims (the user Service account token will be inside the JWT in the data field)
|
with encrypted claims (the user Service account token will be inside the session encrypted token
|
||||||
|
|
||||||
# Kubernetes
|
# Kubernetes
|
||||||
|
|
||||||
|
|||||||
35
docs/ldap/billy.ldif
Normal file
35
docs/ldap/billy.ldif
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# LDIF fragment to create group branch under root
|
||||||
|
dn: uid=billy,dc=example,dc=org
|
||||||
|
uid: billy
|
||||||
|
cn: billy
|
||||||
|
sn: 3
|
||||||
|
objectClass: top
|
||||||
|
objectClass: posixAccount
|
||||||
|
objectClass: inetOrgPerson
|
||||||
|
loginShell: /bin/bash
|
||||||
|
homeDirectory: /home/billy
|
||||||
|
uidNumber: 14583102
|
||||||
|
gidNumber: 14564100
|
||||||
|
userPassword: {SSHA}j3lBh1Seqe4rqF1+NuWmjhvtAni1JC5A
|
||||||
|
mail: billy@example.org
|
||||||
|
gecos: Billy User
|
||||||
|
|
||||||
|
# Create base group
|
||||||
|
dn: ou=groups,dc=example,dc=org
|
||||||
|
objectclass:organizationalunit
|
||||||
|
ou: groups
|
||||||
|
description: generic groups branch
|
||||||
|
|
||||||
|
# create consoleAdmin group (this already exists on minio and have a policy of s3::*)
|
||||||
|
dn: cn=consoleAdmin,ou=groups,dc=example,dc=org
|
||||||
|
objectClass: top
|
||||||
|
objectClass: posixGroup
|
||||||
|
gidNumber: 678
|
||||||
|
|
||||||
|
# Assing group to new user
|
||||||
|
dn: cn=consoleAdmin,ou=groups,dc=example,dc=org
|
||||||
|
changetype: modify
|
||||||
|
add: memberuid
|
||||||
|
memberuid: billy
|
||||||
|
|
||||||
|
|
||||||
32
go.mod
32
go.mod
@@ -1,10 +1,9 @@
|
|||||||
module github.com/minio/console
|
module github.com/minio/console
|
||||||
|
|
||||||
go 1.13
|
go 1.15
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/coreos/go-oidc v2.2.1+incompatible
|
github.com/coreos/go-oidc v2.2.1+incompatible
|
||||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible
|
|
||||||
github.com/elazarl/go-bindata-assetfs v1.0.0
|
github.com/elazarl/go-bindata-assetfs v1.0.0
|
||||||
github.com/go-openapi/errors v0.19.6
|
github.com/go-openapi/errors v0.19.6
|
||||||
github.com/go-openapi/loads v0.19.5
|
github.com/go-openapi/loads v0.19.5
|
||||||
@@ -15,20 +14,25 @@ require (
|
|||||||
github.com/go-openapi/validate v0.19.10
|
github.com/go-openapi/validate v0.19.10
|
||||||
github.com/gorilla/websocket v1.4.2
|
github.com/gorilla/websocket v1.4.2
|
||||||
github.com/jessevdk/go-flags v1.4.0
|
github.com/jessevdk/go-flags v1.4.0
|
||||||
github.com/json-iterator/go v1.1.10
|
|
||||||
github.com/minio/cli v1.22.0
|
github.com/minio/cli v1.22.0
|
||||||
github.com/minio/mc v0.0.0-20200725183142-90d22b271f60
|
github.com/minio/kes v0.11.0
|
||||||
github.com/minio/minio v0.0.0-20200725154241-abbf6ce6ccf8
|
github.com/minio/mc v0.0.0-20201220181029-41c804b179de
|
||||||
github.com/minio/minio-go/v7 v7.0.2-0.20200722162308-e0105ca08252
|
github.com/minio/minio v0.0.0-20201221162327-6df6ac0f3410
|
||||||
github.com/minio/operator v0.0.0-20200730044813-c2895a5065a1
|
github.com/minio/minio-go/v7 v7.0.7-0.20201217170524-3baf9ea06f7c
|
||||||
|
github.com/minio/operator v0.0.0-20201204220226-9901d1d0766c
|
||||||
|
github.com/minio/operator/logsearchapi v0.0.0-20201217190212-bf6546b09012
|
||||||
|
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/satori/go.uuid v1.2.0
|
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-20200709230013-948cd5f35899
|
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392
|
||||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381
|
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
||||||
k8s.io/api v0.18.0
|
gopkg.in/yaml.v2 v2.3.0
|
||||||
k8s.io/apimachinery v0.18.0
|
k8s.io/api v0.18.6
|
||||||
k8s.io/client-go v0.18.0
|
k8s.io/apimachinery v0.18.8
|
||||||
|
k8s.io/client-go v0.18.6
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replace github.com/minio/operator v0.0.0-20201204220226-9901d1d0766c => github.com/dvaldivia/operator v0.0.0-20201230052356-04efc0ea5890
|
||||||
|
|||||||
BIN
images/pic1.png
BIN
images/pic1.png
Binary file not shown.
|
Before Width: | Height: | Size: 635 KiB After Width: | Height: | Size: 1.9 MiB |
BIN
images/pic2.png
BIN
images/pic2.png
Binary file not shown.
|
Before Width: | Height: | Size: 688 KiB After Width: | Height: | Size: 1.6 MiB |
@@ -7,7 +7,6 @@ rules:
|
|||||||
- ""
|
- ""
|
||||||
resources:
|
resources:
|
||||||
- namespaces
|
- namespaces
|
||||||
- secrets
|
|
||||||
- pods
|
- pods
|
||||||
- services
|
- services
|
||||||
- events
|
- events
|
||||||
@@ -18,6 +17,18 @@ rules:
|
|||||||
- create
|
- create
|
||||||
- list
|
- list
|
||||||
- patch
|
- patch
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- secrets
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- watch
|
||||||
|
- create
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- deletecollection
|
||||||
|
- delete
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- "storage.k8s.io"
|
- "storage.k8s.io"
|
||||||
resources:
|
resources:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ spec:
|
|||||||
serviceAccountName: console-sa
|
serviceAccountName: console-sa
|
||||||
containers:
|
containers:
|
||||||
- name: console
|
- name: console
|
||||||
image: minio/console:latest
|
image: minio/console:v0.5.1
|
||||||
imagePullPolicy: "IfNotPresent"
|
imagePullPolicy: "IfNotPresent"
|
||||||
args:
|
args:
|
||||||
- server
|
- server
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ resources:
|
|||||||
- console-configmap.yaml
|
- console-configmap.yaml
|
||||||
- console-service.yaml
|
- console-service.yaml
|
||||||
- console-deployment.yaml
|
- console-deployment.yaml
|
||||||
- minio-operator.yaml
|
- https://github.com/minio/operator/?ref=v3.0.10
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,18 +6,38 @@ rules:
|
|||||||
- apiGroups:
|
- apiGroups:
|
||||||
- ""
|
- ""
|
||||||
resources:
|
resources:
|
||||||
- namespaces
|
|
||||||
- secrets
|
- secrets
|
||||||
- pods
|
|
||||||
- services
|
|
||||||
- events
|
|
||||||
- resourcequotas
|
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- watch
|
- watch
|
||||||
- create
|
- create
|
||||||
- list
|
- list
|
||||||
- patch
|
- patch
|
||||||
|
- update
|
||||||
|
- deletecollection
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- namespaces
|
||||||
|
- pods
|
||||||
|
- services
|
||||||
|
- events
|
||||||
|
- resourcequotas
|
||||||
|
- nodes
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- watch
|
||||||
|
- create
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- persistentvolumeclaims
|
||||||
|
verbs:
|
||||||
|
- deletecollection
|
||||||
|
- list
|
||||||
|
- get
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- "storage.k8s.io"
|
- "storage.k8s.io"
|
||||||
resources:
|
resources:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ spec:
|
|||||||
serviceAccountName: console-sa
|
serviceAccountName: console-sa
|
||||||
containers:
|
containers:
|
||||||
- name: console
|
- name: console
|
||||||
image: minio/console:latest
|
image: minio/console:v0.5.1
|
||||||
imagePullPolicy: "IfNotPresent"
|
imagePullPolicy: "IfNotPresent"
|
||||||
env:
|
env:
|
||||||
- name: CONSOLE_OPERATOR_MODE
|
- name: CONSOLE_OPERATOR_MODE
|
||||||
|
|||||||
@@ -8,4 +8,3 @@ resources:
|
|||||||
- console-configmap.yaml
|
- console-configmap.yaml
|
||||||
- console-service.yaml
|
- console-service.yaml
|
||||||
- console-deployment.yaml
|
- console-deployment.yaml
|
||||||
- minio-operator.yaml
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
9
k8s/operator-console/operator/kustomization.yaml
Normal file
9
k8s/operator-console/operator/kustomization.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
# beginning of customizations
|
||||||
|
#namespace: min-ns
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ../base
|
||||||
|
- https://github.com/minio/operator/?ref=v3.0.29
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// This file is part of MinIO Kubernetes Cloud
|
// This file is part of MinIO Kubernetes Cloud
|
||||||
// Copyright (c) 2019 MinIO, Inc.
|
// Copyright (c) 2020 MinIO, Inc.
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|||||||
98
models/account_change_password_request.go
Normal file
98
models/account_change_password_request.go
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AccountChangePasswordRequest account change password request
|
||||||
|
//
|
||||||
|
// swagger:model accountChangePasswordRequest
|
||||||
|
type AccountChangePasswordRequest struct {
|
||||||
|
|
||||||
|
// current secret key
|
||||||
|
// Required: true
|
||||||
|
CurrentSecretKey *string `json:"current_secret_key"`
|
||||||
|
|
||||||
|
// new secret key
|
||||||
|
// Required: true
|
||||||
|
NewSecretKey *string `json:"new_secret_key"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this account change password request
|
||||||
|
func (m *AccountChangePasswordRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateCurrentSecretKey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateNewSecretKey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AccountChangePasswordRequest) validateCurrentSecretKey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("current_secret_key", "body", m.CurrentSecretKey); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AccountChangePasswordRequest) validateNewSecretKey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("new_secret_key", "body", m.NewSecretKey); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *AccountChangePasswordRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *AccountChangePasswordRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res AccountChangePasswordRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
63
models/add_bucket_replication.go
Normal file
63
models/add_bucket_replication.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) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddBucketReplication add bucket replication
|
||||||
|
//
|
||||||
|
// swagger:model addBucketReplication
|
||||||
|
type AddBucketReplication struct {
|
||||||
|
|
||||||
|
// arn
|
||||||
|
Arn string `json:"arn,omitempty"`
|
||||||
|
|
||||||
|
// destination bucket
|
||||||
|
DestinationBucket string `json:"destination_bucket,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this add bucket replication
|
||||||
|
func (m *AddBucketReplication) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *AddBucketReplication) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *AddBucketReplication) UnmarshalBinary(b []byte) error {
|
||||||
|
var res AddBucketReplication
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -23,6 +23,9 @@ package models
|
|||||||
// Editing this file might prove futile when you re-run the swagger generate command
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/go-openapi/errors"
|
||||||
"github.com/go-openapi/strfmt"
|
"github.com/go-openapi/strfmt"
|
||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
@@ -40,10 +43,47 @@ type AdminInfoResponse struct {
|
|||||||
|
|
||||||
// usage
|
// usage
|
||||||
Usage int64 `json:"usage,omitempty"`
|
Usage int64 `json:"usage,omitempty"`
|
||||||
|
|
||||||
|
// widgets
|
||||||
|
Widgets []*Widget `json:"widgets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this admin info response
|
// Validate validates this admin info response
|
||||||
func (m *AdminInfoResponse) Validate(formats strfmt.Registry) error {
|
func (m *AdminInfoResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateWidgets(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AdminInfoResponse) validateWidgets(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Widgets) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Widgets); i++ {
|
||||||
|
if swag.IsZero(m.Widgets[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Widgets[i] != nil {
|
||||||
|
if err := m.Widgets[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("widgets" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
258
models/aws_configuration.go
Normal file
258
models/aws_configuration.go
Normal file
@@ -0,0 +1,258 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AwsConfiguration aws configuration
|
||||||
|
//
|
||||||
|
// swagger:model awsConfiguration
|
||||||
|
type AwsConfiguration struct {
|
||||||
|
|
||||||
|
// secretsmanager
|
||||||
|
// Required: true
|
||||||
|
Secretsmanager *AwsConfigurationSecretsmanager `json:"secretsmanager"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this aws configuration
|
||||||
|
func (m *AwsConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateSecretsmanager(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AwsConfiguration) validateSecretsmanager(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("secretsmanager", "body", m.Secretsmanager); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Secretsmanager != nil {
|
||||||
|
if err := m.Secretsmanager.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("secretsmanager")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *AwsConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *AwsConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res AwsConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AwsConfigurationSecretsmanager aws configuration secretsmanager
|
||||||
|
//
|
||||||
|
// swagger:model AwsConfigurationSecretsmanager
|
||||||
|
type AwsConfigurationSecretsmanager struct {
|
||||||
|
|
||||||
|
// credentials
|
||||||
|
// Required: true
|
||||||
|
Credentials *AwsConfigurationSecretsmanagerCredentials `json:"credentials"`
|
||||||
|
|
||||||
|
// endpoint
|
||||||
|
// Required: true
|
||||||
|
Endpoint *string `json:"endpoint"`
|
||||||
|
|
||||||
|
// kmskey
|
||||||
|
Kmskey string `json:"kmskey,omitempty"`
|
||||||
|
|
||||||
|
// region
|
||||||
|
// Required: true
|
||||||
|
Region *string `json:"region"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this aws configuration secretsmanager
|
||||||
|
func (m *AwsConfigurationSecretsmanager) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateCredentials(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateEndpoint(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateRegion(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AwsConfigurationSecretsmanager) validateCredentials(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("secretsmanager"+"."+"credentials", "body", m.Credentials); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Credentials != nil {
|
||||||
|
if err := m.Credentials.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("secretsmanager" + "." + "credentials")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AwsConfigurationSecretsmanager) validateEndpoint(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("secretsmanager"+"."+"endpoint", "body", m.Endpoint); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AwsConfigurationSecretsmanager) validateRegion(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("secretsmanager"+"."+"region", "body", m.Region); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *AwsConfigurationSecretsmanager) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *AwsConfigurationSecretsmanager) UnmarshalBinary(b []byte) error {
|
||||||
|
var res AwsConfigurationSecretsmanager
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AwsConfigurationSecretsmanagerCredentials aws configuration secretsmanager credentials
|
||||||
|
//
|
||||||
|
// swagger:model AwsConfigurationSecretsmanagerCredentials
|
||||||
|
type AwsConfigurationSecretsmanagerCredentials struct {
|
||||||
|
|
||||||
|
// accesskey
|
||||||
|
// Required: true
|
||||||
|
Accesskey *string `json:"accesskey"`
|
||||||
|
|
||||||
|
// secretkey
|
||||||
|
// Required: true
|
||||||
|
Secretkey *string `json:"secretkey"`
|
||||||
|
|
||||||
|
// token
|
||||||
|
Token string `json:"token,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this aws configuration secretsmanager credentials
|
||||||
|
func (m *AwsConfigurationSecretsmanagerCredentials) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateAccesskey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSecretkey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AwsConfigurationSecretsmanagerCredentials) validateAccesskey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("secretsmanager"+"."+"credentials"+"."+"accesskey", "body", m.Accesskey); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *AwsConfigurationSecretsmanagerCredentials) validateSecretkey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("secretsmanager"+"."+"credentials"+"."+"secretkey", "body", m.Secretkey); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *AwsConfigurationSecretsmanagerCredentials) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *AwsConfigurationSecretsmanagerCredentials) UnmarshalBinary(b []byte) error {
|
||||||
|
var res AwsConfigurationSecretsmanagerCredentials
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
63
models/bucket_encryption_info.go
Normal file
63
models/bucket_encryption_info.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) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketEncryptionInfo bucket encryption info
|
||||||
|
//
|
||||||
|
// swagger:model bucketEncryptionInfo
|
||||||
|
type BucketEncryptionInfo struct {
|
||||||
|
|
||||||
|
// algorithm
|
||||||
|
Algorithm string `json:"algorithm,omitempty"`
|
||||||
|
|
||||||
|
// kms master key ID
|
||||||
|
KmsMasterKeyID string `json:"kmsMasterKeyID,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket encryption info
|
||||||
|
func (m *BucketEncryptionInfo) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketEncryptionInfo) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketEncryptionInfo) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketEncryptionInfo
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
89
models/bucket_encryption_request.go
Normal file
89
models/bucket_encryption_request.go
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketEncryptionRequest bucket encryption request
|
||||||
|
//
|
||||||
|
// swagger:model bucketEncryptionRequest
|
||||||
|
type BucketEncryptionRequest struct {
|
||||||
|
|
||||||
|
// enc type
|
||||||
|
EncType BucketEncryptionType `json:"encType,omitempty"`
|
||||||
|
|
||||||
|
// kms key ID
|
||||||
|
KmsKeyID string `json:"kmsKeyID,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket encryption request
|
||||||
|
func (m *BucketEncryptionRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateEncType(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BucketEncryptionRequest) validateEncType(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.EncType) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.EncType.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("encType")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketEncryptionRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketEncryptionRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketEncryptionRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
80
models/bucket_encryption_type.go
Normal file
80
models/bucket_encryption_type.go
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketEncryptionType bucket encryption type
|
||||||
|
//
|
||||||
|
// swagger:model bucketEncryptionType
|
||||||
|
type BucketEncryptionType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// BucketEncryptionTypeSseS3 captures enum value "sse-s3"
|
||||||
|
BucketEncryptionTypeSseS3 BucketEncryptionType = "sse-s3"
|
||||||
|
|
||||||
|
// BucketEncryptionTypeSseKms captures enum value "sse-kms"
|
||||||
|
BucketEncryptionTypeSseKms BucketEncryptionType = "sse-kms"
|
||||||
|
)
|
||||||
|
|
||||||
|
// for schema
|
||||||
|
var bucketEncryptionTypeEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []BucketEncryptionType
|
||||||
|
if err := json.Unmarshal([]byte(`["sse-s3","sse-kms"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
bucketEncryptionTypeEnum = append(bucketEncryptionTypeEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m BucketEncryptionType) validateBucketEncryptionTypeEnum(path, location string, value BucketEncryptionType) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, bucketEncryptionTypeEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket encryption type
|
||||||
|
func (m BucketEncryptionType) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateBucketEncryptionTypeEnum("", "body", m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
99
models/bucket_object.go
Normal file
99
models/bucket_object.go
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketObject bucket object
|
||||||
|
//
|
||||||
|
// swagger:model bucketObject
|
||||||
|
type BucketObject struct {
|
||||||
|
|
||||||
|
// content type
|
||||||
|
ContentType string `json:"content_type,omitempty"`
|
||||||
|
|
||||||
|
// expiration
|
||||||
|
Expiration string `json:"expiration,omitempty"`
|
||||||
|
|
||||||
|
// expiration rule id
|
||||||
|
ExpirationRuleID string `json:"expiration_rule_id,omitempty"`
|
||||||
|
|
||||||
|
// is delete marker
|
||||||
|
IsDeleteMarker bool `json:"is_delete_marker,omitempty"`
|
||||||
|
|
||||||
|
// is latest
|
||||||
|
IsLatest bool `json:"is_latest,omitempty"`
|
||||||
|
|
||||||
|
// last modified
|
||||||
|
LastModified string `json:"last_modified,omitempty"`
|
||||||
|
|
||||||
|
// legal hold status
|
||||||
|
LegalHoldStatus string `json:"legal_hold_status,omitempty"`
|
||||||
|
|
||||||
|
// name
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
|
||||||
|
// retention mode
|
||||||
|
RetentionMode string `json:"retention_mode,omitempty"`
|
||||||
|
|
||||||
|
// retention until date
|
||||||
|
RetentionUntilDate string `json:"retention_until_date,omitempty"`
|
||||||
|
|
||||||
|
// size
|
||||||
|
Size int64 `json:"size,omitempty"`
|
||||||
|
|
||||||
|
// tags
|
||||||
|
Tags map[string]string `json:"tags,omitempty"`
|
||||||
|
|
||||||
|
// user tags
|
||||||
|
UserTags map[string]string `json:"user_tags,omitempty"`
|
||||||
|
|
||||||
|
// version id
|
||||||
|
VersionID string `json:"version_id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket object
|
||||||
|
func (m *BucketObject) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketObject) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketObject) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketObject
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
60
models/bucket_replication_destination.go
Normal file
60
models/bucket_replication_destination.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketReplicationDestination bucket replication destination
|
||||||
|
//
|
||||||
|
// swagger:model bucketReplicationDestination
|
||||||
|
type BucketReplicationDestination struct {
|
||||||
|
|
||||||
|
// bucket
|
||||||
|
Bucket string `json:"bucket,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket replication destination
|
||||||
|
func (m *BucketReplicationDestination) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationDestination) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationDestination) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketReplicationDestination
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
97
models/bucket_replication_response.go
Normal file
97
models/bucket_replication_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) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketReplicationResponse bucket replication response
|
||||||
|
//
|
||||||
|
// swagger:model bucketReplicationResponse
|
||||||
|
type BucketReplicationResponse struct {
|
||||||
|
|
||||||
|
// rules
|
||||||
|
Rules []*BucketReplicationRule `json:"rules"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket replication response
|
||||||
|
func (m *BucketReplicationResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateRules(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BucketReplicationResponse) validateRules(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Rules) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Rules); i++ {
|
||||||
|
if swag.IsZero(m.Rules[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Rules[i] != nil {
|
||||||
|
if err := m.Rules[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("rules" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketReplicationResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
173
models/bucket_replication_rule.go
Normal file
173
models/bucket_replication_rule.go
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketReplicationRule bucket replication rule
|
||||||
|
//
|
||||||
|
// swagger:model bucketReplicationRule
|
||||||
|
type BucketReplicationRule struct {
|
||||||
|
|
||||||
|
// delete marker replication
|
||||||
|
DeleteMarkerReplication *BucketReplicationRuleMarker `json:"delete_marker_replication,omitempty"`
|
||||||
|
|
||||||
|
// destination
|
||||||
|
Destination *BucketReplicationDestination `json:"destination,omitempty"`
|
||||||
|
|
||||||
|
// id
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
|
|
||||||
|
// priority
|
||||||
|
Priority int32 `json:"priority,omitempty"`
|
||||||
|
|
||||||
|
// status
|
||||||
|
// Enum: [Enabled Disabled]
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket replication rule
|
||||||
|
func (m *BucketReplicationRule) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateDeleteMarkerReplication(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateDestination(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateStatus(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BucketReplicationRule) validateDeleteMarkerReplication(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.DeleteMarkerReplication) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.DeleteMarkerReplication != nil {
|
||||||
|
if err := m.DeleteMarkerReplication.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("delete_marker_replication")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BucketReplicationRule) validateDestination(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Destination) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Destination != nil {
|
||||||
|
if err := m.Destination.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("destination")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var bucketReplicationRuleTypeStatusPropEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []string
|
||||||
|
if err := json.Unmarshal([]byte(`["Enabled","Disabled"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
bucketReplicationRuleTypeStatusPropEnum = append(bucketReplicationRuleTypeStatusPropEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// BucketReplicationRuleStatusEnabled captures enum value "Enabled"
|
||||||
|
BucketReplicationRuleStatusEnabled string = "Enabled"
|
||||||
|
|
||||||
|
// BucketReplicationRuleStatusDisabled captures enum value "Disabled"
|
||||||
|
BucketReplicationRuleStatusDisabled string = "Disabled"
|
||||||
|
)
|
||||||
|
|
||||||
|
// prop value enum
|
||||||
|
func (m *BucketReplicationRule) validateStatusEnum(path, location string, value string) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, bucketReplicationRuleTypeStatusPropEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BucketReplicationRule) validateStatus(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Status) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateStatusEnum("status", "body", m.Status); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationRule) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationRule) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketReplicationRule
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
117
models/bucket_replication_rule_marker.go
Normal file
117
models/bucket_replication_rule_marker.go
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketReplicationRuleMarker bucket replication rule marker
|
||||||
|
//
|
||||||
|
// swagger:model bucketReplicationRuleMarker
|
||||||
|
type BucketReplicationRuleMarker struct {
|
||||||
|
|
||||||
|
// status
|
||||||
|
// Enum: [Enabled Disabled]
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket replication rule marker
|
||||||
|
func (m *BucketReplicationRuleMarker) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateStatus(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var bucketReplicationRuleMarkerTypeStatusPropEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []string
|
||||||
|
if err := json.Unmarshal([]byte(`["Enabled","Disabled"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
bucketReplicationRuleMarkerTypeStatusPropEnum = append(bucketReplicationRuleMarkerTypeStatusPropEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// BucketReplicationRuleMarkerStatusEnabled captures enum value "Enabled"
|
||||||
|
BucketReplicationRuleMarkerStatusEnabled string = "Enabled"
|
||||||
|
|
||||||
|
// BucketReplicationRuleMarkerStatusDisabled captures enum value "Disabled"
|
||||||
|
BucketReplicationRuleMarkerStatusDisabled string = "Disabled"
|
||||||
|
)
|
||||||
|
|
||||||
|
// prop value enum
|
||||||
|
func (m *BucketReplicationRuleMarker) validateStatusEnum(path, location string, value string) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, bucketReplicationRuleMarkerTypeStatusPropEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BucketReplicationRuleMarker) validateStatus(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Status) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateStatusEnum("status", "body", m.Status); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationRuleMarker) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketReplicationRuleMarker) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketReplicationRuleMarker
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
60
models/bucket_versioning_response.go
Normal file
60
models/bucket_versioning_response.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// BucketVersioningResponse bucket versioning response
|
||||||
|
//
|
||||||
|
// swagger:model bucketVersioningResponse
|
||||||
|
type BucketVersioningResponse struct {
|
||||||
|
|
||||||
|
// is versioned
|
||||||
|
IsVersioned bool `json:"is_versioned,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this bucket versioning response
|
||||||
|
func (m *BucketVersioningResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *BucketVersioningResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *BucketVersioningResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res BucketVersioningResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
117
models/console_configuration.go
Normal file
117
models/console_configuration.go
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ConsoleConfiguration console configuration
|
||||||
|
//
|
||||||
|
// swagger:model consoleConfiguration
|
||||||
|
type ConsoleConfiguration struct {
|
||||||
|
MetadataFields
|
||||||
|
|
||||||
|
// image
|
||||||
|
Image string `json:"image,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON unmarshals this object from a JSON structure
|
||||||
|
func (m *ConsoleConfiguration) UnmarshalJSON(raw []byte) error {
|
||||||
|
// AO0
|
||||||
|
var aO0 MetadataFields
|
||||||
|
if err := swag.ReadJSON(raw, &aO0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
m.MetadataFields = aO0
|
||||||
|
|
||||||
|
// AO1
|
||||||
|
var dataAO1 struct {
|
||||||
|
Image string `json:"image,omitempty"`
|
||||||
|
}
|
||||||
|
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
m.Image = dataAO1.Image
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON marshals this object to a JSON structure
|
||||||
|
func (m ConsoleConfiguration) MarshalJSON() ([]byte, error) {
|
||||||
|
_parts := make([][]byte, 0, 2)
|
||||||
|
|
||||||
|
aO0, err := swag.WriteJSON(m.MetadataFields)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
_parts = append(_parts, aO0)
|
||||||
|
var dataAO1 struct {
|
||||||
|
Image string `json:"image,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
dataAO1.Image = m.Image
|
||||||
|
|
||||||
|
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
|
||||||
|
if errAO1 != nil {
|
||||||
|
return nil, errAO1
|
||||||
|
}
|
||||||
|
_parts = append(_parts, jsonDataAO1)
|
||||||
|
return swag.ConcatJSON(_parts...), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this console configuration
|
||||||
|
func (m *ConsoleConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// validation for a type composition with MetadataFields
|
||||||
|
if err := m.MetadataFields.Validate(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *ConsoleConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *ConsoleConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res ConsoleConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
162
models/create_remote_bucket.go
Normal file
162
models/create_remote_bucket.go
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CreateRemoteBucket create remote bucket
|
||||||
|
//
|
||||||
|
// swagger:model createRemoteBucket
|
||||||
|
type CreateRemoteBucket struct {
|
||||||
|
|
||||||
|
// access key
|
||||||
|
// Required: true
|
||||||
|
// Min Length: 3
|
||||||
|
AccessKey *string `json:"accessKey"`
|
||||||
|
|
||||||
|
// region
|
||||||
|
Region string `json:"region,omitempty"`
|
||||||
|
|
||||||
|
// secret key
|
||||||
|
// Required: true
|
||||||
|
// Min Length: 8
|
||||||
|
SecretKey *string `json:"secretKey"`
|
||||||
|
|
||||||
|
// source bucket
|
||||||
|
// Required: true
|
||||||
|
SourceBucket *string `json:"sourceBucket"`
|
||||||
|
|
||||||
|
// target bucket
|
||||||
|
// Required: true
|
||||||
|
TargetBucket *string `json:"targetBucket"`
|
||||||
|
|
||||||
|
// target URL
|
||||||
|
// Required: true
|
||||||
|
TargetURL *string `json:"targetURL"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this create remote bucket
|
||||||
|
func (m *CreateRemoteBucket) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateAccessKey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSecretKey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSourceBucket(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTargetBucket(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTargetURL(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateRemoteBucket) validateAccessKey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("accessKey", "body", m.AccessKey); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.MinLength("accessKey", "body", string(*m.AccessKey), 3); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateRemoteBucket) validateSecretKey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("secretKey", "body", m.SecretKey); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.MinLength("secretKey", "body", string(*m.SecretKey), 8); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateRemoteBucket) validateSourceBucket(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("sourceBucket", "body", m.SourceBucket); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateRemoteBucket) validateTargetBucket(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("targetBucket", "body", m.TargetBucket); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateRemoteBucket) validateTargetURL(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("targetURL", "body", m.TargetURL); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *CreateRemoteBucket) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *CreateRemoteBucket) UnmarshalBinary(b []byte) error {
|
||||||
|
var res CreateRemoteBucket
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -42,15 +42,48 @@ type CreateTenantRequest struct {
|
|||||||
// annotations
|
// annotations
|
||||||
Annotations map[string]string `json:"annotations,omitempty"`
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
|
||||||
|
// console
|
||||||
|
Console *ConsoleConfiguration `json:"console,omitempty"`
|
||||||
|
|
||||||
|
// console image
|
||||||
|
ConsoleImage string `json:"console_image,omitempty"`
|
||||||
|
|
||||||
// enable console
|
// enable console
|
||||||
EnableConsole *bool `json:"enable_console,omitempty"`
|
EnableConsole *bool `json:"enable_console,omitempty"`
|
||||||
|
|
||||||
// enable ssl
|
// enable prometheus
|
||||||
EnableSsl *bool `json:"enable_ssl,omitempty"`
|
EnablePrometheus *bool `json:"enable_prometheus,omitempty"`
|
||||||
|
|
||||||
|
// enable tls
|
||||||
|
EnableTLS *bool `json:"enable_tls,omitempty"`
|
||||||
|
|
||||||
|
// encryption
|
||||||
|
Encryption *EncryptionConfiguration `json:"encryption,omitempty"`
|
||||||
|
|
||||||
|
// erasure coding parity
|
||||||
|
ErasureCodingParity int64 `json:"erasureCodingParity,omitempty"`
|
||||||
|
|
||||||
|
// expose console
|
||||||
|
ExposeConsole bool `json:"expose_console,omitempty"`
|
||||||
|
|
||||||
|
// expose minio
|
||||||
|
ExposeMinio bool `json:"expose_minio,omitempty"`
|
||||||
|
|
||||||
|
// idp
|
||||||
|
Idp *IdpConfiguration `json:"idp,omitempty"`
|
||||||
|
|
||||||
// image
|
// image
|
||||||
Image string `json:"image,omitempty"`
|
Image string `json:"image,omitempty"`
|
||||||
|
|
||||||
|
// image pull secret
|
||||||
|
ImagePullSecret string `json:"image_pull_secret,omitempty"`
|
||||||
|
|
||||||
|
// image registry
|
||||||
|
ImageRegistry *ImageRegistry `json:"image_registry,omitempty"`
|
||||||
|
|
||||||
|
// labels
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
|
||||||
// mounth path
|
// mounth path
|
||||||
MounthPath string `json:"mounth_path,omitempty"`
|
MounthPath string `json:"mounth_path,omitempty"`
|
||||||
|
|
||||||
@@ -63,21 +96,37 @@ type CreateTenantRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
Namespace *string `json:"namespace"`
|
Namespace *string `json:"namespace"`
|
||||||
|
|
||||||
|
// pools
|
||||||
|
// Required: true
|
||||||
|
Pools []*Pool `json:"pools"`
|
||||||
|
|
||||||
// secret key
|
// secret key
|
||||||
SecretKey string `json:"secret_key,omitempty"`
|
SecretKey string `json:"secret_key,omitempty"`
|
||||||
|
|
||||||
// service name
|
// tls
|
||||||
ServiceName string `json:"service_name,omitempty"`
|
TLS *TLSConfiguration `json:"tls,omitempty"`
|
||||||
|
|
||||||
// zones
|
|
||||||
// Required: true
|
|
||||||
Zones []*Zone `json:"zones"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this create tenant request
|
// Validate validates this create tenant request
|
||||||
func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
|
func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateConsole(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateEncryption(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateIdp(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateImageRegistry(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := m.validateName(formats); err != nil {
|
if err := m.validateName(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
@@ -86,7 +135,11 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
|
|||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := m.validateZones(formats); err != nil {
|
if err := m.validatePools(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTLS(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +149,78 @@ func (m *CreateTenantRequest) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *CreateTenantRequest) validateConsole(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Console) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Console != nil {
|
||||||
|
if err := m.Console.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("console")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateTenantRequest) validateEncryption(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Encryption) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Encryption != nil {
|
||||||
|
if err := m.Encryption.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("encryption")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateTenantRequest) validateIdp(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Idp) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Idp != nil {
|
||||||
|
if err := m.Idp.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("idp")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *CreateTenantRequest) validateImageRegistry(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.ImageRegistry) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.ImageRegistry != nil {
|
||||||
|
if err := m.ImageRegistry.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("image_registry")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (m *CreateTenantRequest) validateName(formats strfmt.Registry) error {
|
func (m *CreateTenantRequest) validateName(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("name", "body", m.Name); err != nil {
|
if err := validate.Required("name", "body", m.Name); err != nil {
|
||||||
@@ -118,21 +243,21 @@ func (m *CreateTenantRequest) validateNamespace(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *CreateTenantRequest) validateZones(formats strfmt.Registry) error {
|
func (m *CreateTenantRequest) validatePools(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("zones", "body", m.Zones); err != nil {
|
if err := validate.Required("pools", "body", m.Pools); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(m.Zones); i++ {
|
for i := 0; i < len(m.Pools); i++ {
|
||||||
if swag.IsZero(m.Zones[i]) { // not required
|
if swag.IsZero(m.Pools[i]) { // not required
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Zones[i] != nil {
|
if m.Pools[i] != nil {
|
||||||
if err := m.Zones[i].Validate(formats); err != nil {
|
if err := m.Pools[i].Validate(formats); err != nil {
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
return ve.ValidateName("zones" + "." + strconv.Itoa(i))
|
return ve.ValidateName("pools" + "." + strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -143,6 +268,24 @@ func (m *CreateTenantRequest) validateZones(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *CreateTenantRequest) validateTLS(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.TLS) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.TLS != nil {
|
||||||
|
if err := m.TLS.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("tls")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *CreateTenantRequest) MarshalBinary() ([]byte, error) {
|
func (m *CreateTenantRequest) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
|
|||||||
@@ -33,14 +33,8 @@ import (
|
|||||||
// swagger:model createTenantResponse
|
// swagger:model createTenantResponse
|
||||||
type CreateTenantResponse struct {
|
type CreateTenantResponse struct {
|
||||||
|
|
||||||
// access key
|
|
||||||
AccessKey string `json:"access_key,omitempty"`
|
|
||||||
|
|
||||||
// console
|
// console
|
||||||
Console *CreateTenantResponseConsole `json:"console,omitempty"`
|
Console *CreateTenantResponseConsole `json:"console,omitempty"`
|
||||||
|
|
||||||
// secret key
|
|
||||||
SecretKey string `json:"secret_key,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this create tenant response
|
// Validate validates this create tenant response
|
||||||
|
|||||||
60
models/delete_tenant_request.go
Normal file
60
models/delete_tenant_request.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DeleteTenantRequest delete tenant request
|
||||||
|
//
|
||||||
|
// swagger:model deleteTenantRequest
|
||||||
|
type DeleteTenantRequest struct {
|
||||||
|
|
||||||
|
// delete pvcs
|
||||||
|
DeletePvcs bool `json:"delete_pvcs,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this delete tenant request
|
||||||
|
func (m *DeleteTenantRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *DeleteTenantRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *DeleteTenantRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res DeleteTenantRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
282
models/encryption_configuration.go
Normal file
282
models/encryption_configuration.go
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EncryptionConfiguration encryption configuration
|
||||||
|
//
|
||||||
|
// swagger:model encryptionConfiguration
|
||||||
|
type EncryptionConfiguration struct {
|
||||||
|
MetadataFields
|
||||||
|
|
||||||
|
// aws
|
||||||
|
Aws *AwsConfiguration `json:"aws,omitempty"`
|
||||||
|
|
||||||
|
// client
|
||||||
|
Client *KeyPairConfiguration `json:"client,omitempty"`
|
||||||
|
|
||||||
|
// gemalto
|
||||||
|
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
|
||||||
|
|
||||||
|
// image
|
||||||
|
Image string `json:"image,omitempty"`
|
||||||
|
|
||||||
|
// server
|
||||||
|
Server *KeyPairConfiguration `json:"server,omitempty"`
|
||||||
|
|
||||||
|
// vault
|
||||||
|
Vault *VaultConfiguration `json:"vault,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalJSON unmarshals this object from a JSON structure
|
||||||
|
func (m *EncryptionConfiguration) UnmarshalJSON(raw []byte) error {
|
||||||
|
// AO0
|
||||||
|
var aO0 MetadataFields
|
||||||
|
if err := swag.ReadJSON(raw, &aO0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
m.MetadataFields = aO0
|
||||||
|
|
||||||
|
// AO1
|
||||||
|
var dataAO1 struct {
|
||||||
|
Aws *AwsConfiguration `json:"aws,omitempty"`
|
||||||
|
|
||||||
|
Client *KeyPairConfiguration `json:"client,omitempty"`
|
||||||
|
|
||||||
|
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
|
||||||
|
|
||||||
|
Image string `json:"image,omitempty"`
|
||||||
|
|
||||||
|
Server *KeyPairConfiguration `json:"server,omitempty"`
|
||||||
|
|
||||||
|
Vault *VaultConfiguration `json:"vault,omitempty"`
|
||||||
|
}
|
||||||
|
if err := swag.ReadJSON(raw, &dataAO1); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
m.Aws = dataAO1.Aws
|
||||||
|
|
||||||
|
m.Client = dataAO1.Client
|
||||||
|
|
||||||
|
m.Gemalto = dataAO1.Gemalto
|
||||||
|
|
||||||
|
m.Image = dataAO1.Image
|
||||||
|
|
||||||
|
m.Server = dataAO1.Server
|
||||||
|
|
||||||
|
m.Vault = dataAO1.Vault
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalJSON marshals this object to a JSON structure
|
||||||
|
func (m EncryptionConfiguration) MarshalJSON() ([]byte, error) {
|
||||||
|
_parts := make([][]byte, 0, 2)
|
||||||
|
|
||||||
|
aO0, err := swag.WriteJSON(m.MetadataFields)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
_parts = append(_parts, aO0)
|
||||||
|
var dataAO1 struct {
|
||||||
|
Aws *AwsConfiguration `json:"aws,omitempty"`
|
||||||
|
|
||||||
|
Client *KeyPairConfiguration `json:"client,omitempty"`
|
||||||
|
|
||||||
|
Gemalto *GemaltoConfiguration `json:"gemalto,omitempty"`
|
||||||
|
|
||||||
|
Image string `json:"image,omitempty"`
|
||||||
|
|
||||||
|
Server *KeyPairConfiguration `json:"server,omitempty"`
|
||||||
|
|
||||||
|
Vault *VaultConfiguration `json:"vault,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
dataAO1.Aws = m.Aws
|
||||||
|
|
||||||
|
dataAO1.Client = m.Client
|
||||||
|
|
||||||
|
dataAO1.Gemalto = m.Gemalto
|
||||||
|
|
||||||
|
dataAO1.Image = m.Image
|
||||||
|
|
||||||
|
dataAO1.Server = m.Server
|
||||||
|
|
||||||
|
dataAO1.Vault = m.Vault
|
||||||
|
|
||||||
|
jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1)
|
||||||
|
if errAO1 != nil {
|
||||||
|
return nil, errAO1
|
||||||
|
}
|
||||||
|
_parts = append(_parts, jsonDataAO1)
|
||||||
|
return swag.ConcatJSON(_parts...), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this encryption configuration
|
||||||
|
func (m *EncryptionConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// validation for a type composition with MetadataFields
|
||||||
|
if err := m.MetadataFields.Validate(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateAws(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateClient(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateGemalto(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateServer(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateVault(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EncryptionConfiguration) validateAws(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Aws) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Aws != nil {
|
||||||
|
if err := m.Aws.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("aws")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EncryptionConfiguration) validateClient(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Client) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Client != nil {
|
||||||
|
if err := m.Client.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("client")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EncryptionConfiguration) validateGemalto(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Gemalto) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Gemalto != nil {
|
||||||
|
if err := m.Gemalto.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("gemalto")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EncryptionConfiguration) validateServer(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Server) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Server != nil {
|
||||||
|
if err := m.Server.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("server")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *EncryptionConfiguration) validateVault(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Vault) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Vault != nil {
|
||||||
|
if err := m.Vault.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("vault")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *EncryptionConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *EncryptionConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res EncryptionConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -35,7 +35,7 @@ import (
|
|||||||
type Error struct {
|
type Error struct {
|
||||||
|
|
||||||
// code
|
// code
|
||||||
Code int64 `json:"code,omitempty"`
|
Code int32 `json:"code,omitempty"`
|
||||||
|
|
||||||
// message
|
// message
|
||||||
// Required: true
|
// Required: true
|
||||||
|
|||||||
314
models/gemalto_configuration.go
Normal file
314
models/gemalto_configuration.go
Normal file
@@ -0,0 +1,314 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GemaltoConfiguration gemalto configuration
|
||||||
|
//
|
||||||
|
// swagger:model gemaltoConfiguration
|
||||||
|
type GemaltoConfiguration struct {
|
||||||
|
|
||||||
|
// keysecure
|
||||||
|
// Required: true
|
||||||
|
Keysecure *GemaltoConfigurationKeysecure `json:"keysecure"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this gemalto configuration
|
||||||
|
func (m *GemaltoConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateKeysecure(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GemaltoConfiguration) validateKeysecure(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("keysecure", "body", m.Keysecure); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Keysecure != nil {
|
||||||
|
if err := m.Keysecure.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("keysecure")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res GemaltoConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GemaltoConfigurationKeysecure gemalto configuration keysecure
|
||||||
|
//
|
||||||
|
// swagger:model GemaltoConfigurationKeysecure
|
||||||
|
type GemaltoConfigurationKeysecure struct {
|
||||||
|
|
||||||
|
// credentials
|
||||||
|
// Required: true
|
||||||
|
Credentials *GemaltoConfigurationKeysecureCredentials `json:"credentials"`
|
||||||
|
|
||||||
|
// endpoint
|
||||||
|
// Required: true
|
||||||
|
Endpoint *string `json:"endpoint"`
|
||||||
|
|
||||||
|
// tls
|
||||||
|
TLS *GemaltoConfigurationKeysecureTLS `json:"tls,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this gemalto configuration keysecure
|
||||||
|
func (m *GemaltoConfigurationKeysecure) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateCredentials(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateEndpoint(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTLS(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GemaltoConfigurationKeysecure) validateCredentials(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("keysecure"+"."+"credentials", "body", m.Credentials); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Credentials != nil {
|
||||||
|
if err := m.Credentials.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("keysecure" + "." + "credentials")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GemaltoConfigurationKeysecure) validateEndpoint(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("keysecure"+"."+"endpoint", "body", m.Endpoint); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GemaltoConfigurationKeysecure) validateTLS(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.TLS) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.TLS != nil {
|
||||||
|
if err := m.TLS.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("keysecure" + "." + "tls")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfigurationKeysecure) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfigurationKeysecure) UnmarshalBinary(b []byte) error {
|
||||||
|
var res GemaltoConfigurationKeysecure
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GemaltoConfigurationKeysecureCredentials gemalto configuration keysecure credentials
|
||||||
|
//
|
||||||
|
// swagger:model GemaltoConfigurationKeysecureCredentials
|
||||||
|
type GemaltoConfigurationKeysecureCredentials struct {
|
||||||
|
|
||||||
|
// domain
|
||||||
|
// Required: true
|
||||||
|
Domain *string `json:"domain"`
|
||||||
|
|
||||||
|
// retry
|
||||||
|
Retry int64 `json:"retry,omitempty"`
|
||||||
|
|
||||||
|
// token
|
||||||
|
// Required: true
|
||||||
|
Token *string `json:"token"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this gemalto configuration keysecure credentials
|
||||||
|
func (m *GemaltoConfigurationKeysecureCredentials) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateDomain(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateToken(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GemaltoConfigurationKeysecureCredentials) validateDomain(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("keysecure"+"."+"credentials"+"."+"domain", "body", m.Domain); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GemaltoConfigurationKeysecureCredentials) validateToken(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("keysecure"+"."+"credentials"+"."+"token", "body", m.Token); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfigurationKeysecureCredentials) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfigurationKeysecureCredentials) UnmarshalBinary(b []byte) error {
|
||||||
|
var res GemaltoConfigurationKeysecureCredentials
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GemaltoConfigurationKeysecureTLS gemalto configuration keysecure TLS
|
||||||
|
//
|
||||||
|
// swagger:model GemaltoConfigurationKeysecureTLS
|
||||||
|
type GemaltoConfigurationKeysecureTLS struct {
|
||||||
|
|
||||||
|
// ca
|
||||||
|
// Required: true
|
||||||
|
Ca *string `json:"ca"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this gemalto configuration keysecure TLS
|
||||||
|
func (m *GemaltoConfigurationKeysecureTLS) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateCa(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GemaltoConfigurationKeysecureTLS) validateCa(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("keysecure"+"."+"tls"+"."+"ca", "body", m.Ca); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfigurationKeysecureTLS) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *GemaltoConfigurationKeysecureTLS) UnmarshalBinary(b []byte) error {
|
||||||
|
var res GemaltoConfigurationKeysecureTLS
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
112
models/get_bucket_retention_config.go
Normal file
112
models/get_bucket_retention_config.go
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetBucketRetentionConfig get bucket retention config
|
||||||
|
//
|
||||||
|
// swagger:model getBucketRetentionConfig
|
||||||
|
type GetBucketRetentionConfig struct {
|
||||||
|
|
||||||
|
// mode
|
||||||
|
Mode ObjectRetentionMode `json:"mode,omitempty"`
|
||||||
|
|
||||||
|
// unit
|
||||||
|
Unit ObjectRetentionUnit `json:"unit,omitempty"`
|
||||||
|
|
||||||
|
// validity
|
||||||
|
Validity int32 `json:"validity,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this get bucket retention config
|
||||||
|
func (m *GetBucketRetentionConfig) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateMode(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateUnit(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GetBucketRetentionConfig) validateMode(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Mode) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.Mode.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("mode")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GetBucketRetentionConfig) validateUnit(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Unit) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.Unit.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("unit")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *GetBucketRetentionConfig) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *GetBucketRetentionConfig) UnmarshalBinary(b []byte) error {
|
||||||
|
var res GetBucketRetentionConfig
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
48
models/iam_entity.go
Normal file
48
models/iam_entity.go
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// IamEntity iam entity
|
||||||
|
//
|
||||||
|
// swagger:model iamEntity
|
||||||
|
type IamEntity string
|
||||||
|
|
||||||
|
// Validate validates this iam entity
|
||||||
|
func (m IamEntity) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := validate.Pattern("", "body", string(m), `^[\w+=,.@-]{1,64}$`); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
299
models/idp_configuration.go
Normal file
299
models/idp_configuration.go
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// IdpConfiguration idp configuration
|
||||||
|
//
|
||||||
|
// swagger:model idpConfiguration
|
||||||
|
type IdpConfiguration struct {
|
||||||
|
|
||||||
|
// active directory
|
||||||
|
ActiveDirectory *IdpConfigurationActiveDirectory `json:"active_directory,omitempty"`
|
||||||
|
|
||||||
|
// oidc
|
||||||
|
Oidc *IdpConfigurationOidc `json:"oidc,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this idp configuration
|
||||||
|
func (m *IdpConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateActiveDirectory(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateOidc(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfiguration) validateActiveDirectory(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.ActiveDirectory) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.ActiveDirectory != nil {
|
||||||
|
if err := m.ActiveDirectory.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("active_directory")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfiguration) validateOidc(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Oidc) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Oidc != nil {
|
||||||
|
if err := m.Oidc.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("oidc")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *IdpConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *IdpConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res IdpConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// IdpConfigurationActiveDirectory idp configuration active directory
|
||||||
|
//
|
||||||
|
// swagger:model IdpConfigurationActiveDirectory
|
||||||
|
type IdpConfigurationActiveDirectory struct {
|
||||||
|
|
||||||
|
// group name attribute
|
||||||
|
GroupNameAttribute string `json:"group_name_attribute,omitempty"`
|
||||||
|
|
||||||
|
// group search base dn
|
||||||
|
GroupSearchBaseDn string `json:"group_search_base_dn,omitempty"`
|
||||||
|
|
||||||
|
// group search filter
|
||||||
|
GroupSearchFilter string `json:"group_search_filter,omitempty"`
|
||||||
|
|
||||||
|
// server insecure
|
||||||
|
ServerInsecure bool `json:"server_insecure,omitempty"`
|
||||||
|
|
||||||
|
// skip tls verification
|
||||||
|
SkipTLSVerification bool `json:"skip_tls_verification,omitempty"`
|
||||||
|
|
||||||
|
// url
|
||||||
|
// Required: true
|
||||||
|
URL *string `json:"url"`
|
||||||
|
|
||||||
|
// user search filter
|
||||||
|
// Required: true
|
||||||
|
UserSearchFilter *string `json:"user_search_filter"`
|
||||||
|
|
||||||
|
// username format
|
||||||
|
// Required: true
|
||||||
|
UsernameFormat *string `json:"username_format"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this idp configuration active directory
|
||||||
|
func (m *IdpConfigurationActiveDirectory) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateURL(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateUserSearchFilter(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateUsernameFormat(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfigurationActiveDirectory) validateURL(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("active_directory"+"."+"url", "body", m.URL); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfigurationActiveDirectory) validateUserSearchFilter(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("active_directory"+"."+"user_search_filter", "body", m.UserSearchFilter); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfigurationActiveDirectory) validateUsernameFormat(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("active_directory"+"."+"username_format", "body", m.UsernameFormat); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *IdpConfigurationActiveDirectory) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *IdpConfigurationActiveDirectory) UnmarshalBinary(b []byte) error {
|
||||||
|
var res IdpConfigurationActiveDirectory
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// IdpConfigurationOidc idp configuration oidc
|
||||||
|
//
|
||||||
|
// swagger:model IdpConfigurationOidc
|
||||||
|
type IdpConfigurationOidc struct {
|
||||||
|
|
||||||
|
// client id
|
||||||
|
// Required: true
|
||||||
|
ClientID *string `json:"client_id"`
|
||||||
|
|
||||||
|
// secret id
|
||||||
|
// Required: true
|
||||||
|
SecretID *string `json:"secret_id"`
|
||||||
|
|
||||||
|
// url
|
||||||
|
// Required: true
|
||||||
|
URL *string `json:"url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this idp configuration oidc
|
||||||
|
func (m *IdpConfigurationOidc) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateClientID(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSecretID(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateURL(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfigurationOidc) validateClientID(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("oidc"+"."+"client_id", "body", m.ClientID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfigurationOidc) validateSecretID(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("oidc"+"."+"secret_id", "body", m.SecretID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *IdpConfigurationOidc) validateURL(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("oidc"+"."+"url", "body", m.URL); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *IdpConfigurationOidc) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *IdpConfigurationOidc) UnmarshalBinary(b []byte) error {
|
||||||
|
var res IdpConfigurationOidc
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
115
models/image_registry.go
Normal file
115
models/image_registry.go
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ImageRegistry image registry
|
||||||
|
//
|
||||||
|
// swagger:model imageRegistry
|
||||||
|
type ImageRegistry struct {
|
||||||
|
|
||||||
|
// password
|
||||||
|
// Required: true
|
||||||
|
Password *string `json:"password"`
|
||||||
|
|
||||||
|
// registry
|
||||||
|
// Required: true
|
||||||
|
Registry *string `json:"registry"`
|
||||||
|
|
||||||
|
// username
|
||||||
|
// Required: true
|
||||||
|
Username *string `json:"username"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this image registry
|
||||||
|
func (m *ImageRegistry) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validatePassword(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateRegistry(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateUsername(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ImageRegistry) validatePassword(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("password", "body", m.Password); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ImageRegistry) validateRegistry(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("registry", "body", m.Registry); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ImageRegistry) validateUsername(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("username", "body", m.Username); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *ImageRegistry) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *ImageRegistry) UnmarshalBinary(b []byte) error {
|
||||||
|
var res ImageRegistry
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
98
models/key_pair_configuration.go
Normal file
98
models/key_pair_configuration.go
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// KeyPairConfiguration key pair configuration
|
||||||
|
//
|
||||||
|
// swagger:model keyPairConfiguration
|
||||||
|
type KeyPairConfiguration struct {
|
||||||
|
|
||||||
|
// crt
|
||||||
|
// Required: true
|
||||||
|
Crt *string `json:"crt"`
|
||||||
|
|
||||||
|
// key
|
||||||
|
// Required: true
|
||||||
|
Key *string `json:"key"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this key pair configuration
|
||||||
|
func (m *KeyPairConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateCrt(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateKey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *KeyPairConfiguration) validateCrt(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("crt", "body", m.Crt); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *KeyPairConfiguration) validateKey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("key", "body", m.Key); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *KeyPairConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *KeyPairConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res KeyPairConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
75
models/license.go
Normal file
75
models/license.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) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// License license
|
||||||
|
//
|
||||||
|
// swagger:model license
|
||||||
|
type License struct {
|
||||||
|
|
||||||
|
// account id
|
||||||
|
AccountID int64 `json:"account_id,omitempty"`
|
||||||
|
|
||||||
|
// email
|
||||||
|
Email string `json:"email,omitempty"`
|
||||||
|
|
||||||
|
// expires at
|
||||||
|
ExpiresAt string `json:"expires_at,omitempty"`
|
||||||
|
|
||||||
|
// organization
|
||||||
|
Organization string `json:"organization,omitempty"`
|
||||||
|
|
||||||
|
// plan
|
||||||
|
Plan string `json:"plan,omitempty"`
|
||||||
|
|
||||||
|
// storage capacity
|
||||||
|
StorageCapacity int64 `json:"storage_capacity,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this license
|
||||||
|
func (m *License) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *License) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *License) UnmarshalBinary(b []byte) error {
|
||||||
|
var res License
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
100
models/list_objects_response.go
Normal file
100
models/list_objects_response.go
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListObjectsResponse list objects response
|
||||||
|
//
|
||||||
|
// swagger:model listObjectsResponse
|
||||||
|
type ListObjectsResponse struct {
|
||||||
|
|
||||||
|
// list of resulting objects
|
||||||
|
Objects []*BucketObject `json:"objects"`
|
||||||
|
|
||||||
|
// number of objects
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this list objects response
|
||||||
|
func (m *ListObjectsResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateObjects(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ListObjectsResponse) validateObjects(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Objects) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Objects); i++ {
|
||||||
|
if swag.IsZero(m.Objects[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Objects[i] != nil {
|
||||||
|
if err := m.Objects[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("objects" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *ListObjectsResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *ListObjectsResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res ListObjectsResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
100
models/list_remote_buckets_response.go
Normal file
100
models/list_remote_buckets_response.go
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListRemoteBucketsResponse list remote buckets response
|
||||||
|
//
|
||||||
|
// swagger:model listRemoteBucketsResponse
|
||||||
|
type ListRemoteBucketsResponse struct {
|
||||||
|
|
||||||
|
// list of remote buckets
|
||||||
|
Buckets []*RemoteBucket `json:"buckets"`
|
||||||
|
|
||||||
|
// number of remote buckets accessible to user
|
||||||
|
Total int64 `json:"total,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this list remote buckets response
|
||||||
|
func (m *ListRemoteBucketsResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateBuckets(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ListRemoteBucketsResponse) validateBuckets(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Buckets) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Buckets); i++ {
|
||||||
|
if swag.IsZero(m.Buckets[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Buckets[i] != nil {
|
||||||
|
if err := m.Buckets[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("buckets" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *ListRemoteBucketsResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *ListRemoteBucketsResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res ListRemoteBucketsResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
60
models/log_search_response.go
Normal file
60
models/log_search_response.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// LogSearchResponse log search response
|
||||||
|
//
|
||||||
|
// swagger:model logSearchResponse
|
||||||
|
type LogSearchResponse struct {
|
||||||
|
|
||||||
|
// list of log search responses
|
||||||
|
Results interface{} `json:"results,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this log search response
|
||||||
|
func (m *LogSearchResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *LogSearchResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *LogSearchResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res LogSearchResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -37,6 +37,15 @@ type MakeBucketRequest struct {
|
|||||||
// name
|
// name
|
||||||
// Required: true
|
// Required: true
|
||||||
Name *string `json:"name"`
|
Name *string `json:"name"`
|
||||||
|
|
||||||
|
// quota
|
||||||
|
Quota *SetBucketQuota `json:"quota,omitempty"`
|
||||||
|
|
||||||
|
// retention
|
||||||
|
Retention *PutBucketRetentionRequest `json:"retention,omitempty"`
|
||||||
|
|
||||||
|
// versioning
|
||||||
|
Versioning bool `json:"versioning,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this make bucket request
|
// Validate validates this make bucket request
|
||||||
@@ -47,6 +56,14 @@ func (m *MakeBucketRequest) Validate(formats strfmt.Registry) error {
|
|||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := m.validateQuota(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateRetention(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
if len(res) > 0 {
|
if len(res) > 0 {
|
||||||
return errors.CompositeValidationError(res...)
|
return errors.CompositeValidationError(res...)
|
||||||
}
|
}
|
||||||
@@ -62,6 +79,42 @@ func (m *MakeBucketRequest) validateName(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MakeBucketRequest) validateQuota(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Quota) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Quota != nil {
|
||||||
|
if err := m.Quota.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("quota")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MakeBucketRequest) validateRetention(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Retention) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Retention != nil {
|
||||||
|
if err := m.Retention.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("retention")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *MakeBucketRequest) MarshalBinary() ([]byte, error) {
|
func (m *MakeBucketRequest) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
|
|||||||
60
models/max_allocatable_mem_response.go
Normal file
60
models/max_allocatable_mem_response.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MaxAllocatableMemResponse max allocatable mem response
|
||||||
|
//
|
||||||
|
// swagger:model maxAllocatableMemResponse
|
||||||
|
type MaxAllocatableMemResponse struct {
|
||||||
|
|
||||||
|
// max memory
|
||||||
|
MaxMemory int64 `json:"max_memory,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this max allocatable mem response
|
||||||
|
func (m *MaxAllocatableMemResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *MaxAllocatableMemResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *MaxAllocatableMemResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res MaxAllocatableMemResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
66
models/metadata_fields.go
Normal file
66
models/metadata_fields.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) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MetadataFields metadata fields
|
||||||
|
//
|
||||||
|
// swagger:model metadataFields
|
||||||
|
type MetadataFields struct {
|
||||||
|
|
||||||
|
// annotations
|
||||||
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
|
||||||
|
// labels
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
|
||||||
|
// node selector
|
||||||
|
NodeSelector map[string]string `json:"node_selector,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this metadata fields
|
||||||
|
func (m *MetadataFields) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *MetadataFields) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *MetadataFields) UnmarshalBinary(b []byte) error {
|
||||||
|
var res MetadataFields
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
80
models/object_legal_hold_status.go
Normal file
80
models/object_legal_hold_status.go
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ObjectLegalHoldStatus object legal hold status
|
||||||
|
//
|
||||||
|
// swagger:model objectLegalHoldStatus
|
||||||
|
type ObjectLegalHoldStatus string
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// ObjectLegalHoldStatusEnabled captures enum value "enabled"
|
||||||
|
ObjectLegalHoldStatusEnabled ObjectLegalHoldStatus = "enabled"
|
||||||
|
|
||||||
|
// ObjectLegalHoldStatusDisabled captures enum value "disabled"
|
||||||
|
ObjectLegalHoldStatusDisabled ObjectLegalHoldStatus = "disabled"
|
||||||
|
)
|
||||||
|
|
||||||
|
// for schema
|
||||||
|
var objectLegalHoldStatusEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []ObjectLegalHoldStatus
|
||||||
|
if err := json.Unmarshal([]byte(`["enabled","disabled"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
objectLegalHoldStatusEnum = append(objectLegalHoldStatusEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m ObjectLegalHoldStatus) validateObjectLegalHoldStatusEnum(path, location string, value ObjectLegalHoldStatus) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, objectLegalHoldStatusEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this object legal hold status
|
||||||
|
func (m ObjectLegalHoldStatus) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateObjectLegalHoldStatusEnum("", "body", m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
80
models/object_retention_mode.go
Normal file
80
models/object_retention_mode.go
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ObjectRetentionMode object retention mode
|
||||||
|
//
|
||||||
|
// swagger:model objectRetentionMode
|
||||||
|
type ObjectRetentionMode string
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// ObjectRetentionModeGovernance captures enum value "governance"
|
||||||
|
ObjectRetentionModeGovernance ObjectRetentionMode = "governance"
|
||||||
|
|
||||||
|
// ObjectRetentionModeCompliance captures enum value "compliance"
|
||||||
|
ObjectRetentionModeCompliance ObjectRetentionMode = "compliance"
|
||||||
|
)
|
||||||
|
|
||||||
|
// for schema
|
||||||
|
var objectRetentionModeEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []ObjectRetentionMode
|
||||||
|
if err := json.Unmarshal([]byte(`["governance","compliance"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
objectRetentionModeEnum = append(objectRetentionModeEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m ObjectRetentionMode) validateObjectRetentionModeEnum(path, location string, value ObjectRetentionMode) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, objectRetentionModeEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this object retention mode
|
||||||
|
func (m ObjectRetentionMode) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateObjectRetentionModeEnum("", "body", m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
80
models/object_retention_unit.go
Normal file
80
models/object_retention_unit.go
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ObjectRetentionUnit object retention unit
|
||||||
|
//
|
||||||
|
// swagger:model objectRetentionUnit
|
||||||
|
type ObjectRetentionUnit string
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// ObjectRetentionUnitDays captures enum value "days"
|
||||||
|
ObjectRetentionUnitDays ObjectRetentionUnit = "days"
|
||||||
|
|
||||||
|
// ObjectRetentionUnitYears captures enum value "years"
|
||||||
|
ObjectRetentionUnitYears ObjectRetentionUnit = "years"
|
||||||
|
)
|
||||||
|
|
||||||
|
// for schema
|
||||||
|
var objectRetentionUnitEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []ObjectRetentionUnit
|
||||||
|
if err := json.Unmarshal([]byte(`["days","years"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
objectRetentionUnitEnum = append(objectRetentionUnitEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m ObjectRetentionUnit) validateObjectRetentionUnitEnum(path, location string, value ObjectRetentionUnit) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, objectRetentionUnitEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this object retention unit
|
||||||
|
func (m ObjectRetentionUnit) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateObjectRetentionUnitEnum("", "body", m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
37
models/parity_response.go
Normal file
37
models/parity_response.go
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ParityResponse parity response
|
||||||
|
//
|
||||||
|
// swagger:model parityResponse
|
||||||
|
type ParityResponse []string
|
||||||
|
|
||||||
|
// Validate validates this parity response
|
||||||
|
func (m ParityResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -29,13 +29,13 @@ import (
|
|||||||
"github.com/go-openapi/validate"
|
"github.com/go-openapi/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Zone zone
|
// Pool pool
|
||||||
//
|
//
|
||||||
// swagger:model zone
|
// swagger:model pool
|
||||||
type Zone struct {
|
type Pool struct {
|
||||||
|
|
||||||
// affinity
|
// affinity
|
||||||
Affinity *ZoneAffinity `json:"affinity,omitempty"`
|
Affinity *PoolAffinity `json:"affinity,omitempty"`
|
||||||
|
|
||||||
// name
|
// name
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
@@ -44,26 +44,26 @@ type Zone struct {
|
|||||||
NodeSelector map[string]string `json:"node_selector,omitempty"`
|
NodeSelector map[string]string `json:"node_selector,omitempty"`
|
||||||
|
|
||||||
// resources
|
// resources
|
||||||
Resources *ZoneResources `json:"resources,omitempty"`
|
Resources *PoolResources `json:"resources,omitempty"`
|
||||||
|
|
||||||
// servers
|
// servers
|
||||||
// Required: true
|
// Required: true
|
||||||
Servers *int64 `json:"servers"`
|
Servers *int64 `json:"servers"`
|
||||||
|
|
||||||
// tolerations
|
// tolerations
|
||||||
Tolerations ZoneTolerations `json:"tolerations,omitempty"`
|
Tolerations PoolTolerations `json:"tolerations,omitempty"`
|
||||||
|
|
||||||
// volume configuration
|
// volume configuration
|
||||||
// Required: true
|
// Required: true
|
||||||
VolumeConfiguration *ZoneVolumeConfiguration `json:"volume_configuration"`
|
VolumeConfiguration *PoolVolumeConfiguration `json:"volume_configuration"`
|
||||||
|
|
||||||
// volumes per server
|
// volumes per server
|
||||||
// Required: true
|
// Required: true
|
||||||
VolumesPerServer *int32 `json:"volumes_per_server"`
|
VolumesPerServer *int32 `json:"volumes_per_server"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone
|
// Validate validates this pool
|
||||||
func (m *Zone) Validate(formats strfmt.Registry) error {
|
func (m *Pool) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateAffinity(formats); err != nil {
|
if err := m.validateAffinity(formats); err != nil {
|
||||||
@@ -96,7 +96,7 @@ func (m *Zone) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Zone) validateAffinity(formats strfmt.Registry) error {
|
func (m *Pool) validateAffinity(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.Affinity) { // not required
|
if swag.IsZero(m.Affinity) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -114,7 +114,7 @@ func (m *Zone) validateAffinity(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Zone) validateResources(formats strfmt.Registry) error {
|
func (m *Pool) validateResources(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.Resources) { // not required
|
if swag.IsZero(m.Resources) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -132,7 +132,7 @@ func (m *Zone) validateResources(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Zone) validateServers(formats strfmt.Registry) error {
|
func (m *Pool) validateServers(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("servers", "body", m.Servers); err != nil {
|
if err := validate.Required("servers", "body", m.Servers); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -141,7 +141,7 @@ func (m *Zone) validateServers(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Zone) validateTolerations(formats strfmt.Registry) error {
|
func (m *Pool) validateTolerations(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.Tolerations) { // not required
|
if swag.IsZero(m.Tolerations) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -157,7 +157,7 @@ func (m *Zone) validateTolerations(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Zone) validateVolumeConfiguration(formats strfmt.Registry) error {
|
func (m *Pool) validateVolumeConfiguration(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("volume_configuration", "body", m.VolumeConfiguration); err != nil {
|
if err := validate.Required("volume_configuration", "body", m.VolumeConfiguration); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -175,7 +175,7 @@ func (m *Zone) validateVolumeConfiguration(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Zone) validateVolumesPerServer(formats strfmt.Registry) error {
|
func (m *Pool) validateVolumesPerServer(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("volumes_per_server", "body", m.VolumesPerServer); err != nil {
|
if err := validate.Required("volumes_per_server", "body", m.VolumesPerServer); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -185,7 +185,7 @@ func (m *Zone) validateVolumesPerServer(formats strfmt.Registry) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *Zone) MarshalBinary() ([]byte, error) {
|
func (m *Pool) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -193,8 +193,8 @@ func (m *Zone) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *Zone) UnmarshalBinary(b []byte) error {
|
func (m *Pool) UnmarshalBinary(b []byte) error {
|
||||||
var res Zone
|
var res Pool
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -202,10 +202,16 @@ func (m *Zone) UnmarshalBinary(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneVolumeConfiguration zone volume configuration
|
// PoolVolumeConfiguration pool volume configuration
|
||||||
//
|
//
|
||||||
// swagger:model ZoneVolumeConfiguration
|
// swagger:model PoolVolumeConfiguration
|
||||||
type ZoneVolumeConfiguration struct {
|
type PoolVolumeConfiguration struct {
|
||||||
|
|
||||||
|
// annotations
|
||||||
|
Annotations map[string]string `json:"annotations,omitempty"`
|
||||||
|
|
||||||
|
// labels
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
|
|
||||||
// size
|
// size
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -215,8 +221,8 @@ type ZoneVolumeConfiguration struct {
|
|||||||
StorageClassName string `json:"storage_class_name,omitempty"`
|
StorageClassName string `json:"storage_class_name,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone volume configuration
|
// Validate validates this pool volume configuration
|
||||||
func (m *ZoneVolumeConfiguration) Validate(formats strfmt.Registry) error {
|
func (m *PoolVolumeConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateSize(formats); err != nil {
|
if err := m.validateSize(formats); err != nil {
|
||||||
@@ -229,7 +235,7 @@ func (m *ZoneVolumeConfiguration) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneVolumeConfiguration) validateSize(formats strfmt.Registry) error {
|
func (m *PoolVolumeConfiguration) validateSize(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("volume_configuration"+"."+"size", "body", m.Size); err != nil {
|
if err := validate.Required("volume_configuration"+"."+"size", "body", m.Size); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -239,7 +245,7 @@ func (m *ZoneVolumeConfiguration) validateSize(formats strfmt.Registry) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneVolumeConfiguration) MarshalBinary() ([]byte, error) {
|
func (m *PoolVolumeConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -247,8 +253,8 @@ func (m *ZoneVolumeConfiguration) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneVolumeConfiguration) UnmarshalBinary(b []byte) error {
|
func (m *PoolVolumeConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneVolumeConfiguration
|
var res PoolVolumeConfiguration
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -31,23 +31,23 @@ import (
|
|||||||
"github.com/go-openapi/validate"
|
"github.com/go-openapi/validate"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ZoneAffinity If specified, affinity will define the pod's scheduling constraints
|
// PoolAffinity If specified, affinity will define the pod's scheduling constraints
|
||||||
//
|
//
|
||||||
// swagger:model zoneAffinity
|
// swagger:model poolAffinity
|
||||||
type ZoneAffinity struct {
|
type PoolAffinity struct {
|
||||||
|
|
||||||
// node affinity
|
// node affinity
|
||||||
NodeAffinity *ZoneAffinityNodeAffinity `json:"nodeAffinity,omitempty"`
|
NodeAffinity *PoolAffinityNodeAffinity `json:"nodeAffinity,omitempty"`
|
||||||
|
|
||||||
// pod affinity
|
// pod affinity
|
||||||
PodAffinity *ZoneAffinityPodAffinity `json:"podAffinity,omitempty"`
|
PodAffinity *PoolAffinityPodAffinity `json:"podAffinity,omitempty"`
|
||||||
|
|
||||||
// pod anti affinity
|
// pod anti affinity
|
||||||
PodAntiAffinity *ZoneAffinityPodAntiAffinity `json:"podAntiAffinity,omitempty"`
|
PodAntiAffinity *PoolAffinityPodAntiAffinity `json:"podAntiAffinity,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity
|
// Validate validates this pool affinity
|
||||||
func (m *ZoneAffinity) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinity) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateNodeAffinity(formats); err != nil {
|
if err := m.validateNodeAffinity(formats); err != nil {
|
||||||
@@ -68,7 +68,7 @@ func (m *ZoneAffinity) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinity) validateNodeAffinity(formats strfmt.Registry) error {
|
func (m *PoolAffinity) validateNodeAffinity(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.NodeAffinity) { // not required
|
if swag.IsZero(m.NodeAffinity) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -86,7 +86,7 @@ func (m *ZoneAffinity) validateNodeAffinity(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinity) validatePodAffinity(formats strfmt.Registry) error {
|
func (m *PoolAffinity) validatePodAffinity(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.PodAffinity) { // not required
|
if swag.IsZero(m.PodAffinity) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -104,7 +104,7 @@ func (m *ZoneAffinity) validatePodAffinity(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinity) validatePodAntiAffinity(formats strfmt.Registry) error {
|
func (m *PoolAffinity) validatePodAntiAffinity(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.PodAntiAffinity) { // not required
|
if swag.IsZero(m.PodAntiAffinity) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -123,7 +123,7 @@ func (m *ZoneAffinity) validatePodAntiAffinity(formats strfmt.Registry) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinity) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinity) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -131,8 +131,8 @@ func (m *ZoneAffinity) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinity) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinity) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinity
|
var res PoolAffinity
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -140,20 +140,20 @@ func (m *ZoneAffinity) UnmarshalBinary(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneAffinityNodeAffinity Describes node affinity scheduling rules for the pod.
|
// PoolAffinityNodeAffinity Describes node affinity scheduling rules for the pod.
|
||||||
//
|
//
|
||||||
// swagger:model ZoneAffinityNodeAffinity
|
// swagger:model PoolAffinityNodeAffinity
|
||||||
type ZoneAffinityNodeAffinity struct {
|
type PoolAffinityNodeAffinity struct {
|
||||||
|
|
||||||
// The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.
|
// The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.
|
||||||
PreferredDuringSchedulingIgnoredDuringExecution []*ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 `json:"preferredDuringSchedulingIgnoredDuringExecution"`
|
PreferredDuringSchedulingIgnoredDuringExecution []*PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 `json:"preferredDuringSchedulingIgnoredDuringExecution"`
|
||||||
|
|
||||||
// required during scheduling ignored during execution
|
// required during scheduling ignored during execution
|
||||||
RequiredDuringSchedulingIgnoredDuringExecution *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
|
RequiredDuringSchedulingIgnoredDuringExecution *PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity node affinity
|
// Validate validates this pool affinity node affinity
|
||||||
func (m *ZoneAffinityNodeAffinity) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinity) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validatePreferredDuringSchedulingIgnoredDuringExecution(formats); err != nil {
|
if err := m.validatePreferredDuringSchedulingIgnoredDuringExecution(formats); err != nil {
|
||||||
@@ -170,7 +170,7 @@ func (m *ZoneAffinityNodeAffinity) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityNodeAffinity) validatePreferredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinity) validatePreferredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.PreferredDuringSchedulingIgnoredDuringExecution) { // not required
|
if swag.IsZero(m.PreferredDuringSchedulingIgnoredDuringExecution) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -195,7 +195,7 @@ func (m *ZoneAffinityNodeAffinity) validatePreferredDuringSchedulingIgnoredDurin
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityNodeAffinity) validateRequiredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinity) validateRequiredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.RequiredDuringSchedulingIgnoredDuringExecution) { // not required
|
if swag.IsZero(m.RequiredDuringSchedulingIgnoredDuringExecution) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -214,7 +214,7 @@ func (m *ZoneAffinityNodeAffinity) validateRequiredDuringSchedulingIgnoredDuring
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityNodeAffinity) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinityNodeAffinity) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -222,8 +222,8 @@ func (m *ZoneAffinityNodeAffinity) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityNodeAffinity) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinityNodeAffinity) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinityNodeAffinity
|
var res PoolAffinityNodeAffinity
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -231,10 +231,10 @@ func (m *ZoneAffinityNodeAffinity) UnmarshalBinary(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
|
// PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
|
||||||
//
|
//
|
||||||
// swagger:model ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
// swagger:model PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
||||||
type ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 struct {
|
type PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 struct {
|
||||||
|
|
||||||
// A node selector term, associated with the corresponding weight.
|
// A node selector term, associated with the corresponding weight.
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -245,8 +245,8 @@ type ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItem
|
|||||||
Weight *int32 `json:"weight"`
|
Weight *int32 `json:"weight"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity node affinity preferred during scheduling ignored during execution items0
|
// Validate validates this pool affinity node affinity preferred during scheduling ignored during execution items0
|
||||||
func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validatePreference(formats); err != nil {
|
if err := m.validatePreference(formats); err != nil {
|
||||||
@@ -263,7 +263,7 @@ func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validatePreference(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validatePreference(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("preference", "body", m.Preference); err != nil {
|
if err := validate.Required("preference", "body", m.Preference); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -281,7 +281,7 @@ func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validateWeight(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validateWeight(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("weight", "body", m.Weight); err != nil {
|
if err := validate.Required("weight", "body", m.Weight); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -291,7 +291,7 @@ func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -299,8 +299,8 @@ func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
var res PoolAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -308,18 +308,18 @@ func (m *ZoneAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.
|
// PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.
|
||||||
//
|
//
|
||||||
// swagger:model ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution
|
// swagger:model PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution
|
||||||
type ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution struct {
|
type PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution struct {
|
||||||
|
|
||||||
// Required. A list of node selector terms. The terms are ORed.
|
// Required. A list of node selector terms. The terms are ORed.
|
||||||
// Required: true
|
// Required: true
|
||||||
NodeSelectorTerms []*NodeSelectorTerm `json:"nodeSelectorTerms"`
|
NodeSelectorTerms []*NodeSelectorTerm `json:"nodeSelectorTerms"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity node affinity required during scheduling ignored during execution
|
// Validate validates this pool affinity node affinity required during scheduling ignored during execution
|
||||||
func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateNodeSelectorTerms(formats); err != nil {
|
if err := m.validateNodeSelectorTerms(formats); err != nil {
|
||||||
@@ -332,7 +332,7 @@ func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) validateNodeSelectorTerms(formats strfmt.Registry) error {
|
func (m *PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) validateNodeSelectorTerms(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("nodeAffinity"+"."+"requiredDuringSchedulingIgnoredDuringExecution"+"."+"nodeSelectorTerms", "body", m.NodeSelectorTerms); err != nil {
|
if err := validate.Required("nodeAffinity"+"."+"requiredDuringSchedulingIgnoredDuringExecution"+"."+"nodeSelectorTerms", "body", m.NodeSelectorTerms); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -358,7 +358,7 @@ func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -366,8 +366,8 @@ func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution
|
var res PoolAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -375,20 +375,20 @@ func (m *ZoneAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneAffinityPodAffinity Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
|
// PoolAffinityPodAffinity Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, pool, etc. as some other pod(s)).
|
||||||
//
|
//
|
||||||
// swagger:model ZoneAffinityPodAffinity
|
// swagger:model PoolAffinityPodAffinity
|
||||||
type ZoneAffinityPodAffinity struct {
|
type PoolAffinityPodAffinity struct {
|
||||||
|
|
||||||
// The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
|
// The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
|
||||||
PreferredDuringSchedulingIgnoredDuringExecution []*ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 `json:"preferredDuringSchedulingIgnoredDuringExecution"`
|
PreferredDuringSchedulingIgnoredDuringExecution []*PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 `json:"preferredDuringSchedulingIgnoredDuringExecution"`
|
||||||
|
|
||||||
// If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
|
// If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
|
||||||
RequiredDuringSchedulingIgnoredDuringExecution []*PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution"`
|
RequiredDuringSchedulingIgnoredDuringExecution []*PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity pod affinity
|
// Validate validates this pool affinity pod affinity
|
||||||
func (m *ZoneAffinityPodAffinity) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAffinity) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validatePreferredDuringSchedulingIgnoredDuringExecution(formats); err != nil {
|
if err := m.validatePreferredDuringSchedulingIgnoredDuringExecution(formats); err != nil {
|
||||||
@@ -405,7 +405,7 @@ func (m *ZoneAffinityPodAffinity) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAffinity) validatePreferredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAffinity) validatePreferredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.PreferredDuringSchedulingIgnoredDuringExecution) { // not required
|
if swag.IsZero(m.PreferredDuringSchedulingIgnoredDuringExecution) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -430,7 +430,7 @@ func (m *ZoneAffinityPodAffinity) validatePreferredDuringSchedulingIgnoredDuring
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAffinity) validateRequiredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAffinity) validateRequiredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.RequiredDuringSchedulingIgnoredDuringExecution) { // not required
|
if swag.IsZero(m.RequiredDuringSchedulingIgnoredDuringExecution) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -456,7 +456,7 @@ func (m *ZoneAffinityPodAffinity) validateRequiredDuringSchedulingIgnoredDuringE
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAffinity) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinityPodAffinity) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -464,8 +464,8 @@ func (m *ZoneAffinityPodAffinity) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAffinity) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinityPodAffinity) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinityPodAffinity
|
var res PoolAffinityPodAffinity
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -473,10 +473,10 @@ func (m *ZoneAffinityPodAffinity) UnmarshalBinary(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
|
// PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
|
||||||
//
|
//
|
||||||
// swagger:model ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
// swagger:model PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
||||||
type ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 struct {
|
type PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 struct {
|
||||||
|
|
||||||
// pod affinity term
|
// pod affinity term
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -487,8 +487,8 @@ type ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems
|
|||||||
Weight *int32 `json:"weight"`
|
Weight *int32 `json:"weight"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity pod affinity preferred during scheduling ignored during execution items0
|
// Validate validates this pool affinity pod affinity preferred during scheduling ignored during execution items0
|
||||||
func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validatePodAffinityTerm(formats); err != nil {
|
if err := m.validatePodAffinityTerm(formats); err != nil {
|
||||||
@@ -505,7 +505,7 @@ func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionI
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validatePodAffinityTerm(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validatePodAffinityTerm(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("podAffinityTerm", "body", m.PodAffinityTerm); err != nil {
|
if err := validate.Required("podAffinityTerm", "body", m.PodAffinityTerm); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -523,7 +523,7 @@ func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionI
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validateWeight(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validateWeight(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("weight", "body", m.Weight); err != nil {
|
if err := validate.Required("weight", "body", m.Weight); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -533,7 +533,7 @@ func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -541,8 +541,8 @@ func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
var res PoolAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -550,20 +550,20 @@ func (m *ZoneAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionI
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneAffinityPodAntiAffinity Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
|
// PoolAffinityPodAntiAffinity Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, pool, etc. as some other pod(s)).
|
||||||
//
|
//
|
||||||
// swagger:model ZoneAffinityPodAntiAffinity
|
// swagger:model PoolAffinityPodAntiAffinity
|
||||||
type ZoneAffinityPodAntiAffinity struct {
|
type PoolAffinityPodAntiAffinity struct {
|
||||||
|
|
||||||
// The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
|
// The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.
|
||||||
PreferredDuringSchedulingIgnoredDuringExecution []*ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 `json:"preferredDuringSchedulingIgnoredDuringExecution"`
|
PreferredDuringSchedulingIgnoredDuringExecution []*PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 `json:"preferredDuringSchedulingIgnoredDuringExecution"`
|
||||||
|
|
||||||
// If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
|
// If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.
|
||||||
RequiredDuringSchedulingIgnoredDuringExecution []*PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution"`
|
RequiredDuringSchedulingIgnoredDuringExecution []*PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity pod anti affinity
|
// Validate validates this pool affinity pod anti affinity
|
||||||
func (m *ZoneAffinityPodAntiAffinity) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAntiAffinity) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validatePreferredDuringSchedulingIgnoredDuringExecution(formats); err != nil {
|
if err := m.validatePreferredDuringSchedulingIgnoredDuringExecution(formats); err != nil {
|
||||||
@@ -580,7 +580,7 @@ func (m *ZoneAffinityPodAntiAffinity) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAntiAffinity) validatePreferredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAntiAffinity) validatePreferredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.PreferredDuringSchedulingIgnoredDuringExecution) { // not required
|
if swag.IsZero(m.PreferredDuringSchedulingIgnoredDuringExecution) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -605,7 +605,7 @@ func (m *ZoneAffinityPodAntiAffinity) validatePreferredDuringSchedulingIgnoredDu
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAntiAffinity) validateRequiredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAntiAffinity) validateRequiredDuringSchedulingIgnoredDuringExecution(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.RequiredDuringSchedulingIgnoredDuringExecution) { // not required
|
if swag.IsZero(m.RequiredDuringSchedulingIgnoredDuringExecution) { // not required
|
||||||
return nil
|
return nil
|
||||||
@@ -631,7 +631,7 @@ func (m *ZoneAffinityPodAntiAffinity) validateRequiredDuringSchedulingIgnoredDur
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAntiAffinity) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinityPodAntiAffinity) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -639,8 +639,8 @@ func (m *ZoneAffinityPodAntiAffinity) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAntiAffinity) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinityPodAntiAffinity) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinityPodAntiAffinity
|
var res PoolAffinityPodAntiAffinity
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -648,10 +648,10 @@ func (m *ZoneAffinityPodAntiAffinity) UnmarshalBinary(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
|
// PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
|
||||||
//
|
//
|
||||||
// swagger:model ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
// swagger:model PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
||||||
type ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 struct {
|
type PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0 struct {
|
||||||
|
|
||||||
// pod affinity term
|
// pod affinity term
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -662,8 +662,8 @@ type ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionI
|
|||||||
Weight *int32 `json:"weight"`
|
Weight *int32 `json:"weight"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone affinity pod anti affinity preferred during scheduling ignored during execution items0
|
// Validate validates this pool affinity pod anti affinity preferred during scheduling ignored during execution items0
|
||||||
func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) Validate(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validatePodAffinityTerm(formats); err != nil {
|
if err := m.validatePodAffinityTerm(formats); err != nil {
|
||||||
@@ -680,7 +680,7 @@ func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecut
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validatePodAffinityTerm(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validatePodAffinityTerm(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("podAffinityTerm", "body", m.PodAffinityTerm); err != nil {
|
if err := validate.Required("podAffinityTerm", "body", m.PodAffinityTerm); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -698,7 +698,7 @@ func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecut
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validateWeight(formats strfmt.Registry) error {
|
func (m *PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) validateWeight(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if err := validate.Required("weight", "body", m.Weight); err != nil {
|
if err := validate.Required("weight", "body", m.Weight); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -708,7 +708,7 @@ func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecut
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) MarshalBinary() ([]byte, error) {
|
func (m *PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -716,8 +716,8 @@ func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecut
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) UnmarshalBinary(b []byte) error {
|
func (m *PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
var res PoolAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionItems0
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -27,10 +27,10 @@ import (
|
|||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ZoneResources If provided, use these requests and limit for cpu/memory resource allocation
|
// PoolResources If provided, use these requests and limit for cpu/memory resource allocation
|
||||||
//
|
//
|
||||||
// swagger:model zoneResources
|
// swagger:model poolResources
|
||||||
type ZoneResources struct {
|
type PoolResources struct {
|
||||||
|
|
||||||
// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
|
||||||
Limits map[string]int64 `json:"limits,omitempty"`
|
Limits map[string]int64 `json:"limits,omitempty"`
|
||||||
@@ -39,13 +39,13 @@ type ZoneResources struct {
|
|||||||
Requests map[string]int64 `json:"requests,omitempty"`
|
Requests map[string]int64 `json:"requests,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone resources
|
// Validate validates this pool resources
|
||||||
func (m *ZoneResources) Validate(formats strfmt.Registry) error {
|
func (m *PoolResources) Validate(formats strfmt.Registry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneResources) MarshalBinary() ([]byte, error) {
|
func (m *PoolResources) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -53,8 +53,8 @@ func (m *ZoneResources) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneResources) UnmarshalBinary(b []byte) error {
|
func (m *PoolResources) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneResources
|
var res PoolResources
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
81
models/pool_toleration_seconds.go
Normal file
81
models/pool_toleration_seconds.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) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PoolTolerationSeconds TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.
|
||||||
|
//
|
||||||
|
// swagger:model poolTolerationSeconds
|
||||||
|
type PoolTolerationSeconds struct {
|
||||||
|
|
||||||
|
// seconds
|
||||||
|
// Required: true
|
||||||
|
Seconds *int64 `json:"seconds"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this pool toleration seconds
|
||||||
|
func (m *PoolTolerationSeconds) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateSeconds(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PoolTolerationSeconds) validateSeconds(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("seconds", "body", m.Seconds); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *PoolTolerationSeconds) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *PoolTolerationSeconds) UnmarshalBinary(b []byte) error {
|
||||||
|
var res PoolTolerationSeconds
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -30,13 +30,13 @@ import (
|
|||||||
"github.com/go-openapi/swag"
|
"github.com/go-openapi/swag"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ZoneTolerations Tolerations allows users to set entries like effect, key, operator, value.
|
// PoolTolerations Tolerations allows users to set entries like effect, key, operator, value.
|
||||||
//
|
//
|
||||||
// swagger:model zoneTolerations
|
// swagger:model poolTolerations
|
||||||
type ZoneTolerations []*ZoneTolerationsItems0
|
type PoolTolerations []*PoolTolerationsItems0
|
||||||
|
|
||||||
// Validate validates this zone tolerations
|
// Validate validates this pool tolerations
|
||||||
func (m ZoneTolerations) Validate(formats strfmt.Registry) error {
|
func (m PoolTolerations) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
for i := 0; i < len(m); i++ {
|
for i := 0; i < len(m); i++ {
|
||||||
@@ -61,10 +61,10 @@ func (m ZoneTolerations) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneTolerationsItems0 The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.
|
// PoolTolerationsItems0 The pod this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.
|
||||||
//
|
//
|
||||||
// swagger:model ZoneTolerationsItems0
|
// swagger:model PoolTolerationsItems0
|
||||||
type ZoneTolerationsItems0 struct {
|
type PoolTolerationsItems0 struct {
|
||||||
|
|
||||||
// Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
|
// Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
|
||||||
Effect string `json:"effect,omitempty"`
|
Effect string `json:"effect,omitempty"`
|
||||||
@@ -75,20 +75,47 @@ type ZoneTolerationsItems0 struct {
|
|||||||
// Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
|
// Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.
|
||||||
Operator string `json:"operator,omitempty"`
|
Operator string `json:"operator,omitempty"`
|
||||||
|
|
||||||
// TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.
|
// toleration seconds
|
||||||
TolerationSeconds int64 `json:"tolerationSeconds,omitempty"`
|
TolerationSeconds *PoolTolerationSeconds `json:"tolerationSeconds,omitempty"`
|
||||||
|
|
||||||
// Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
|
// Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.
|
||||||
Value string `json:"value,omitempty"`
|
Value string `json:"value,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this zone tolerations items0
|
// Validate validates this pool tolerations items0
|
||||||
func (m *ZoneTolerationsItems0) Validate(formats strfmt.Registry) error {
|
func (m *PoolTolerationsItems0) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateTolerationSeconds(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PoolTolerationsItems0) validateTolerationSeconds(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.TolerationSeconds) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.TolerationSeconds != nil {
|
||||||
|
if err := m.TolerationSeconds.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("tolerationSeconds")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *ZoneTolerationsItems0) MarshalBinary() ([]byte, error) {
|
func (m *PoolTolerationsItems0) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -96,8 +123,8 @@ func (m *ZoneTolerationsItems0) MarshalBinary() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalBinary interface implementation
|
// UnmarshalBinary interface implementation
|
||||||
func (m *ZoneTolerationsItems0) UnmarshalBinary(b []byte) error {
|
func (m *PoolTolerationsItems0) UnmarshalBinary(b []byte) error {
|
||||||
var res ZoneTolerationsItems0
|
var res PoolTolerationsItems0
|
||||||
if err := swag.ReadJSON(b, &res); err != nil {
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
99
models/pool_update_request.go
Normal file
99
models/pool_update_request.go
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PoolUpdateRequest pool update request
|
||||||
|
//
|
||||||
|
// swagger:model poolUpdateRequest
|
||||||
|
type PoolUpdateRequest struct {
|
||||||
|
|
||||||
|
// pools
|
||||||
|
// Required: true
|
||||||
|
Pools []*Pool `json:"pools"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this pool update request
|
||||||
|
func (m *PoolUpdateRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validatePools(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PoolUpdateRequest) validatePools(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("pools", "body", m.Pools); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Pools); i++ {
|
||||||
|
if swag.IsZero(m.Pools[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Pools[i] != nil {
|
||||||
|
if err := m.Pools[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("pools" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *PoolUpdateRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *PoolUpdateRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res PoolUpdateRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -32,17 +32,23 @@ import (
|
|||||||
// swagger:model principal
|
// swagger:model principal
|
||||||
type Principal struct {
|
type Principal struct {
|
||||||
|
|
||||||
// access key ID
|
// s t s access key ID
|
||||||
AccessKeyID string `json:"accessKeyID,omitempty"`
|
STSAccessKeyID string `json:"STSAccessKeyID,omitempty"`
|
||||||
|
|
||||||
|
// s t s secret access key
|
||||||
|
STSSecretAccessKey string `json:"STSSecretAccessKey,omitempty"`
|
||||||
|
|
||||||
|
// s t s session token
|
||||||
|
STSSessionToken string `json:"STSSessionToken,omitempty"`
|
||||||
|
|
||||||
|
// account access key
|
||||||
|
AccountAccessKey string `json:"accountAccessKey,omitempty"`
|
||||||
|
|
||||||
|
// account secret key
|
||||||
|
AccountSecretKey string `json:"accountSecretKey,omitempty"`
|
||||||
|
|
||||||
// actions
|
// actions
|
||||||
Actions []string `json:"actions"`
|
Actions []string `json:"actions"`
|
||||||
|
|
||||||
// secret access key
|
|
||||||
SecretAccessKey string `json:"secretAccessKey,omitempty"`
|
|
||||||
|
|
||||||
// session token
|
|
||||||
SessionToken string `json:"sessionToken,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this principal
|
// Validate validates this principal
|
||||||
|
|||||||
121
models/put_bucket_retention_request.go
Normal file
121
models/put_bucket_retention_request.go
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PutBucketRetentionRequest put bucket retention request
|
||||||
|
//
|
||||||
|
// swagger:model putBucketRetentionRequest
|
||||||
|
type PutBucketRetentionRequest struct {
|
||||||
|
|
||||||
|
// mode
|
||||||
|
// Required: true
|
||||||
|
Mode ObjectRetentionMode `json:"mode"`
|
||||||
|
|
||||||
|
// unit
|
||||||
|
// Required: true
|
||||||
|
Unit ObjectRetentionUnit `json:"unit"`
|
||||||
|
|
||||||
|
// validity
|
||||||
|
// Required: true
|
||||||
|
Validity *int32 `json:"validity"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this put bucket retention request
|
||||||
|
func (m *PutBucketRetentionRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateMode(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateUnit(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateValidity(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PutBucketRetentionRequest) validateMode(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := m.Mode.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("mode")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PutBucketRetentionRequest) validateUnit(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := m.Unit.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("unit")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PutBucketRetentionRequest) validateValidity(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("validity", "body", m.Validity); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *PutBucketRetentionRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *PutBucketRetentionRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res PutBucketRetentionRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
83
models/put_object_legal_hold_request.go
Normal file
83
models/put_object_legal_hold_request.go
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PutObjectLegalHoldRequest put object legal hold request
|
||||||
|
//
|
||||||
|
// swagger:model putObjectLegalHoldRequest
|
||||||
|
type PutObjectLegalHoldRequest struct {
|
||||||
|
|
||||||
|
// status
|
||||||
|
// Required: true
|
||||||
|
Status ObjectLegalHoldStatus `json:"status"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this put object legal hold request
|
||||||
|
func (m *PutObjectLegalHoldRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateStatus(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PutObjectLegalHoldRequest) validateStatus(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := m.Status.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("status")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *PutObjectLegalHoldRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *PutObjectLegalHoldRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res PutObjectLegalHoldRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
104
models/put_object_retention_request.go
Normal file
104
models/put_object_retention_request.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) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PutObjectRetentionRequest put object retention request
|
||||||
|
//
|
||||||
|
// swagger:model putObjectRetentionRequest
|
||||||
|
type PutObjectRetentionRequest struct {
|
||||||
|
|
||||||
|
// expires
|
||||||
|
// Required: true
|
||||||
|
Expires *string `json:"expires"`
|
||||||
|
|
||||||
|
// governance bypass
|
||||||
|
GovernanceBypass bool `json:"governance_bypass,omitempty"`
|
||||||
|
|
||||||
|
// mode
|
||||||
|
// Required: true
|
||||||
|
Mode ObjectRetentionMode `json:"mode"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this put object retention request
|
||||||
|
func (m *PutObjectRetentionRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateExpires(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateMode(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PutObjectRetentionRequest) validateExpires(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("expires", "body", m.Expires); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *PutObjectRetentionRequest) validateMode(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := m.Mode.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("mode")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *PutObjectRetentionRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *PutObjectRetentionRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res PutObjectRetentionRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
60
models/put_object_tags_request.go
Normal file
60
models/put_object_tags_request.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PutObjectTagsRequest put object tags request
|
||||||
|
//
|
||||||
|
// swagger:model putObjectTagsRequest
|
||||||
|
type PutObjectTagsRequest struct {
|
||||||
|
|
||||||
|
// tags
|
||||||
|
Tags map[string]string `json:"tags,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this put object tags request
|
||||||
|
func (m *PutObjectTagsRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *PutObjectTagsRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *PutObjectTagsRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res PutObjectTagsRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
200
models/remote_bucket.go
Normal file
200
models/remote_bucket.go
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RemoteBucket remote bucket
|
||||||
|
//
|
||||||
|
// swagger:model remoteBucket
|
||||||
|
type RemoteBucket struct {
|
||||||
|
|
||||||
|
// access key
|
||||||
|
// Required: true
|
||||||
|
// Min Length: 3
|
||||||
|
AccessKey *string `json:"accessKey"`
|
||||||
|
|
||||||
|
// remote a r n
|
||||||
|
// Required: true
|
||||||
|
RemoteARN *string `json:"remoteARN"`
|
||||||
|
|
||||||
|
// secret key
|
||||||
|
// Min Length: 8
|
||||||
|
SecretKey string `json:"secretKey,omitempty"`
|
||||||
|
|
||||||
|
// service
|
||||||
|
// Enum: [replication]
|
||||||
|
Service string `json:"service,omitempty"`
|
||||||
|
|
||||||
|
// source bucket
|
||||||
|
// Required: true
|
||||||
|
SourceBucket *string `json:"sourceBucket"`
|
||||||
|
|
||||||
|
// status
|
||||||
|
Status string `json:"status,omitempty"`
|
||||||
|
|
||||||
|
// target bucket
|
||||||
|
TargetBucket string `json:"targetBucket,omitempty"`
|
||||||
|
|
||||||
|
// target URL
|
||||||
|
TargetURL string `json:"targetURL,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this remote bucket
|
||||||
|
func (m *RemoteBucket) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateAccessKey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateRemoteARN(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSecretKey(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateService(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSourceBucket(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *RemoteBucket) validateAccessKey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("accessKey", "body", m.AccessKey); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.MinLength("accessKey", "body", string(*m.AccessKey), 3); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *RemoteBucket) validateRemoteARN(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("remoteARN", "body", m.RemoteARN); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *RemoteBucket) validateSecretKey(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.SecretKey) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.MinLength("secretKey", "body", string(m.SecretKey), 8); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var remoteBucketTypeServicePropEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []string
|
||||||
|
if err := json.Unmarshal([]byte(`["replication"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
remoteBucketTypeServicePropEnum = append(remoteBucketTypeServicePropEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// RemoteBucketServiceReplication captures enum value "replication"
|
||||||
|
RemoteBucketServiceReplication string = "replication"
|
||||||
|
)
|
||||||
|
|
||||||
|
// prop value enum
|
||||||
|
func (m *RemoteBucket) validateServiceEnum(path, location string, value string) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, remoteBucketTypeServicePropEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *RemoteBucket) validateService(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Service) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateServiceEnum("service", "body", m.Service); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *RemoteBucket) validateSourceBucket(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("sourceBucket", "body", m.SourceBucket); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *RemoteBucket) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *RemoteBucket) UnmarshalBinary(b []byte) error {
|
||||||
|
var res RemoteBucket
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
103
models/result_target.go
Normal file
103
models/result_target.go
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ResultTarget result target
|
||||||
|
//
|
||||||
|
// swagger:model resultTarget
|
||||||
|
type ResultTarget struct {
|
||||||
|
|
||||||
|
// legend format
|
||||||
|
LegendFormat string `json:"legendFormat,omitempty"`
|
||||||
|
|
||||||
|
// result
|
||||||
|
Result []*WidgetResult `json:"result"`
|
||||||
|
|
||||||
|
// result type
|
||||||
|
ResultType string `json:"resultType,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this result target
|
||||||
|
func (m *ResultTarget) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateResult(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *ResultTarget) validateResult(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Result) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Result); i++ {
|
||||||
|
if swag.IsZero(m.Result[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Result[i] != nil {
|
||||||
|
if err := m.Result[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("result" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *ResultTarget) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *ResultTarget) UnmarshalBinary(b []byte) error {
|
||||||
|
var res ResultTarget
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -36,6 +36,9 @@ import (
|
|||||||
// swagger:model sessionResponse
|
// swagger:model sessionResponse
|
||||||
type SessionResponse struct {
|
type SessionResponse struct {
|
||||||
|
|
||||||
|
// operator
|
||||||
|
Operator bool `json:"operator,omitempty"`
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
Pages []string `json:"pages"`
|
Pages []string `json:"pages"`
|
||||||
|
|
||||||
|
|||||||
137
models/set_bucket_quota.go
Normal file
137
models/set_bucket_quota.go
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetBucketQuota set bucket quota
|
||||||
|
//
|
||||||
|
// swagger:model setBucketQuota
|
||||||
|
type SetBucketQuota struct {
|
||||||
|
|
||||||
|
// amount
|
||||||
|
Amount int64 `json:"amount,omitempty"`
|
||||||
|
|
||||||
|
// enabled
|
||||||
|
// Required: true
|
||||||
|
Enabled *bool `json:"enabled"`
|
||||||
|
|
||||||
|
// quota type
|
||||||
|
// Enum: [fifo hard]
|
||||||
|
QuotaType string `json:"quota_type,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this set bucket quota
|
||||||
|
func (m *SetBucketQuota) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateEnabled(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateQuotaType(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SetBucketQuota) validateEnabled(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("enabled", "body", m.Enabled); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var setBucketQuotaTypeQuotaTypePropEnum []interface{}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
var res []string
|
||||||
|
if err := json.Unmarshal([]byte(`["fifo","hard"]`), &res); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
for _, v := range res {
|
||||||
|
setBucketQuotaTypeQuotaTypePropEnum = append(setBucketQuotaTypeQuotaTypePropEnum, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
|
||||||
|
// SetBucketQuotaQuotaTypeFifo captures enum value "fifo"
|
||||||
|
SetBucketQuotaQuotaTypeFifo string = "fifo"
|
||||||
|
|
||||||
|
// SetBucketQuotaQuotaTypeHard captures enum value "hard"
|
||||||
|
SetBucketQuotaQuotaTypeHard string = "hard"
|
||||||
|
)
|
||||||
|
|
||||||
|
// prop value enum
|
||||||
|
func (m *SetBucketQuota) validateQuotaTypeEnum(path, location string, value string) error {
|
||||||
|
if err := validate.EnumCase(path, location, value, setBucketQuotaTypeQuotaTypePropEnum, true); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SetBucketQuota) validateQuotaType(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.QuotaType) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// value enum
|
||||||
|
if err := m.validateQuotaTypeEnum("quota_type", "body", m.QuotaType); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *SetBucketQuota) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *SetBucketQuota) UnmarshalBinary(b []byte) error {
|
||||||
|
var res SetBucketQuota
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
60
models/set_bucket_versioning.go
Normal file
60
models/set_bucket_versioning.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetBucketVersioning set bucket versioning
|
||||||
|
//
|
||||||
|
// swagger:model setBucketVersioning
|
||||||
|
type SetBucketVersioning struct {
|
||||||
|
|
||||||
|
// versioning
|
||||||
|
Versioning bool `json:"versioning,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this set bucket versioning
|
||||||
|
func (m *SetBucketVersioning) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *SetBucketVersioning) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *SetBucketVersioning) UnmarshalBinary(b []byte) error {
|
||||||
|
var res SetBucketVersioning
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
60
models/set_config_response.go
Normal file
60
models/set_config_response.go
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetConfigResponse set config response
|
||||||
|
//
|
||||||
|
// swagger:model setConfigResponse
|
||||||
|
type SetConfigResponse struct {
|
||||||
|
|
||||||
|
// Returns wheter server needs to restart to apply changes or not
|
||||||
|
Restart bool `json:"restart,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this set config response
|
||||||
|
func (m *SetConfigResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *SetConfigResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *SetConfigResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res SetConfigResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
117
models/set_notification_endpoint_response.go
Normal file
117
models/set_notification_endpoint_response.go
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetNotificationEndpointResponse set notification endpoint response
|
||||||
|
//
|
||||||
|
// swagger:model setNotificationEndpointResponse
|
||||||
|
type SetNotificationEndpointResponse struct {
|
||||||
|
|
||||||
|
// account id
|
||||||
|
// Required: true
|
||||||
|
AccountID *string `json:"account_id"`
|
||||||
|
|
||||||
|
// properties
|
||||||
|
// Required: true
|
||||||
|
Properties map[string]string `json:"properties"`
|
||||||
|
|
||||||
|
// restart
|
||||||
|
Restart bool `json:"restart,omitempty"`
|
||||||
|
|
||||||
|
// service
|
||||||
|
// Required: true
|
||||||
|
Service NofiticationService `json:"service"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this set notification endpoint response
|
||||||
|
func (m *SetNotificationEndpointResponse) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateAccountID(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateProperties(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateService(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SetNotificationEndpointResponse) validateAccountID(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("account_id", "body", m.AccountID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SetNotificationEndpointResponse) validateProperties(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SetNotificationEndpointResponse) validateService(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := m.Service.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("service")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *SetNotificationEndpointResponse) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *SetNotificationEndpointResponse) UnmarshalBinary(b []byte) error {
|
||||||
|
var res SetNotificationEndpointResponse
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
119
models/set_policy_multiple_request.go
Normal file
119
models/set_policy_multiple_request.go
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetPolicyMultipleRequest set policy multiple request
|
||||||
|
//
|
||||||
|
// swagger:model setPolicyMultipleRequest
|
||||||
|
type SetPolicyMultipleRequest struct {
|
||||||
|
|
||||||
|
// groups
|
||||||
|
Groups []IamEntity `json:"groups"`
|
||||||
|
|
||||||
|
// users
|
||||||
|
Users []IamEntity `json:"users"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this set policy multiple request
|
||||||
|
func (m *SetPolicyMultipleRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateGroups(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateUsers(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SetPolicyMultipleRequest) validateGroups(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Groups) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Groups); i++ {
|
||||||
|
|
||||||
|
if err := m.Groups[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("groups" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SetPolicyMultipleRequest) validateUsers(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Users) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Users); i++ {
|
||||||
|
|
||||||
|
if err := m.Users[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("users" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *SetPolicyMultipleRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *SetPolicyMultipleRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res SetPolicyMultipleRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
66
models/subscription_validate_request.go
Normal file
66
models/subscription_validate_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) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SubscriptionValidateRequest subscription validate request
|
||||||
|
//
|
||||||
|
// swagger:model subscriptionValidateRequest
|
||||||
|
type SubscriptionValidateRequest struct {
|
||||||
|
|
||||||
|
// email
|
||||||
|
Email string `json:"email,omitempty"`
|
||||||
|
|
||||||
|
// license
|
||||||
|
License string `json:"license,omitempty"`
|
||||||
|
|
||||||
|
// password
|
||||||
|
Password string `json:"password,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this subscription validate request
|
||||||
|
func (m *SubscriptionValidateRequest) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *SubscriptionValidateRequest) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *SubscriptionValidateRequest) UnmarshalBinary(b []byte) error {
|
||||||
|
var res SubscriptionValidateRequest
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
116
models/tenant.go
116
models/tenant.go
@@ -35,12 +35,24 @@ import (
|
|||||||
// swagger:model tenant
|
// swagger:model tenant
|
||||||
type Tenant struct {
|
type Tenant struct {
|
||||||
|
|
||||||
|
// console image
|
||||||
|
ConsoleImage string `json:"console_image,omitempty"`
|
||||||
|
|
||||||
// creation date
|
// creation date
|
||||||
CreationDate string `json:"creation_date,omitempty"`
|
CreationDate string `json:"creation_date,omitempty"`
|
||||||
|
|
||||||
// current state
|
// current state
|
||||||
CurrentState string `json:"currentState,omitempty"`
|
CurrentState string `json:"currentState,omitempty"`
|
||||||
|
|
||||||
|
// deletion date
|
||||||
|
DeletionDate string `json:"deletion_date,omitempty"`
|
||||||
|
|
||||||
|
// enable prometheus
|
||||||
|
EnablePrometheus bool `json:"enable_prometheus,omitempty"`
|
||||||
|
|
||||||
|
// endpoints
|
||||||
|
Endpoints *TenantEndpoints `json:"endpoints,omitempty"`
|
||||||
|
|
||||||
// image
|
// image
|
||||||
Image string `json:"image,omitempty"`
|
Image string `json:"image,omitempty"`
|
||||||
|
|
||||||
@@ -50,18 +62,29 @@ type Tenant struct {
|
|||||||
// namespace
|
// namespace
|
||||||
Namespace string `json:"namespace,omitempty"`
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
|
||||||
|
// pools
|
||||||
|
Pools []*Pool `json:"pools"`
|
||||||
|
|
||||||
|
// subnet license
|
||||||
|
SubnetLicense *License `json:"subnet_license,omitempty"`
|
||||||
|
|
||||||
// total size
|
// total size
|
||||||
TotalSize int64 `json:"total_size,omitempty"`
|
TotalSize int64 `json:"total_size,omitempty"`
|
||||||
|
|
||||||
// zones
|
|
||||||
Zones []*Zone `json:"zones"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this tenant
|
// Validate validates this tenant
|
||||||
func (m *Tenant) Validate(formats strfmt.Registry) error {
|
func (m *Tenant) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
if err := m.validateZones(formats); err != nil {
|
if err := m.validateEndpoints(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validatePools(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSubnetLicense(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,21 +94,39 @@ func (m *Tenant) Validate(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Tenant) validateZones(formats strfmt.Registry) error {
|
func (m *Tenant) validateEndpoints(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.Zones) { // not required
|
if swag.IsZero(m.Endpoints) { // not required
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(m.Zones); i++ {
|
if m.Endpoints != nil {
|
||||||
if swag.IsZero(m.Zones[i]) { // not required
|
if err := m.Endpoints.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("endpoints")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Tenant) validatePools(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Pools) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Pools); i++ {
|
||||||
|
if swag.IsZero(m.Pools[i]) { // not required
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Zones[i] != nil {
|
if m.Pools[i] != nil {
|
||||||
if err := m.Zones[i].Validate(formats); err != nil {
|
if err := m.Pools[i].Validate(formats); err != nil {
|
||||||
if ve, ok := err.(*errors.Validation); ok {
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
return ve.ValidateName("zones" + "." + strconv.Itoa(i))
|
return ve.ValidateName("pools" + "." + strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -96,6 +137,24 @@ func (m *Tenant) validateZones(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Tenant) validateSubnetLicense(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.SubnetLicense) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.SubnetLicense != nil {
|
||||||
|
if err := m.SubnetLicense.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("subnet_license")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *Tenant) MarshalBinary() ([]byte, error) {
|
func (m *Tenant) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
@@ -113,3 +172,38 @@ func (m *Tenant) UnmarshalBinary(b []byte) error {
|
|||||||
*m = res
|
*m = res
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TenantEndpoints tenant endpoints
|
||||||
|
//
|
||||||
|
// swagger:model TenantEndpoints
|
||||||
|
type TenantEndpoints struct {
|
||||||
|
|
||||||
|
// console
|
||||||
|
Console string `json:"console,omitempty"`
|
||||||
|
|
||||||
|
// minio
|
||||||
|
Minio string `json:"minio,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tenant endpoints
|
||||||
|
func (m *TenantEndpoints) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TenantEndpoints) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TenantEndpoints) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TenantEndpoints
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ type TenantList struct {
|
|||||||
// current state
|
// current state
|
||||||
CurrentState string `json:"currentState,omitempty"`
|
CurrentState string `json:"currentState,omitempty"`
|
||||||
|
|
||||||
|
// deletion date
|
||||||
|
DeletionDate string `json:"deletion_date,omitempty"`
|
||||||
|
|
||||||
// instance count
|
// instance count
|
||||||
InstanceCount int64 `json:"instance_count,omitempty"`
|
InstanceCount int64 `json:"instance_count,omitempty"`
|
||||||
|
|
||||||
@@ -47,14 +50,14 @@ type TenantList struct {
|
|||||||
// namespace
|
// namespace
|
||||||
Namespace string `json:"namespace,omitempty"`
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
|
||||||
|
// pool count
|
||||||
|
PoolCount int64 `json:"pool_count,omitempty"`
|
||||||
|
|
||||||
// total size
|
// total size
|
||||||
TotalSize int64 `json:"total_size,omitempty"`
|
TotalSize int64 `json:"total_size,omitempty"`
|
||||||
|
|
||||||
// volume count
|
// volume count
|
||||||
VolumeCount int64 `json:"volume_count,omitempty"`
|
VolumeCount int64 `json:"volume_count,omitempty"`
|
||||||
|
|
||||||
// zone count
|
|
||||||
ZoneCount int64 `json:"zone_count,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this tenant list
|
// Validate validates this tenant list
|
||||||
|
|||||||
@@ -32,8 +32,11 @@ import (
|
|||||||
// swagger:model tenantUsage
|
// swagger:model tenantUsage
|
||||||
type TenantUsage struct {
|
type TenantUsage struct {
|
||||||
|
|
||||||
// used size
|
// disk used
|
||||||
UsedSize int64 `json:"used_size,omitempty"`
|
DiskUsed int64 `json:"disk_used,omitempty"`
|
||||||
|
|
||||||
|
// used
|
||||||
|
Used int64 `json:"used,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this tenant usage
|
// Validate validates this tenant usage
|
||||||
|
|||||||
122
models/tls_configuration.go
Normal file
122
models/tls_configuration.go
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TLSConfiguration tls configuration
|
||||||
|
//
|
||||||
|
// swagger:model tlsConfiguration
|
||||||
|
type TLSConfiguration struct {
|
||||||
|
|
||||||
|
// console
|
||||||
|
Console *KeyPairConfiguration `json:"console,omitempty"`
|
||||||
|
|
||||||
|
// minio
|
||||||
|
Minio []*KeyPairConfiguration `json:"minio"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this tls configuration
|
||||||
|
func (m *TLSConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateConsole(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateMinio(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TLSConfiguration) validateConsole(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Console) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Console != nil {
|
||||||
|
if err := m.Console.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("console")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *TLSConfiguration) validateMinio(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Minio) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < len(m.Minio); i++ {
|
||||||
|
if swag.IsZero(m.Minio[i]) { // not required
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Minio[i] != nil {
|
||||||
|
if err := m.Minio[i].Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("minio" + "." + strconv.Itoa(i))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *TLSConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *TLSConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res TLSConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -34,25 +34,59 @@ import (
|
|||||||
// swagger:model updateTenantRequest
|
// swagger:model updateTenantRequest
|
||||||
type UpdateTenantRequest struct {
|
type UpdateTenantRequest struct {
|
||||||
|
|
||||||
|
// console image
|
||||||
|
// Pattern: ^((.*?)/(.*?):(.+))$
|
||||||
|
ConsoleImage string `json:"console_image,omitempty"`
|
||||||
|
|
||||||
|
// enable prometheus
|
||||||
|
EnablePrometheus bool `json:"enable_prometheus,omitempty"`
|
||||||
|
|
||||||
// image
|
// image
|
||||||
// Pattern: ^((.*?)/(.*?):(.+))$
|
// Pattern: ^((.*?)/(.*?):(.+))$
|
||||||
Image string `json:"image,omitempty"`
|
Image string `json:"image,omitempty"`
|
||||||
|
|
||||||
|
// image pull secret
|
||||||
|
ImagePullSecret string `json:"image_pull_secret,omitempty"`
|
||||||
|
|
||||||
|
// image registry
|
||||||
|
ImageRegistry *ImageRegistry `json:"image_registry,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates this update tenant request
|
// Validate validates this update tenant request
|
||||||
func (m *UpdateTenantRequest) Validate(formats strfmt.Registry) error {
|
func (m *UpdateTenantRequest) Validate(formats strfmt.Registry) error {
|
||||||
var res []error
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateConsoleImage(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := m.validateImage(formats); err != nil {
|
if err := m.validateImage(formats); err != nil {
|
||||||
res = append(res, err)
|
res = append(res, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := m.validateImageRegistry(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
if len(res) > 0 {
|
if len(res) > 0 {
|
||||||
return errors.CompositeValidationError(res...)
|
return errors.CompositeValidationError(res...)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *UpdateTenantRequest) validateConsoleImage(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.ConsoleImage) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := validate.Pattern("console_image", "body", string(m.ConsoleImage), `^((.*?)/(.*?):(.+))$`); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (m *UpdateTenantRequest) validateImage(formats strfmt.Registry) error {
|
func (m *UpdateTenantRequest) validateImage(formats strfmt.Registry) error {
|
||||||
|
|
||||||
if swag.IsZero(m.Image) { // not required
|
if swag.IsZero(m.Image) { // not required
|
||||||
@@ -66,6 +100,24 @@ func (m *UpdateTenantRequest) validateImage(formats strfmt.Registry) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *UpdateTenantRequest) validateImageRegistry(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.ImageRegistry) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.ImageRegistry != nil {
|
||||||
|
if err := m.ImageRegistry.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("image_registry")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalBinary interface implementation
|
// MarshalBinary interface implementation
|
||||||
func (m *UpdateTenantRequest) MarshalBinary() ([]byte, error) {
|
func (m *UpdateTenantRequest) MarshalBinary() ([]byte, error) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
|
|||||||
310
models/vault_configuration.go
Normal file
310
models/vault_configuration.go
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
// Code generated by go-swagger; DO NOT EDIT.
|
||||||
|
|
||||||
|
// This file is part of MinIO Console Server
|
||||||
|
// Copyright (c) 2020 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/errors"
|
||||||
|
"github.com/go-openapi/strfmt"
|
||||||
|
"github.com/go-openapi/swag"
|
||||||
|
"github.com/go-openapi/validate"
|
||||||
|
)
|
||||||
|
|
||||||
|
// VaultConfiguration vault configuration
|
||||||
|
//
|
||||||
|
// swagger:model vaultConfiguration
|
||||||
|
type VaultConfiguration struct {
|
||||||
|
|
||||||
|
// approle
|
||||||
|
// Required: true
|
||||||
|
Approle *VaultConfigurationApprole `json:"approle"`
|
||||||
|
|
||||||
|
// endpoint
|
||||||
|
// Required: true
|
||||||
|
Endpoint *string `json:"endpoint"`
|
||||||
|
|
||||||
|
// engine
|
||||||
|
Engine string `json:"engine,omitempty"`
|
||||||
|
|
||||||
|
// namespace
|
||||||
|
Namespace string `json:"namespace,omitempty"`
|
||||||
|
|
||||||
|
// prefix
|
||||||
|
Prefix string `json:"prefix,omitempty"`
|
||||||
|
|
||||||
|
// status
|
||||||
|
Status *VaultConfigurationStatus `json:"status,omitempty"`
|
||||||
|
|
||||||
|
// tls
|
||||||
|
TLS *VaultConfigurationTLS `json:"tls,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this vault configuration
|
||||||
|
func (m *VaultConfiguration) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateApprole(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateEndpoint(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateStatus(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateTLS(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *VaultConfiguration) validateApprole(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("approle", "body", m.Approle); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Approle != nil {
|
||||||
|
if err := m.Approle.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("approle")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *VaultConfiguration) validateEndpoint(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("endpoint", "body", m.Endpoint); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *VaultConfiguration) validateStatus(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.Status) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Status != nil {
|
||||||
|
if err := m.Status.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("status")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *VaultConfiguration) validateTLS(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if swag.IsZero(m.TLS) { // not required
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.TLS != nil {
|
||||||
|
if err := m.TLS.Validate(formats); err != nil {
|
||||||
|
if ve, ok := err.(*errors.Validation); ok {
|
||||||
|
return ve.ValidateName("tls")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *VaultConfiguration) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *VaultConfiguration) UnmarshalBinary(b []byte) error {
|
||||||
|
var res VaultConfiguration
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// VaultConfigurationApprole vault configuration approle
|
||||||
|
//
|
||||||
|
// swagger:model VaultConfigurationApprole
|
||||||
|
type VaultConfigurationApprole struct {
|
||||||
|
|
||||||
|
// engine
|
||||||
|
Engine string `json:"engine,omitempty"`
|
||||||
|
|
||||||
|
// id
|
||||||
|
// Required: true
|
||||||
|
ID *string `json:"id"`
|
||||||
|
|
||||||
|
// retry
|
||||||
|
Retry int64 `json:"retry,omitempty"`
|
||||||
|
|
||||||
|
// secret
|
||||||
|
// Required: true
|
||||||
|
Secret *string `json:"secret"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this vault configuration approle
|
||||||
|
func (m *VaultConfigurationApprole) Validate(formats strfmt.Registry) error {
|
||||||
|
var res []error
|
||||||
|
|
||||||
|
if err := m.validateID(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := m.validateSecret(formats); err != nil {
|
||||||
|
res = append(res, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res) > 0 {
|
||||||
|
return errors.CompositeValidationError(res...)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *VaultConfigurationApprole) validateID(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("approle"+"."+"id", "body", m.ID); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *VaultConfigurationApprole) validateSecret(formats strfmt.Registry) error {
|
||||||
|
|
||||||
|
if err := validate.Required("approle"+"."+"secret", "body", m.Secret); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *VaultConfigurationApprole) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *VaultConfigurationApprole) UnmarshalBinary(b []byte) error {
|
||||||
|
var res VaultConfigurationApprole
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// VaultConfigurationStatus vault configuration status
|
||||||
|
//
|
||||||
|
// swagger:model VaultConfigurationStatus
|
||||||
|
type VaultConfigurationStatus struct {
|
||||||
|
|
||||||
|
// ping
|
||||||
|
Ping int64 `json:"ping,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this vault configuration status
|
||||||
|
func (m *VaultConfigurationStatus) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *VaultConfigurationStatus) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *VaultConfigurationStatus) UnmarshalBinary(b []byte) error {
|
||||||
|
var res VaultConfigurationStatus
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// VaultConfigurationTLS vault configuration TLS
|
||||||
|
//
|
||||||
|
// swagger:model VaultConfigurationTLS
|
||||||
|
type VaultConfigurationTLS struct {
|
||||||
|
|
||||||
|
// ca
|
||||||
|
Ca string `json:"ca,omitempty"`
|
||||||
|
|
||||||
|
// crt
|
||||||
|
Crt string `json:"crt,omitempty"`
|
||||||
|
|
||||||
|
// key
|
||||||
|
Key string `json:"key,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate validates this vault configuration TLS
|
||||||
|
func (m *VaultConfigurationTLS) Validate(formats strfmt.Registry) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalBinary interface implementation
|
||||||
|
func (m *VaultConfigurationTLS) MarshalBinary() ([]byte, error) {
|
||||||
|
if m == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return swag.WriteJSON(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalBinary interface implementation
|
||||||
|
func (m *VaultConfigurationTLS) UnmarshalBinary(b []byte) error {
|
||||||
|
var res VaultConfigurationTLS
|
||||||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*m = res
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user