mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-30 00:11:45 +08:00
Compare commits
1335 Commits
v0.5.0
...
v0.13.1-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68ddec78c8 | ||
|
|
c42997a643 | ||
|
|
5bd2feaa86 | ||
|
|
de4302d226 | ||
|
|
7150f24631 | ||
|
|
0e1e48dfc8 | ||
|
|
dd0f1f7705 | ||
|
|
03f8f47664 | ||
|
|
c85496d216 | ||
|
|
5f6415548d | ||
|
|
c641c17a8c | ||
|
|
83a2543b13 | ||
|
|
e8dae0f2e9 | ||
|
|
b85bf4d688 | ||
|
|
7fe0ab2654 | ||
|
|
dfa6eb2fe6 | ||
|
|
cc2c51ace5 | ||
|
|
897462ede7 | ||
|
|
4e3c24fd89 | ||
|
|
276e105f20 | ||
|
|
656026ac84 | ||
|
|
95bea11e43 | ||
|
|
c6f65510d8 | ||
|
|
d6e279dde5 | ||
|
|
e99b0e943d | ||
|
|
22a7c31f1d | ||
|
|
b6c0f24170 | ||
|
|
9c04ee066d | ||
|
|
29c3e808e1 | ||
|
|
3ded40a477 | ||
|
|
559d52b033 | ||
|
|
0ea527ec0a | ||
|
|
1a67e07d20 | ||
|
|
49b9bc4f93 | ||
|
|
4def4aa529 | ||
|
|
5d114e1d27 | ||
|
|
1ed3b3e740 | ||
|
|
571de0b40e | ||
|
|
463a8eea60 | ||
|
|
5105ad373a | ||
|
|
afa675dc28 | ||
|
|
335301396e | ||
|
|
995b1171e6 | ||
|
|
d497058f20 | ||
|
|
63bcd60d84 | ||
|
|
ecf0a82a62 | ||
|
|
f31c998349 | ||
|
|
b6e5626a19 | ||
|
|
77ca0939e4 | ||
|
|
83a4238153 | ||
|
|
77716ba56b | ||
|
|
541747d232 | ||
|
|
0956afdabe | ||
|
|
8b4a70d958 | ||
|
|
91b97d9243 | ||
|
|
be62f41e20 | ||
|
|
5fa34f7870 | ||
|
|
65f49113a8 | ||
|
|
8a874ec3f2 | ||
|
|
ada6cfd413 | ||
|
|
e7cef240c4 | ||
|
|
1b7e96cab9 | ||
|
|
dca6db842c | ||
|
|
f7770618ca | ||
|
|
bafd371e11 | ||
|
|
274a1c2e84 | ||
|
|
77812419d2 | ||
|
|
6fa123b122 | ||
|
|
b1d0ab1d59 | ||
|
|
0d5cd95ccb | ||
|
|
9d7172c920 | ||
|
|
d04c17eee1 | ||
|
|
78269c2b2c | ||
|
|
3e17318512 | ||
|
|
011fcc590e | ||
|
|
c45231c106 | ||
|
|
9ec45e4f34 | ||
|
|
48e2050e97 | ||
|
|
478b9a1c76 | ||
|
|
d42f88e04c | ||
|
|
6dd7c0ac70 | ||
|
|
31076bc70d | ||
|
|
7bbb57ca09 | ||
|
|
7b404ff0b6 | ||
|
|
aaf20b4ab6 | ||
|
|
3e87376feb | ||
|
|
7bc1056bc6 | ||
|
|
880e8ba082 | ||
|
|
ec634b66ca | ||
|
|
15fc40a3e9 | ||
|
|
96747f1dc0 | ||
|
|
b7395a1ffa | ||
|
|
a5f34b4f3b | ||
|
|
a28b5101fd | ||
|
|
688302c58e | ||
|
|
49e19eb135 | ||
|
|
0a676dff6f | ||
|
|
d524c3cb66 | ||
|
|
a9953683a9 | ||
|
|
d4d4884e5b | ||
|
|
d29290945c | ||
|
|
3343f2f74b | ||
|
|
837291a52a | ||
|
|
122593fdbe | ||
|
|
cd40edb16a | ||
|
|
b27ca42e42 | ||
|
|
3af4273541 | ||
|
|
197fb06f4c | ||
|
|
0b6a6e0af3 | ||
|
|
ba3c2e22a9 | ||
|
|
5955876c49 | ||
|
|
767643a51a | ||
|
|
5100efdd2d | ||
|
|
a5e358ea61 | ||
|
|
a3ef3d410a | ||
|
|
c270283c42 | ||
|
|
2093b565eb | ||
|
|
0b4b5c8050 | ||
|
|
1781e2774d | ||
|
|
d87e6e49db | ||
|
|
a1c58477bd | ||
|
|
f90b45437a | ||
|
|
85fb89862b | ||
|
|
c30f48811d | ||
|
|
0170252659 | ||
|
|
498eed6aca | ||
|
|
e01842c922 | ||
|
|
8f12351761 | ||
|
|
a22bdcc6f5 | ||
|
|
766815da1f | ||
|
|
a84d74d256 | ||
|
|
6e6b70aeb7 | ||
|
|
a78138c562 | ||
|
|
6167d5ef65 | ||
|
|
ce52f9914e | ||
|
|
ed54cb9a3f | ||
|
|
fc7ef5ffac | ||
|
|
1c16a5e743 | ||
|
|
9b25fd4190 | ||
|
|
076422e8ac | ||
|
|
5464dc71ac | ||
|
|
3a0af4c727 | ||
|
|
f4879a4228 | ||
|
|
4135b86928 | ||
|
|
ac51146dbc | ||
|
|
575dbc1507 | ||
|
|
8810b2c226 | ||
|
|
95cc0c3622 | ||
|
|
48a68083dc | ||
|
|
029469e031 | ||
|
|
c2d665ac8b | ||
|
|
0fff409d0f | ||
|
|
abf301093e | ||
|
|
91b79a1d33 | ||
|
|
c92781b5c8 | ||
|
|
858c299604 | ||
|
|
94a91fc543 | ||
|
|
18a7c3fa99 | ||
|
|
06fe267366 | ||
|
|
35e4d1fc5b | ||
|
|
b54e464c4a | ||
|
|
735baac10d | ||
|
|
edd1d474b1 | ||
|
|
150da5654b | ||
|
|
ee67c8713b | ||
|
|
4a16b4e031 | ||
|
|
0e3626b25a | ||
|
|
597a03ffc2 | ||
|
|
88595d6b4c | ||
|
|
f1bbd0e884 | ||
|
|
4ee679cf9f | ||
|
|
26b6e045de | ||
|
|
4a3a754585 | ||
|
|
4543c84170 | ||
|
|
b2a70c46d3 | ||
|
|
3ede228aa9 | ||
|
|
4a67aa103f | ||
|
|
4129466236 | ||
|
|
79b3ed6a49 | ||
|
|
853c50dea2 | ||
|
|
f23aa928d8 | ||
|
|
a1872b8554 | ||
|
|
99c42034b7 | ||
|
|
5e5f6bd51b | ||
|
|
a33c18c479 | ||
|
|
e882d4270f | ||
|
|
86fc90cd6b | ||
|
|
4a93177b5c | ||
|
|
7239e6620b | ||
|
|
cbecaf6fa1 | ||
|
|
de7f060c81 | ||
|
|
c723a3270f | ||
|
|
24bb7cb0a5 | ||
|
|
a51d4b662e | ||
|
|
6e72b550b1 | ||
|
|
1f95b87699 | ||
|
|
8258c5f19b | ||
|
|
e61341c50a | ||
|
|
8c0a763404 | ||
|
|
76bc226a2e | ||
|
|
e1dd4b8ed1 | ||
|
|
1e3b9ca278 | ||
|
|
cde5b54830 | ||
|
|
d2adb109e1 | ||
|
|
6eac7f2c74 | ||
|
|
9e4eb59cec | ||
|
|
0ccd871e54 | ||
|
|
4bb205257a | ||
|
|
bbbf1c0d6a | ||
|
|
f9b23a7d2a | ||
|
|
53c88c8390 | ||
|
|
b7e4281eeb | ||
|
|
f533ce01b3 | ||
|
|
abba7b5476 | ||
|
|
96861e19d3 | ||
|
|
f797e93821 | ||
|
|
e5586fcf76 | ||
|
|
93d1b4a2c0 | ||
|
|
df1421c6c4 | ||
|
|
cfbd92b65f | ||
|
|
bd5bea5f3a | ||
|
|
5d3345ded2 | ||
|
|
0274785f72 | ||
|
|
bcec3c13fd | ||
|
|
62b3e64df5 | ||
|
|
7c6708849f | ||
|
|
811f86633a | ||
|
|
4ed14f9baf | ||
|
|
c0ad80a185 | ||
|
|
9e694f1c34 | ||
|
|
4e92586024 | ||
|
|
b62271ddba | ||
|
|
d1a119b6de | ||
|
|
5a66ef2673 | ||
|
|
eabd391180 | ||
|
|
0736c92804 | ||
|
|
93551f12ee | ||
|
|
9cb3002cee | ||
|
|
eb9d798021 | ||
|
|
a31082d9a1 | ||
|
|
865f3fa827 | ||
|
|
072cbf24e3 | ||
|
|
90ce50a9ac | ||
|
|
00806b9baf | ||
|
|
ce805bfa20 | ||
|
|
1431b4344b | ||
|
|
9558473f2c | ||
|
|
bc7ce21fb6 | ||
|
|
e222af5564 | ||
|
|
2abe166904 | ||
|
|
4b4cccbd74 | ||
|
|
eb06f0ada3 | ||
|
|
6b74d0c61b | ||
|
|
d41dad0074 | ||
|
|
34f440587f | ||
|
|
70a4fc9eb8 | ||
|
|
cd7f4cb5d7 | ||
|
|
6a681e6693 | ||
|
|
036e417a56 | ||
|
|
879932c4b5 | ||
|
|
3c3a514983 | ||
|
|
8586639a6c | ||
|
|
55eeb90e2a | ||
|
|
c81c2d7672 | ||
|
|
2f5720aefc | ||
|
|
f02e7791f7 | ||
|
|
8dc22ff9bc | ||
|
|
6edca5731b | ||
|
|
63bdb69968 | ||
|
|
b2e887c1c9 | ||
|
|
88d23a5ec5 | ||
|
|
97ac5892ab | ||
|
|
18a8164b8e | ||
|
|
2d5db5baa1 | ||
|
|
c30196f267 | ||
|
|
7af2e5b1db | ||
|
|
5e4bbaaf9b | ||
|
|
e826167aa5 | ||
|
|
6863fd8d99 | ||
|
|
aed10dc1c9 | ||
|
|
20c23cfb8e | ||
|
|
4cdb39f934 | ||
|
|
10204a8896 | ||
|
|
3e6a48ba1e | ||
|
|
aeaa447beb | ||
|
|
023713da32 | ||
|
|
8a58fb9705 | ||
|
|
54d5420838 | ||
|
|
ebfcf1fb31 | ||
|
|
10fb88639c | ||
|
|
b020efb16f | ||
|
|
85e876b723 | ||
|
|
080c667b05 | ||
|
|
fc89727b80 | ||
|
|
9b90391892 | ||
|
|
e99e66590a | ||
|
|
a8f287b197 | ||
|
|
7e63fa28d0 | ||
|
|
7e41f5e538 | ||
|
|
77080ff173 | ||
|
|
8ca18d5fc5 | ||
|
|
4b7d7a1932 | ||
|
|
e244b8e625 | ||
|
|
819c57bed1 | ||
|
|
eeaad9c03b | ||
|
|
6ca2977662 | ||
|
|
6dd0225e17 | ||
|
|
a26c83988b | ||
|
|
80ed85a4cb | ||
|
|
e0f8118241 | ||
|
|
da1ca6eece | ||
|
|
b239ca1e6f | ||
|
|
b2bef450e1 | ||
|
|
08442a796f | ||
|
|
206e6a48cd | ||
|
|
276708d83c | ||
|
|
9c8299d89c | ||
|
|
828e44ab7d | ||
|
|
98a45f927f | ||
|
|
c97737773e | ||
|
|
57f228ec2c | ||
|
|
f421ba4ab8 | ||
|
|
6d9a575789 | ||
|
|
0a6ea236c7 | ||
|
|
fa2a351da3 | ||
|
|
7ff17a5aae | ||
|
|
8d8472f52d | ||
|
|
12d3e84943 | ||
|
|
6f65f291d5 | ||
|
|
ac5a394366 | ||
|
|
5b0fc82acf | ||
|
|
39c9511578 | ||
|
|
5d221f6140 | ||
|
|
da8cb2859a | ||
|
|
5009a2643f | ||
|
|
e0ec2e5783 | ||
|
|
11d198a2db | ||
|
|
9ab76e78fb | ||
|
|
859a3d21c9 | ||
|
|
512bb04be5 | ||
|
|
00c22974a9 | ||
|
|
2bb66545e8 | ||
|
|
b0ec3194b6 | ||
|
|
81e3a7f299 | ||
|
|
a913c69b71 | ||
|
|
16c04a9906 | ||
|
|
013b41f102 | ||
|
|
4d5f02c815 | ||
|
|
c1a22cd330 | ||
|
|
25049535e3 | ||
|
|
2f8735c6d0 | ||
|
|
276f084fab | ||
|
|
8e9e51fc5e | ||
|
|
f9838a4614 | ||
|
|
36a5d26b4e | ||
|
|
e12cdafac2 | ||
|
|
e851a35b4e | ||
|
|
d0a83ffddd | ||
|
|
29710519a1 | ||
|
|
c05ac10c64 | ||
|
|
43a9c22d40 | ||
|
|
2eec349af9 | ||
|
|
f81cdc03f7 | ||
|
|
1276e82fb0 | ||
|
|
8bfcb87e91 | ||
|
|
30e25192c7 | ||
|
|
cb4a229984 | ||
|
|
c3f76f971c | ||
|
|
dc27fd3319 | ||
|
|
0a8744656c | ||
|
|
1910a47a21 | ||
|
|
e3fd781cd3 | ||
|
|
5eff42fb2c | ||
|
|
3067c62a7f | ||
|
|
adb7f0b74a | ||
|
|
6753ead9f8 | ||
|
|
146411c370 | ||
|
|
bdc3d99fed | ||
|
|
aa6725fbc9 | ||
|
|
8da35695de | ||
|
|
fc7cdb5681 | ||
|
|
7bbeba544d | ||
|
|
5b7f5c9724 | ||
|
|
1effb919d6 | ||
|
|
7f6f58884a | ||
|
|
16274dd946 | ||
|
|
cebb412175 | ||
|
|
5dbb2104ce | ||
|
|
2232d4e946 | ||
|
|
e66c095500 | ||
|
|
7af3c9dd7c | ||
|
|
b01c0c41a8 | ||
|
|
59d0c95307 | ||
|
|
d319d41929 | ||
|
|
9435404701 | ||
|
|
b6b8652829 | ||
|
|
5073cbdff1 | ||
|
|
0b77438d57 | ||
|
|
59e7d58503 | ||
|
|
fa96d6ef66 | ||
|
|
6c0d3fe598 | ||
|
|
b0361cdc6c | ||
|
|
e526505365 | ||
|
|
993ce397aa | ||
|
|
7a8df485ad | ||
|
|
7936eac98d | ||
|
|
94ae9071aa | ||
|
|
8b6d10d112 | ||
|
|
a94ae526ca | ||
|
|
8e2b1ab106 | ||
|
|
e83e5d495e | ||
|
|
0f5cf7be4d | ||
|
|
7295ba36b3 | ||
|
|
a8958b0136 | ||
|
|
69a6a72303 | ||
|
|
92f2be7cac | ||
|
|
46f4465103 | ||
|
|
ca45e29dd5 | ||
|
|
dfd892d6f1 | ||
|
|
c1d123ec2c | ||
|
|
7c2001f5ac | ||
|
|
aff166fb40 | ||
|
|
40759738ae | ||
|
|
a0454cdfc3 | ||
|
|
41d3d7be34 | ||
|
|
4dc60c2113 | ||
|
|
3cf11eaa58 | ||
|
|
3b605545b1 | ||
|
|
eef3309080 | ||
|
|
4e3eaae1f6 | ||
|
|
2ddab18a59 | ||
|
|
6727b00b05 | ||
|
|
81c05f9954 | ||
|
|
ac5bf65ae9 | ||
|
|
66431a21eb | ||
|
|
8d662d6ce0 | ||
|
|
ad16285fd4 | ||
|
|
f024889ca8 | ||
|
|
d7df089d31 | ||
|
|
2cd3f76299 | ||
|
|
965e8dda92 | ||
|
|
c13c868143 | ||
|
|
e2f94e937c | ||
|
|
df74766a66 | ||
|
|
30305f42e1 | ||
|
|
41b2f322da | ||
|
|
946ab11dab | ||
|
|
886e39244e | ||
|
|
7ce8d9cdfa | ||
|
|
2868ab69c9 | ||
|
|
18428c4e82 | ||
|
|
df3dba4e2e | ||
|
|
d097cdfefe | ||
|
|
cee49e67f4 | ||
|
|
640c7b54f5 | ||
|
|
655020b54b | ||
|
|
5117c8b34e | ||
|
|
045912fe5c | ||
|
|
3673b3da59 | ||
|
|
d7db598cc6 | ||
|
|
f3a2856d65 | ||
|
|
f1045710a0 | ||
|
|
ed621633df | ||
|
|
c5d1ec9b1f | ||
|
|
5c225b405d | ||
|
|
bd5ec0e7c2 | ||
|
|
176fcc3008 | ||
|
|
945b3bc2e5 | ||
|
|
1bdd6a7eda | ||
|
|
f78ae63afa | ||
|
|
114f290cde | ||
|
|
1a15df4999 | ||
|
|
f9f6d75be8 | ||
|
|
782617a3e9 | ||
|
|
0ec109da2b | ||
|
|
b8b9ff2543 | ||
|
|
0b54bd1c43 | ||
|
|
cb27809665 | ||
|
|
252e53a793 | ||
|
|
05fc2b1422 | ||
|
|
839b9ac2e3 | ||
|
|
2091485345 | ||
|
|
0ffa3aee32 | ||
|
|
a5cc3cf38a | ||
|
|
4bad6b8858 | ||
|
|
35982bf85a | ||
|
|
f1b31c7d3d | ||
|
|
ec2f9b3ecd | ||
|
|
a2c11050fc | ||
|
|
b3f9c44482 | ||
|
|
8aa10c9630 | ||
|
|
6c8f6cee5b | ||
|
|
60bfe4e02a | ||
|
|
9e022b24f7 | ||
|
|
be63c412be | ||
|
|
df582292b7 | ||
|
|
636f7cc72f | ||
|
|
b8912d4f4a | ||
|
|
2b8c2b4589 | ||
|
|
c98d1d5614 | ||
|
|
88f6ba2fb8 | ||
|
|
71ce7289fd | ||
|
|
62f53ee605 | ||
|
|
81241b0cc9 | ||
|
|
90602b8f87 | ||
|
|
ff2e948623 | ||
|
|
a831ed164d | ||
|
|
22bcd5f838 | ||
|
|
21ab9cab01 | ||
|
|
2daf7f8c72 | ||
|
|
3d1382ba17 | ||
|
|
51a76523d3 | ||
|
|
6b08cd3233 | ||
|
|
2a499f228a | ||
|
|
2c0279eba1 | ||
|
|
cc7ec322b3 | ||
|
|
882901facb | ||
|
|
c59c3f2492 | ||
|
|
3384564c42 | ||
|
|
e22056876e | ||
|
|
b7bd16610c | ||
|
|
fe5a071b61 | ||
|
|
50e6e83a16 | ||
|
|
bd49e64b78 | ||
|
|
90003fa2d9 | ||
|
|
1440a660ef | ||
|
|
925d278163 | ||
|
|
5a13be299f | ||
|
|
3d5dcb632a | ||
|
|
5620bfb3fb | ||
|
|
dea5eeda3b | ||
|
|
1cf4dd6658 | ||
|
|
d079d5bad8 | ||
|
|
0d738fe2ad | ||
|
|
8cf8436afc | ||
|
|
ab9627f249 | ||
|
|
a0197e0883 | ||
|
|
97c5e2da6f | ||
|
|
817ec61bdf | ||
|
|
c56a1c0e96 | ||
|
|
441722a8ba | ||
|
|
ec32dc825c | ||
|
|
9f5b12da69 | ||
|
|
1526194e71 | ||
|
|
017c3ca899 | ||
|
|
7887f3a4ef | ||
|
|
d209423100 | ||
|
|
1e3a5d4faf | ||
|
|
f6a7d3ec58 | ||
|
|
ef9c185977 | ||
|
|
c7184d133e | ||
|
|
ec2ad1a9be | ||
|
|
640d4f6e9f | ||
|
|
027a93f044 | ||
|
|
5fe3ef9213 | ||
|
|
49c1c6a0cd | ||
|
|
ce9fd4bf52 | ||
|
|
e1ade14d6c | ||
|
|
d823a951fb | ||
|
|
9e236aafb2 | ||
|
|
aaf6d31847 | ||
|
|
efffe1f070 | ||
|
|
6fe23c7ed8 | ||
|
|
8684e44632 | ||
|
|
8c8d4e237a | ||
|
|
0e2eb1580e | ||
|
|
72d6892276 | ||
|
|
24348647a8 | ||
|
|
d736e773ca | ||
|
|
fddf2d6a81 | ||
|
|
7df9ac6240 | ||
|
|
7ddd6873ea | ||
|
|
63011e1ab4 | ||
|
|
b6c67dd774 | ||
|
|
c91efc7a60 | ||
|
|
b6b8d624d1 | ||
|
|
504c4bf597 | ||
|
|
f19d3b4e53 | ||
|
|
c657a004f0 | ||
|
|
3253aac814 | ||
|
|
57502417ad | ||
|
|
56777b48c3 | ||
|
|
3074622046 | ||
|
|
ba72b1435f | ||
|
|
d56b728995 | ||
|
|
d213fda778 | ||
|
|
a983e26b92 | ||
|
|
9f6a1be08e | ||
|
|
9c356dfd8b | ||
|
|
814b289024 | ||
|
|
ee9cf10667 | ||
|
|
5b69516867 | ||
|
|
0c28cc1576 | ||
|
|
7cddeb9311 | ||
|
|
64a078f4d6 | ||
|
|
3f4d84398b | ||
|
|
5ecd8ca185 | ||
|
|
73e7cda6f1 | ||
|
|
9af50d36b3 | ||
|
|
0e9ec72527 | ||
|
|
b8191f6b1f | ||
|
|
5f6b995564 | ||
|
|
beb867eb22 | ||
|
|
cd8298b654 | ||
|
|
c4d9c8b9a8 | ||
|
|
6e1a3729f2 | ||
|
|
483c79abb3 | ||
|
|
79d5babfcb | ||
|
|
322265dce2 | ||
|
|
3079bbf0be | ||
|
|
78a9b845a8 | ||
|
|
40eb461541 | ||
|
|
3c03bd5d6c | ||
|
|
ddd529f9bf | ||
|
|
4c4d01ed09 | ||
|
|
601541ebbf | ||
|
|
5f6bda8838 | ||
|
|
c226ff8419 | ||
|
|
8cd3cc5836 | ||
|
|
27203d4d7f | ||
|
|
ecadd189a2 | ||
|
|
be4ce07b7c | ||
|
|
a30b46dff9 | ||
|
|
295a3b9484 | ||
|
|
c9ee8f301e | ||
|
|
a8a97d608e | ||
|
|
77a457ae01 | ||
|
|
88955d4e15 | ||
|
|
b68de30418 | ||
|
|
facbed59bc | ||
|
|
71781426e0 | ||
|
|
f48e749721 | ||
|
|
56f87f39d6 | ||
|
|
334642c091 | ||
|
|
4cd5e619a5 | ||
|
|
b3a0365447 | ||
|
|
dedc295441 | ||
|
|
07d6c1cc4b | ||
|
|
38becdd251 | ||
|
|
2108691f68 | ||
|
|
3c2786ed6d | ||
|
|
3378899c5c | ||
|
|
1efd66d010 | ||
|
|
4895d48e11 | ||
|
|
df7ce2f752 | ||
|
|
0262a9ec90 | ||
|
|
c6c8e80516 | ||
|
|
f20a7a2b14 | ||
|
|
327c73f22a | ||
|
|
b3e7ed5941 | ||
|
|
9381dd0a85 | ||
|
|
e2f027dd61 | ||
|
|
b6f7118a43 | ||
|
|
f7b941f8a0 | ||
|
|
9996bfbbc3 | ||
|
|
574301df07 | ||
|
|
6834f660d7 | ||
|
|
e8e37cd8ea | ||
|
|
a47bbe949b | ||
|
|
7c72a36e8b | ||
|
|
8d4989d2db | ||
|
|
2de59c22cf | ||
|
|
d23ce9b6a9 | ||
|
|
02f3904d6a | ||
|
|
883b7bee30 | ||
|
|
ff7aa917f7 | ||
|
|
e00a54c24e | ||
|
|
183296ff63 | ||
|
|
9d23b111b6 | ||
|
|
8b26a84162 | ||
|
|
9d3150ccd3 | ||
|
|
6460fefbd8 | ||
|
|
7a9aa28210 | ||
|
|
1c085d8794 | ||
|
|
1055b228a1 | ||
|
|
05ad9ca2cc | ||
|
|
0f5d27a60d | ||
|
|
1390d4d235 | ||
|
|
bf37713371 | ||
|
|
88b20d878d | ||
|
|
8d29cd0c5c | ||
|
|
dafaadd80a | ||
|
|
4f036468b0 | ||
|
|
8df966fcee | ||
|
|
6d8ac266a3 | ||
|
|
6e9ffed843 | ||
|
|
20777ed3ce | ||
|
|
fa68d2bef4 | ||
|
|
2726ec8d82 | ||
|
|
a9df73e63a | ||
|
|
b8ca62efda | ||
|
|
afd1b65dc5 | ||
|
|
b7f298035d | ||
|
|
90733b5daa | ||
|
|
35aef3819f | ||
|
|
bbe5593b52 | ||
|
|
7911ff02cc | ||
|
|
f1ecb595b4 | ||
|
|
010052de3a | ||
|
|
56856caa8a | ||
|
|
3d3c9d6a66 | ||
|
|
159d1819b0 | ||
|
|
5597e14985 | ||
|
|
7b570f861e | ||
|
|
c6c2079226 | ||
|
|
b9d5f24f37 | ||
|
|
738d3a0050 | ||
|
|
64f6afc730 | ||
|
|
04bc8f2e12 | ||
|
|
67f4634ae0 | ||
|
|
271b1ed563 | ||
|
|
b7c6d33c9e | ||
|
|
a138413c5f | ||
|
|
ca1c672f0d | ||
|
|
b41ddcdc2c | ||
|
|
48f543b9f6 | ||
|
|
e41eb4a087 | ||
|
|
73535da7fa | ||
|
|
84ddd0d0da | ||
|
|
7600f79776 | ||
|
|
2164b644e6 | ||
|
|
29e1550446 | ||
|
|
f2d8165016 | ||
|
|
e8c17a04ee | ||
|
|
cfd9bc6f43 | ||
|
|
3ee8497cac | ||
|
|
58a7019b24 | ||
|
|
212f70cbb5 | ||
|
|
18e2c4e411 | ||
|
|
afb7af1bbe | ||
|
|
9c072f5b46 | ||
|
|
3403efa18c | ||
|
|
d53dbe1097 | ||
|
|
6005f55d63 | ||
|
|
9b1ee3fbb7 | ||
|
|
0a80eeede4 | ||
|
|
9acd4cf6d3 | ||
|
|
8ba2f9f6a1 | ||
|
|
037e735b6b | ||
|
|
076078601d | ||
|
|
06ada8ff95 | ||
|
|
b712ba676a | ||
|
|
9f00c87d9c | ||
|
|
5f697b22f9 | ||
|
|
7ff3ad0c98 | ||
|
|
3ebd7ab245 | ||
|
|
2d3f51bf27 | ||
|
|
0eaa2b5ea2 | ||
|
|
6bc28c4e72 | ||
|
|
2bc8f684c7 | ||
|
|
b57ffe8f71 | ||
|
|
617806011c | ||
|
|
e405ccdf04 | ||
|
|
cd4f429559 | ||
|
|
f555584fc8 | ||
|
|
f4743d3790 | ||
|
|
7ec544550b | ||
|
|
472c50b9d7 | ||
|
|
bd38568e6b | ||
|
|
b94aaa8778 | ||
|
|
a2521e90f2 | ||
|
|
4cdef38325 | ||
|
|
16b3f37b1d | ||
|
|
375ef146f3 | ||
|
|
b91a82ece8 | ||
|
|
bc1236fef3 | ||
|
|
d4fbd71d55 | ||
|
|
123e8830bf | ||
|
|
e8c28175f5 | ||
|
|
860dc7398c | ||
|
|
1a9ce9870d | ||
|
|
d273037954 | ||
|
|
6d494a9643 | ||
|
|
e6d30407c9 | ||
|
|
ea5d4d56fb | ||
|
|
92b3b2ae23 | ||
|
|
92b9aba0d1 | ||
|
|
eed930c7f6 | ||
|
|
eb13274243 | ||
|
|
a15e9fb3d3 | ||
|
|
79aa54c0c1 | ||
|
|
68ffbb1d93 | ||
|
|
b79cfa019f | ||
|
|
819f48efde | ||
|
|
381fba4c8f | ||
|
|
1daca92c3e | ||
|
|
81566969c7 | ||
|
|
af98871c0f | ||
|
|
60e85c76e5 | ||
|
|
d4f849073c | ||
|
|
6d0260a623 | ||
|
|
37350f78fb | ||
|
|
f3deea797b | ||
|
|
adf117d56b | ||
|
|
dc1972a808 | ||
|
|
609f24fcb2 | ||
|
|
933e1fa6fd | ||
|
|
a7d075e7c7 | ||
|
|
2df35cb27e | ||
|
|
a46864a38f | ||
|
|
0aced56569 | ||
|
|
227d9c0d4e | ||
|
|
e0096f9be6 | ||
|
|
4f8a92c7a4 | ||
|
|
21baabd634 | ||
|
|
260dd334f6 | ||
|
|
9deee0cc8c | ||
|
|
8540bb82b7 | ||
|
|
ac8c622769 | ||
|
|
e75170d468 | ||
|
|
2c9dbf52b3 | ||
|
|
679d7e50b5 | ||
|
|
3f5108121b | ||
|
|
8ddab20769 | ||
|
|
afda5003e7 | ||
|
|
ac229239fa | ||
|
|
7c5f79ac60 | ||
|
|
abea64f05f | ||
|
|
72fbff18cd | ||
|
|
674c4f81e5 | ||
|
|
e2d286356f | ||
|
|
8f94318944 | ||
|
|
e0cca02a3a | ||
|
|
2b67724e35 | ||
|
|
66760c5f44 | ||
|
|
756010958d | ||
|
|
cf7d52bb19 | ||
|
|
14af381877 | ||
|
|
f8d7ec73ba | ||
|
|
b9ccacc2ea | ||
|
|
a19ae1c1c3 | ||
|
|
094503174c | ||
|
|
1eb25e1b67 | ||
|
|
fb09fb621d | ||
|
|
feeb42a038 | ||
|
|
655bb3c15f | ||
|
|
96a969fbdb | ||
|
|
84c19a231c | ||
|
|
c075719165 | ||
|
|
bad6fe47ec | ||
|
|
662f353512 | ||
|
|
1595594dc8 | ||
|
|
7eac879f40 | ||
|
|
56314a0850 | ||
|
|
62c8f5dcb2 | ||
|
|
21099b7627 | ||
|
|
61704062ba | ||
|
|
f530a7fac2 | ||
|
|
076917278b | ||
|
|
6a27719167 | ||
|
|
c9438a344b | ||
|
|
9723f5685a | ||
|
|
195a332281 | ||
|
|
4aeee1f2ac | ||
|
|
9e48c3b406 | ||
|
|
3c0a138642 | ||
|
|
fc10444656 | ||
|
|
20151d5108 | ||
|
|
bcc72e2567 | ||
|
|
735b10c025 | ||
|
|
460b7c0604 | ||
|
|
a400d64c81 | ||
|
|
c414673b13 | ||
|
|
70e38c99c9 | ||
|
|
b41c2ea848 | ||
|
|
c1ce0ad17b | ||
|
|
2048b7a4eb | ||
|
|
d308761f27 | ||
|
|
8f257ca73e | ||
|
|
452bbfe258 | ||
|
|
4ad388e892 | ||
|
|
b89a31323d | ||
|
|
18a795f129 | ||
|
|
184bb1247d | ||
|
|
5e86a0e2aa | ||
|
|
2daa821cfb | ||
|
|
4bf928531a | ||
|
|
f437c9f0f9 | ||
|
|
c7bd017725 | ||
|
|
1420248489 | ||
|
|
998d6bcca4 | ||
|
|
f7d20e9d54 | ||
|
|
263f963a4c | ||
|
|
6111abd740 | ||
|
|
2a88ff8234 | ||
|
|
68e7b6b10f | ||
|
|
6ce6991156 | ||
|
|
55db5f2708 | ||
|
|
963dd9adcc | ||
|
|
e5f5b8d183 | ||
|
|
c121116b9d | ||
|
|
dd9e64ccf6 | ||
|
|
5fe29d5f58 | ||
|
|
3edbc809de | ||
|
|
fd3dcdec9c | ||
|
|
c7caeeb70a | ||
|
|
089a49f8c3 | ||
|
|
b5e5cbf2c6 | ||
|
|
e2bc242657 | ||
|
|
23a70de39b | ||
|
|
dac2029969 | ||
|
|
356459a011 | ||
|
|
a92cd13ffb | ||
|
|
7ef68ade48 | ||
|
|
1c48a9a954 | ||
|
|
99a5d24279 | ||
|
|
5621477465 | ||
|
|
7772a20482 | ||
|
|
5fdaf16c47 | ||
|
|
b1559ddf23 | ||
|
|
799330b50a | ||
|
|
4d4d5a23b1 | ||
|
|
d11a2c8aa5 | ||
|
|
effd641bc7 | ||
|
|
9e2f065d5d | ||
|
|
43e3a1a97b | ||
|
|
4be301eb46 | ||
|
|
e85561a651 | ||
|
|
35bca23f4d | ||
|
|
1f9d68c382 | ||
|
|
9600794c38 | ||
|
|
6c785ed2a6 | ||
|
|
1a387f6c72 | ||
|
|
1b4e16a168 | ||
|
|
90804b77be | ||
|
|
b4fc0b024e | ||
|
|
9b8d3e83a9 | ||
|
|
572a20a308 | ||
|
|
3a9e84c4a5 | ||
|
|
d611a8ca0c | ||
|
|
df7c38de32 | ||
|
|
4543d381ce | ||
|
|
383e915fa3 | ||
|
|
5fc913fa7a | ||
|
|
1b30721a05 | ||
|
|
8bfbf561a5 | ||
|
|
2aca938df8 | ||
|
|
14c6c6b8a7 | ||
|
|
f472b9263e | ||
|
|
a0196f433f | ||
|
|
cc7cd1201b | ||
|
|
de9947defa | ||
|
|
841c3bc635 | ||
|
|
5659975fb9 | ||
|
|
61763f7eaf | ||
|
|
e339e698d0 | ||
|
|
79d02f2b5c | ||
|
|
e7483535f8 | ||
|
|
3a8e170e73 | ||
|
|
828315ef94 | ||
|
|
6e9105a742 | ||
|
|
97f9b78efa | ||
|
|
af6b053147 | ||
|
|
1480a8da8c | ||
|
|
a1d74dff42 | ||
|
|
5859da5520 | ||
|
|
473bc9d27a | ||
|
|
243a147482 | ||
|
|
4f549d0103 | ||
|
|
7d720a43fb | ||
|
|
9d1e8ecf68 | ||
|
|
872ed2d9af | ||
|
|
c64954562b | ||
|
|
6f60592669 | ||
|
|
49451b5008 | ||
|
|
7f6445f356 | ||
|
|
ca5d69e3f8 | ||
|
|
396d95d9d9 | ||
|
|
485c75695d | ||
|
|
7ca68b6dfa | ||
|
|
1f98997bb3 | ||
|
|
ff51502a0a | ||
|
|
7d19a8543b | ||
|
|
5ebb1db051 | ||
|
|
80476af59c | ||
|
|
927e49fe63 | ||
|
|
7082e53328 | ||
|
|
7b6c46bbda | ||
|
|
12f2a9bd05 | ||
|
|
ff7c79a5ff | ||
|
|
58d6029d45 | ||
|
|
c5b34248b3 | ||
|
|
ab75bb1254 | ||
|
|
51699159c5 | ||
|
|
99c17689a2 | ||
|
|
d6c9ffb1c1 | ||
|
|
fae40730ae | ||
|
|
7616a5ff92 | ||
|
|
b90b702709 | ||
|
|
cfd000d38b | ||
|
|
5a329c242e | ||
|
|
6591977470 | ||
|
|
11c18f23a9 | ||
|
|
6761633ce5 | ||
|
|
16df1e44f0 | ||
|
|
e96413d05a | ||
|
|
19e62e00a4 | ||
|
|
a68e27af42 | ||
|
|
85f335c212 | ||
|
|
e1756d3ee1 | ||
|
|
8631c5cc85 | ||
|
|
38368e4881 | ||
|
|
67553adad1 | ||
|
|
4a3f990a3d | ||
|
|
1dadebec0d | ||
|
|
67e13bf423 | ||
|
|
a08f36b02e | ||
|
|
d1235ee2cb | ||
|
|
5dfbf98ec4 | ||
|
|
912c492272 | ||
|
|
19a622e37a | ||
|
|
5c1c64cac9 | ||
|
|
024992469f | ||
|
|
adb59a36a3 | ||
|
|
5eb3a1c0ef | ||
|
|
6adccf5174 | ||
|
|
1116e862ac | ||
|
|
6d4f8fff3e | ||
|
|
f7933fd549 | ||
|
|
031122ed79 | ||
|
|
4f2f7df8f0 | ||
|
|
f1cfdbb9a0 | ||
|
|
dfe606447c | ||
|
|
67a3b0851e | ||
|
|
1fe4201704 | ||
|
|
fb73c672fd | ||
|
|
c7329a6d7a | ||
|
|
13e1bca6b2 | ||
|
|
dda2a8325b | ||
|
|
a002f32a5a | ||
|
|
14b8e4c1c6 | ||
|
|
af82c312a7 | ||
|
|
b4962f16a4 | ||
|
|
cc3ffd68ba | ||
|
|
5c1b48dcab | ||
|
|
b0571f69c9 | ||
|
|
92bde140b9 | ||
|
|
88dd5dd788 | ||
|
|
a516ab4d38 | ||
|
|
d493bfb19a | ||
|
|
772f6ce880 | ||
|
|
41e4ff6b2c | ||
|
|
ecf8b744b4 | ||
|
|
2bca0d7d8a | ||
|
|
4b2e0173c1 | ||
|
|
beea0ce69e | ||
|
|
1807234621 | ||
|
|
0d9665e11e | ||
|
|
015d78f1a3 | ||
|
|
d8bf13871a | ||
|
|
816e7fdf1a | ||
|
|
1ec494d34c | ||
|
|
7528348aaf | ||
|
|
07fe5325af | ||
|
|
724a640127 | ||
|
|
3db1a4557b | ||
|
|
3ce771967b | ||
|
|
9c193b3616 | ||
|
|
d80e53a12b | ||
|
|
2618da8d0c | ||
|
|
f59e7d5b1a | ||
|
|
c2cf26b313 | ||
|
|
6167ea6d41 | ||
|
|
872f6c97dc | ||
|
|
16fe0ac2bd | ||
|
|
6b4ff97c01 | ||
|
|
eb9ae0cf70 | ||
|
|
e7bac1229b | ||
|
|
4e32b4b54d | ||
|
|
3546dacb9e | ||
|
|
be226b18a7 | ||
|
|
297def6143 | ||
|
|
f40e83f437 | ||
|
|
5d1ac885a0 | ||
|
|
356f695d6f | ||
|
|
dd49f038bb | ||
|
|
e2e3313e97 | ||
|
|
2a5905d13b | ||
|
|
c105fb3c39 | ||
|
|
2e71663e42 | ||
|
|
bb2b3e84a1 | ||
|
|
9158ddc68d | ||
|
|
63230736d9 | ||
|
|
8beb2312c1 | ||
|
|
36d7c91942 | ||
|
|
3b76b6acee | ||
|
|
2fc04179dd | ||
|
|
e4685aef76 | ||
|
|
3daa67fa3a | ||
|
|
25a9042852 | ||
|
|
d148853881 | ||
|
|
5cee7573d5 | ||
|
|
88301d5575 | ||
|
|
32877ead31 | ||
|
|
579de1dd00 | ||
|
|
e7820ff310 | ||
|
|
8494d0256c | ||
|
|
6615fde6eb | ||
|
|
bf02e031a2 | ||
|
|
3bcdb7681a | ||
|
|
4d4535ec8d | ||
|
|
025b06796b | ||
|
|
dab1664bee | ||
|
|
9a01fdf98f | ||
|
|
9533251227 | ||
|
|
5691d93a5a | ||
|
|
6cacf140c3 | ||
|
|
1920eb5ed0 | ||
|
|
f69fc07e22 | ||
|
|
718bc349cd | ||
|
|
34556d243b | ||
|
|
2d248c05f5 | ||
|
|
697bf02ded | ||
|
|
1809215615 | ||
|
|
6d51342cf8 | ||
|
|
72c2b8da81 | ||
|
|
18ee46462e | ||
|
|
151bf47dba | ||
|
|
27c586560b | ||
|
|
da6934face | ||
|
|
bff87cecf0 | ||
|
|
fef9672e71 | ||
|
|
f74ec05f97 | ||
|
|
2f5303bd78 | ||
|
|
4d427dac76 | ||
|
|
2913362ba9 | ||
|
|
4b06855e00 | ||
|
|
b185dcd85e | ||
|
|
f18b0aeb14 | ||
|
|
5242e10b86 | ||
|
|
4c2a2d527a | ||
|
|
9b34aff8fa | ||
|
|
6950633439 | ||
|
|
6c8d7766ea | ||
|
|
3b1eb96cf3 | ||
|
|
2e18d7005a | ||
|
|
f07df94121 | ||
|
|
00d6521646 | ||
|
|
a7b8fdc75d | ||
|
|
13ab6c0d90 | ||
|
|
2c967d656a | ||
|
|
7ba41f2df9 | ||
|
|
2fb7d67378 | ||
|
|
c5b822a8d1 | ||
|
|
8b459f882c | ||
|
|
be99db4ffc | ||
|
|
946849c6b6 | ||
|
|
d42bffa0e2 | ||
|
|
965341cb5c | ||
|
|
fd686a0672 | ||
|
|
b380fa68e9 | ||
|
|
8130d44ced | ||
|
|
74b3043db1 | ||
|
|
238353ffb9 | ||
|
|
5128135be7 | ||
|
|
4e524318bc | ||
|
|
33cc90ea4f | ||
|
|
08a432cf23 | ||
|
|
77c1d9a83a | ||
|
|
57336ed666 | ||
|
|
ab76f71ed2 | ||
|
|
a05c3a39be | ||
|
|
d5c3a8bf95 | ||
|
|
8ed539f680 | ||
|
|
ae524fbd2e | ||
|
|
43f71184a9 | ||
|
|
41c802805c | ||
|
|
ed7dd7a367 | ||
|
|
27d5a480a8 | ||
|
|
5520558ef0 | ||
|
|
bcfa8d986d | ||
|
|
ad36870b28 | ||
|
|
74f1019e76 | ||
|
|
d4687e1b78 | ||
|
|
6d2d7a0f03 | ||
|
|
ba9f2669db | ||
|
|
3410898188 | ||
|
|
bdc817c14d | ||
|
|
94de4aafe3 | ||
|
|
4f69a56996 | ||
|
|
491267b255 | ||
|
|
32ea715005 | ||
|
|
259c9f8a57 | ||
|
|
01bbca6c73 | ||
|
|
72df98834c | ||
|
|
7574c1500f | ||
|
|
527ea03b41 | ||
|
|
aac67a9c6d | ||
|
|
059608018a | ||
|
|
c5c1179d64 | ||
|
|
8cdafc77cb | ||
|
|
ecb864df9a | ||
|
|
46c538ef28 | ||
|
|
332e7176d8 | ||
|
|
76ce475ae1 | ||
|
|
07ae9b9777 | ||
|
|
1e594eb63f | ||
|
|
ac8c3e39b1 | ||
|
|
9fb1da353b | ||
|
|
930cdd5d08 | ||
|
|
057dde1a86 | ||
|
|
fd9a9cc871 | ||
|
|
c0a4549d41 | ||
|
|
07a473c0ab | ||
|
|
a5060a71ae | ||
|
|
fa7dd28a9a | ||
|
|
77d0b1e0fa | ||
|
|
86b307cd42 | ||
|
|
ed546be1d3 | ||
|
|
e2152058c6 | ||
|
|
b02313c212 | ||
|
|
e09c3ea87e | ||
|
|
e3fc34840b | ||
|
|
78491c9436 | ||
|
|
6fc161b128 | ||
|
|
318869bba4 | ||
|
|
628c68c24f | ||
|
|
e0f9b77846 | ||
|
|
89d6d626e9 | ||
|
|
efb28419b9 | ||
|
|
57dcd1d399 | ||
|
|
39c675b3d3 | ||
|
|
19195fa23b | ||
|
|
bfb65dd1ad | ||
|
|
2a77d8fdd8 | ||
|
|
b88c2ef937 | ||
|
|
02815b9cf0 | ||
|
|
d4c919c9be | ||
|
|
a520f3c6c3 | ||
|
|
2a9833be38 | ||
|
|
58fa1eceac | ||
|
|
7cd01ded19 | ||
|
|
2f35f877f2 | ||
|
|
637bddf83b | ||
|
|
ae54d21e24 | ||
|
|
e082553d0d | ||
|
|
87810cc010 | ||
|
|
febc6bb76b | ||
|
|
dbf1961f16 | ||
|
|
9cc044dc4a | ||
|
|
62f949de5f | ||
|
|
2f8c923fe8 | ||
|
|
a57184e42d | ||
|
|
e621882b63 | ||
|
|
cb6c305ade | ||
|
|
739dc3359a | ||
|
|
6bd3a9d59d | ||
|
|
85d21fe80e | ||
|
|
3683dc7e1e | ||
|
|
c73b5ef17e | ||
|
|
6e043b9b7b | ||
|
|
3f80a1be70 | ||
|
|
b668b54fd6 | ||
|
|
9ce6e1f1d8 | ||
|
|
560afea884 | ||
|
|
9a61d7fcff | ||
|
|
4d8c7f5c4f | ||
|
|
dfa0c1d7a3 | ||
|
|
4c3c3549a8 | ||
|
|
b8e37aca73 | ||
|
|
f71eb9d6ad | ||
|
|
991c0ec34f | ||
|
|
b32ceca18d | ||
|
|
58eb005851 | ||
|
|
56bce7c5af | ||
|
|
6e27a5c6b8 | ||
|
|
339167cdc3 | ||
|
|
a42e7ab7fe | ||
|
|
9e029b3f1c | ||
|
|
3fe93a64c9 | ||
|
|
648ad4b694 | ||
|
|
ca3a8c92ea | ||
|
|
f21072f4ec | ||
|
|
f02425b8be | ||
|
|
1e1521c8a3 | ||
|
|
6872bf7db3 | ||
|
|
3472911065 | ||
|
|
398faa6f1f | ||
|
|
5b9832fdcd | ||
|
|
da2a0c06a7 | ||
|
|
d79f303863 | ||
|
|
e2359e29e5 | ||
|
|
e6a0bd8549 | ||
|
|
e5e3bcfd2e | ||
|
|
59cbf7d15e | ||
|
|
9045b1a3eb | ||
|
|
8b4d93af4b | ||
|
|
2ada65e87a | ||
|
|
1096a21058 | ||
|
|
bcf4400aac | ||
|
|
d7a289c895 | ||
|
|
96fd279189 | ||
|
|
f6d5161bdb | ||
|
|
aab8b4a69b | ||
|
|
e1892d6527 | ||
|
|
24b3fe57fb | ||
|
|
9ea94f5bb1 | ||
|
|
4d66356c26 | ||
|
|
b8c732863f | ||
|
|
f92964937e | ||
|
|
8719a1ee2a | ||
|
|
1ffdcf4a3d | ||
|
|
1412d2907b | ||
|
|
228b4177e4 | ||
|
|
a5fc6b238c | ||
|
|
44a4eb8d67 | ||
|
|
c044cec3e4 | ||
|
|
4be4dd8419 | ||
|
|
26615700e6 | ||
|
|
b114204206 | ||
|
|
cc4c4c559f | ||
|
|
30ce4335db | ||
|
|
d49614beaf | ||
|
|
4a08971f46 | ||
|
|
52b430dca2 | ||
|
|
5c3009c6f6 | ||
|
|
0a68ab72dd | ||
|
|
63c759c525 | ||
|
|
d293a85cd0 | ||
|
|
c90d85f176 | ||
|
|
d42a360ec9 | ||
|
|
6c6e7fadb0 | ||
|
|
a7ce4bd1ae | ||
|
|
616069005b | ||
|
|
f110adfd92 | ||
|
|
aca1489ce0 | ||
|
|
c8324cd7e5 | ||
|
|
14d9c06763 | ||
|
|
67252942a4 | ||
|
|
570e5d9322 | ||
|
|
a02e8f7d61 | ||
|
|
014fda6eca | ||
|
|
0e100b83d0 | ||
|
|
cb821694c3 | ||
|
|
cc7f5678d2 |
27
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
27
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<!-- Thanks for sending a pull request! Here are some tips for you:
|
||||
1. Please read our contributor guidelines: https://docs.onepanel.ai/docs/getting-started/contributing
|
||||
2. Prefix the title of this PR with `feat:`, `fix:`, `docs:` or `chore:`, example: `feat: added great feature`
|
||||
3. If this PR is a feature or enhancement, then create an issue (https://github.com/onepanelio/core/issues) first.
|
||||
-->
|
||||
|
||||
**What this PR does**:
|
||||
|
||||
**Which issue(s) this PR fixes**:
|
||||
<!--
|
||||
*Automatically closes linked issue when PR is merged.
|
||||
Usage: `Fixes onepanelio/core#<issue-number>`
|
||||
-->
|
||||
Fixes onepanelio/core#
|
||||
|
||||
**Special notes for your reviewer**:
|
||||
|
||||
**Checklist**
|
||||
|
||||
Please check if applies
|
||||
|
||||
- [ ] I have added/updated relevant unit tests
|
||||
- [ ] I have added/updated relevant documentation
|
||||
|
||||
Required
|
||||
|
||||
- [ ] I accept to release these changes under the Apache 2.0 License
|
||||
4
.github/issue_label_bot.yaml
vendored
Normal file
4
.github/issue_label_bot.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
label-alias:
|
||||
bug: 'kind/bug'
|
||||
feature_request: 'kind/enhancement'
|
||||
question: 'kind/question'
|
||||
1
.github/semantic.yml
vendored
Normal file
1
.github/semantic.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
titleOnly: true
|
||||
38
.github/workflows/push_dev_branch.yaml
vendored
Normal file
38
.github/workflows/push_dev_branch.yaml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Publish dev docker image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
test-code-job:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:12.3
|
||||
env:
|
||||
POSTGRES_DB: onepanel
|
||||
POSTGRES_USER: admin
|
||||
POSTGRES_PASSWORD: tester
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Run testing code
|
||||
uses: cedrickring/golang-action@1.5.2
|
||||
with:
|
||||
args: go test github.com/onepanelio/core/pkg -db=postgres
|
||||
build:
|
||||
needs: test-code-job
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: onepanel/core
|
||||
tags: "dev"
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
16
.github/workflows/push_master.yaml
vendored
16
.github/workflows/push_master.yaml
vendored
@@ -1,16 +0,0 @@
|
||||
name: Publish Docker Master
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: onepanel/core
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
29
.github/workflows/push_tag.yaml
vendored
Normal file
29
.github/workflows/push_tag.yaml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Publish docker image on tag push
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: olegtarasov/get-tag@v2
|
||||
id: tagName
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: onepanel/core
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
tags: "${{ env.GIT_TAG_NAME }}"
|
||||
- name: Set Slack Message
|
||||
run: echo "::set-env name=SLACK_MESSAGE::Tag $GIT_TAG_NAME. Docker Tag onepanel/core:$GIT_TAG_NAME"
|
||||
- name: Notify Slack Channels
|
||||
uses: rtCamp/action-slack-notify@v2.0.0
|
||||
env:
|
||||
SLACK_CHANNEL: dev
|
||||
SLACK_ICON: https://avatars1.githubusercontent.com/u/30390575?s=48&v=4
|
||||
SLACK_TITLE: New Core Version
|
||||
SLACK_USERNAME: opBot
|
||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||
17
.github/workflows/push_to_dockerhub.yaml
vendored
17
.github/workflows/push_to_dockerhub.yaml
vendored
@@ -1,17 +0,0 @@
|
||||
name: Publish Docker
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: onepanel/core
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
snapshot: true
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,4 +3,5 @@
|
||||
.idea
|
||||
pocs
|
||||
__debug_bin
|
||||
openapi-generator-cli.jar
|
||||
vendor
|
||||
venv3
|
||||
127
CONTRIBUTING.md
127
CONTRIBUTING.md
@@ -21,7 +21,7 @@ Install gRPC:
|
||||
go get -u google.golang.org/grpc
|
||||
```
|
||||
|
||||
Download pre-compiled binaries for your platform(protoc-<version>-<platform>.zip) from here: https://github.com/google/protobuf/releases
|
||||
Download pre-compiled binaries for your platform (protoc-<version>-<platform>.zip) from here: https://github.com/google/protobuf/releases
|
||||
|
||||
On macOS or Linux:
|
||||
|
||||
@@ -49,5 +49,128 @@ Make sure that your `$GOBIN` is in your `$PATH`.
|
||||
|
||||
Generate Go and Swagger APIs:
|
||||
```bash
|
||||
make api
|
||||
make api version=1.0.0
|
||||
```
|
||||
|
||||
## Minikube Debugging and Development
|
||||
|
||||
It is possible to access host resources with minikube.
|
||||
- This means you can run core and core-ui on your machine, and have minikube
|
||||
execute API calls to your machine.
|
||||
|
||||
NOTE:
|
||||
- Do not use host access with Minikube and VMWare. This has been shown not to work
|
||||
in our testing.
|
||||
If you have a work-around, feel free to let us know.
|
||||
|
||||
To make this work, some setup is needed.
|
||||
- Minikube started with driver=virtualbox
|
||||
|
||||
Get your Minikube ssh IP
|
||||
https://minikube.sigs.k8s.io/docs/handbook/host-access/
|
||||
|
||||
```shell script
|
||||
minikube ssh "route -n | grep ^0.0.0.0 | awk '{ print \$2 }'"
|
||||
```
|
||||
Example output:
|
||||
```shell script
|
||||
10.0.2.2
|
||||
```
|
||||
|
||||
When running core api, add these ENV variables.
|
||||
```shell script
|
||||
ONEPANEL_CORE_SERVICE_HOST=10.0.2.2 # IP you just got
|
||||
ONEPANEL_CORE_SERVICE_PORT=8888 # HTTP Port set in main.go
|
||||
```
|
||||
|
||||
DB Access
|
||||
- You will need to change the Postgres service from ClusterIP to NodePort
|
||||
|
||||
Run
|
||||
```shell script
|
||||
minikube service list
|
||||
```
|
||||
|
||||
Look at Postgres, you'll see something like this:
|
||||
```shell script
|
||||
$ minikube service list
|
||||
|----------------------|----------------------------------------|--------------------|--------------------------------|
|
||||
| NAMESPACE | NAME | TARGET PORT | URL |
|
||||
|----------------------|----------------------------------------|--------------------|--------------------------------|
|
||||
| application-system | application-controller-manager-service | No node port |
|
||||
| default | kubernetes | No node port |
|
||||
| kube-system | kube-dns | No node port |
|
||||
| kubernetes-dashboard | dashboard-metrics-scraper | No node port |
|
||||
| kubernetes-dashboard | kubernetes-dashboard | No node port |
|
||||
| onepanel | onepanel-core | http/8888 | http://192.168.99.101:32000 |
|
||||
| | | grpc/8887 | http://192.168.99.101:32001 |
|
||||
| onepanel | onepanel-core-ui | http/80 | http://192.168.99.101:32002 |
|
||||
| onepanel | postgres | 5432 | http://192.168.99.101:31975 |
|
||||
|----------------------|----------------------------------------|--------------------|--------------------------------|
|
||||
```
|
||||
Grab `http://192.168.99.101:31975`
|
||||
Use this in main.go for the following lines:
|
||||
|
||||
```shell script
|
||||
databaseDataSourceName := fmt.Sprintf("port=31975 host=%v user=%v password=%v dbname=%v sslmode=disable",
|
||||
"192.168.99.101", config["databaseUsername"], config["databasePassword"], config["databaseName"])
|
||||
```
|
||||
This should connect your developing core to the minikube db.
|
||||
|
||||
After this, build main.go and run the executable.
|
||||
- Or use your IDE equivalent
|
||||
|
||||
## Code Structure & Organization
|
||||
|
||||
### `utils` dir
|
||||
|
||||
```shell script
|
||||
utils/*.go
|
||||
```
|
||||
|
||||
Utils are intended to stand-alone.
|
||||
- They do not track state
|
||||
- They are meant to mutate metadata
|
||||
|
||||
Do not add onepanel specific code in here.
|
||||
- Such as "Client"
|
||||
|
||||
```shell script
|
||||
pkg/*.go
|
||||
```
|
||||
Code here has to be package friendly.
|
||||
- Meaning, you can pull the code out into it's own package as needed
|
||||
|
||||
That's why you see
|
||||
```shell script
|
||||
workspace_template.go
|
||||
workspace_template_test.go
|
||||
workspace_template_types.go
|
||||
```
|
||||
These can be pulled out into their own package or into a new v2 directory if needed.
|
||||
|
||||
You can add
|
||||
- kubernetes specific operations
|
||||
- database specific operations
|
||||
- types
|
||||
|
||||
### `cmd` dir
|
||||
Each source file here is assumed to result in an executable.
|
||||
- Hence the `package main` at the top of each
|
||||
|
||||
Place each source file into it's own folder.
|
||||
Example source file name: `flush_cache.go`
|
||||
- Dir structure: `cmd/flush-cache/flush_cache.go`
|
||||
|
||||
To avoid errors like this during docker build
|
||||
```text
|
||||
# github.com/onepanelio/core/cmd
|
||||
cmd/goose.go:22:6: main redeclared in this block
|
||||
previous declaration at cmd/gen-release-md.go:136:6
|
||||
github.com/onepanelio/core
|
||||
```
|
||||
Caused by
|
||||
```dockerfile
|
||||
RUN go install -v ./...
|
||||
```
|
||||
|
||||
|
||||
10
Dockerfile
10
Dockerfile
@@ -1,17 +1,19 @@
|
||||
FROM golang:1.13.8 AS builder
|
||||
FROM golang:1.13.10 AS builder
|
||||
|
||||
WORKDIR /go/src
|
||||
COPY . .
|
||||
|
||||
RUN go get -d -v ./...
|
||||
RUN go install -v ./...
|
||||
RUN go get -u github.com/pressly/goose/cmd/goose
|
||||
RUN go build -o /go/bin/goose ./cmd/goose/goose.go
|
||||
|
||||
|
||||
FROM golang:1.13.8
|
||||
FROM golang:1.13.10
|
||||
COPY --from=builder /go/bin/core .
|
||||
COPY --from=builder /go/src/db ./db
|
||||
COPY --from=builder /go/bin/goose .
|
||||
|
||||
EXPOSE 8888
|
||||
EXPOSE 8887
|
||||
|
||||
CMD ["./core"]
|
||||
CMD ["./core"]
|
||||
|
||||
203
LICENSE
Normal file
203
LICENSE
Normal file
@@ -0,0 +1,203 @@
|
||||
Copyright 2020 Onepanel, Inc. All rights reserved.
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
25
Makefile
25
Makefile
@@ -1,7 +1,17 @@
|
||||
COMMIT_HASH=$(shell git rev-parse --short HEAD)
|
||||
|
||||
.PHONY: init
|
||||
|
||||
init:
|
||||
ifndef version
|
||||
$(error version is undefined)
|
||||
endif
|
||||
|
||||
jq:
|
||||
cat api/apidocs.swagger.json \
|
||||
| jq 'walk( if type == "object" then with_entries( .key |= sub( "api\\."; "") ) else . end )' \
|
||||
| jq 'walk( if type == "string" then gsub( "api\\."; "") else . end )' \
|
||||
| jq '.info.version = "$(version)"' \
|
||||
> api/api.swagger.json
|
||||
rm api/apidocs.swagger.json
|
||||
|
||||
@@ -12,17 +22,20 @@ protoc:
|
||||
api/*.proto \
|
||||
--go_out=plugins=grpc:api \
|
||||
--grpc-gateway_out=logtostderr=true,allow_delete_body=true:api \
|
||||
--swagger_out=allow_merge=true,fqn_for_swagger_name=true,allow_delete_body=true,logtostderr=true:api
|
||||
--swagger_out=allow_merge=true,fqn_for_swagger_name=true,allow_delete_body=true,logtostderr=true,simple_operation_ids=true:api
|
||||
|
||||
api: protoc jq
|
||||
api: init protoc jq
|
||||
|
||||
docker-build:
|
||||
docker build -t onepanel-core .
|
||||
docker tag onepanel-core:latest onepanel/core:1.0.0-beta.1
|
||||
docker tag onepanel-core:latest onepanel/core:$(COMMIT_HASH)
|
||||
|
||||
docker-push:
|
||||
docker push onepanel/core:1.0.0-beta.1
|
||||
docker push onepanel/core:$(COMMIT_HASH)
|
||||
|
||||
docker-all: docker-build docker-push
|
||||
docker: docker-build docker-push
|
||||
|
||||
all: api
|
||||
run-tests:
|
||||
docker run --rm --name test-onepanel-postgres -p 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=tester -e POSTGRES_DB=onepanel -d postgres:12.3
|
||||
go test github.com/onepanelio/core/pkg -count=1 ||:
|
||||
docker stop test-onepanel-postgres
|
||||
107
README.md
107
README.md
@@ -1,10 +1,107 @@
|
||||
# Onepanel
|
||||
<img width="240px" src="img/logo.png">
|
||||
|
||||
Welcome to Onepanel! This is the main repository for the API and also where you can submit bugs and enhancement requests.
|
||||

|
||||

|
||||
[](https://github.com/onepanelio/core/releases)
|
||||
[](https://pypi.org/project/onepanel-sdk/)
|
||||
[](https://docs.onepanel.io)
|
||||
[](https://github.com/onepanelio/core/issues)
|
||||
[](https://onepanel-ce.slack.com/join/shared_invite/zt-eyjnwec0-nLaHhjif9Y~gA05KuX6AUg#/)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||
|
||||
## Getting started
|
||||
See our [deployment guide](https://onepanelio.github.io/core-docs/docs/deployment/overview) to get started.
|
||||
Production scale, Kubernetes-native vision AI platform, with fully integrated components for model building, automated labeling, data processing and model training pipelines.
|
||||
|
||||
## Why Onepanel?
|
||||
|
||||
- End-to-end workflow and infrastructure automation for production scale vision AI
|
||||
- Automatic resource management and on-demand scaling of CPU and GPU nodes
|
||||
- Easily scale your data processing and training pipelines to multiple nodes
|
||||
- Collaborate on all your deep learning tools and workflows through a unified web interface and SDKs
|
||||
- Scalability, flexibility and resiliency of Kubernetes without the deployment and configuration complexities
|
||||
|
||||
## Features
|
||||
<table>
|
||||
<tr>
|
||||
<td width="50%" align="center">
|
||||
<h3>Image and video annotation with automatic annotation</h3>
|
||||
<img width="100%" src="img/auto-annotation.gif">
|
||||
<p>
|
||||
Annotate images and video with automatic annotation of bounding boxes and polygon masks, integrated with training pipelines to iteratively improve models for pre-annotation and inference
|
||||
</p>
|
||||
</td>
|
||||
<td width="50%" align="center">
|
||||
<h3>JupyterLab with TensorFlow, PyTorch and GPU support</h3>
|
||||
<img width="100%" src="img/jupyterlab.gif">
|
||||
<p>
|
||||
JupyterLab configured with extensions for debugging, Git/GitHub, notebook diffing and TensorBoard and support for Conda, OpenCV, Tensorflow and PyTorch with GPU and <a href="https://github.com/onepanelio/templates/tree/master/workspaces/jupyterlab">much more</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="50%" align="center">
|
||||
<h3>Auto scaling, distributed and parallel data processing and training pipelines</h3>
|
||||
<img width="100%" src="img/pipelines.gif">
|
||||
<p>
|
||||
Build fully reproducible, distributed and parallel data processing and training pipelines with real-time logs and output snapshots
|
||||
</p>
|
||||
</td>
|
||||
<td width="50%" align="center">
|
||||
<h3>Version controlled pipelines and environments as code</h3>
|
||||
<img width="100%" src="img/tools.gif">
|
||||
<p>
|
||||
Bring your own IDEs, annotation tools and pipelines with a version controlled YAML and Docker based template engine
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
- Track and visualize model metrics and experiments with TensorBoard or bring your own experiment tracking tools.
|
||||
- Access and share tools like AirSim, Carla, Gazebo or OpenAI Gym through your browser with VNC enabled workspaces.
|
||||
- Extend Onepanel with powerful REST APIs and SDKs to further automate your pipelines and environments.
|
||||
- Workflows, environments and infrastructure are all defined as code and version controlled, making them reproducible and portable.
|
||||
- Powered by Kubernetes so you can deploy anywhere Kubernetes can run.
|
||||
|
||||
## Quick start
|
||||
See [quick start guide](https://docs.onepanel.ai/docs/getting-started/quickstart) to get started with the platform of your choice.
|
||||
|
||||
### Quick start videos
|
||||
[Getting started with Microsoft Azure](https://youtu.be/CQBIYfBk3Zk)\
|
||||
[Getting started with Amazon EKS](https://youtu.be/Ipdd8f6D6IM)\
|
||||
[Getting started with Google GKE](https://youtu.be/pZRO63SnQ8A)
|
||||
|
||||
## Community
|
||||
See [documentation](https://docs.onepanel.ai) to get started or for more detailed operational and user guides.
|
||||
|
||||
To submit a feature request, report a bug or documentation issue, please open a GitHub [pull request](https://github.com/onepanelio/core/pulls) or [issue](https://github.com/onepanelio/core/issues).
|
||||
|
||||
For help, questions, release announcements and contribution discussions, join us on [Slack](https://join.slack.com/t/onepanel-ce/shared_invite/zt-eyjnwec0-nLaHhjif9Y~gA05KuX6AUg).
|
||||
|
||||
## Contributing
|
||||
|
||||
See our [contribution guide](https://onepanelio.github.io/core-docs/docs/getting-started/contributing) to get started.
|
||||
Onepanel is modular and consists of the following repositories:
|
||||
|
||||
[Core API](https://github.com/onepanelio/core/) (this repository) - Code base for backend (Go)\
|
||||
[Core UI](https://github.com/onepanelio/core-ui/) - Code base for UI (Angular + TypeScript)\
|
||||
[CLI](https://github.com/onepanelio/cli/) - Code base for Go CLI for installation and management (Go)\
|
||||
[Manifests](https://github.com/onepanelio/core-ui/) - Kustomize manifests used by CLI for installation and management (YAML)\
|
||||
[Python SDK](https://github.com/onepanelio/python-sdk/) - Python SDK code and documentation\
|
||||
[Templates](https://github.com/onepanelio/templates) - Various Workspace, Workflow, Task and Sidecar Templates\
|
||||
[Documentation](https://github.com/onepanelio/core-docs/) - The repository for documentation site\
|
||||
[API Documentation](https://github.com/onepanelio/core-api-docs/) - API documentation if you choose to use the API directly
|
||||
|
||||
See `CONTRIBUTING.md` in each repository for development guidelines. Also, see [contribution guide](https://docs.onepanel.ai/docs/getting-started/contributing) for additional guidelines.
|
||||
|
||||
|
||||
## Acknowledgments
|
||||
Onepanel seamlessly integrates the following excellent open source projects. We are grateful for the support these communities provide and do our best to contribute back as much as possible.
|
||||
|
||||
[Argo](https://github.com/argoproj/argo)\
|
||||
[CVAT](https://github.com/opencv/cvat)\
|
||||
[JupyterLab](https://github.com/jupyterlab/jupyterlab)
|
||||
|
||||
|
||||
## License
|
||||
Onepanel is licensed under [Apache 2.0](https://github.com/onepanelio/core/blob/master/LICENSE).
|
||||
|
||||
## Need a managed solution?
|
||||
Visit our [website](https://www.onepanel.io/) for more information about our managed offerings.
|
||||
|
||||
103
api/api.pb.go
103
api/api.pb.go
@@ -1,45 +1,86 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: api.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"
|
||||
math "math"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }
|
||||
var File_api_proto protoreflect.FileDescriptor
|
||||
|
||||
var fileDescriptor_00212fb1f9d3bf1c = []byte{
|
||||
// 265 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x3f, 0x4b, 0xf4, 0x40,
|
||||
0x10, 0x87, 0xdf, 0x77, 0x85, 0x43, 0x57, 0x4f, 0x64, 0xc1, 0xc2, 0xab, 0x96, 0xab, 0x44, 0x2e,
|
||||
0xd9, 0xbb, 0xb3, 0x09, 0x11, 0x8b, 0x9c, 0x85, 0x5c, 0xa5, 0xb5, 0xdd, 0x64, 0x1d, 0x93, 0x3d,
|
||||
0xe3, 0xce, 0xb2, 0x99, 0xe0, 0x9f, 0x2f, 0x60, 0x61, 0xe7, 0x27, 0x16, 0x92, 0x43, 0x10, 0xed,
|
||||
0x9e, 0x99, 0x79, 0x66, 0x18, 0x7e, 0x72, 0x0f, 0x82, 0x4b, 0x43, 0x24, 0x26, 0xb5, 0x03, 0xc1,
|
||||
0x4d, 0x66, 0x3d, 0xdb, 0xa4, 0x42, 0x9f, 0xb4, 0xcf, 0x50, 0x55, 0x18, 0x0d, 0x05, 0x76, 0xe4,
|
||||
0x5b, 0x03, 0xde, 0x13, 0x43, 0xcf, 0xc3, 0xca, 0xea, 0x43, 0x7c, 0x16, 0xef, 0x42, 0xb1, 0x1c,
|
||||
0xdf, 0x78, 0x0c, 0xe0, 0xb1, 0xd1, 0x57, 0x14, 0x51, 0x9d, 0xfc, 0x28, 0x75, 0x88, 0xb4, 0x41,
|
||||
0xcb, 0xba, 0xb8, 0x5d, 0x4f, 0x2f, 0xe4, 0xf1, 0x9f, 0x43, 0x35, 0xad, 0x99, 0x43, 0x9b, 0x1b,
|
||||
0x53, 0x39, 0xae, 0xbb, 0x32, 0xb5, 0xf4, 0x64, 0x68, 0x6b, 0x3a, 0x32, 0x96, 0x22, 0x2e, 0xf7,
|
||||
0x17, 0xe9, 0x3c, 0x9d, 0x27, 0x25, 0x32, 0x2c, 0x26, 0x87, 0x0d, 0x59, 0x68, 0x6a, 0x6a, 0x39,
|
||||
0xcf, 0xb2, 0x2c, 0x3b, 0x13, 0xff, 0xc5, 0xf2, 0x08, 0x42, 0x68, 0x9c, 0xed, 0x9f, 0x34, 0x9b,
|
||||
0x96, 0x7c, 0xfe, 0xab, 0x73, 0xb7, 0x96, 0xd7, 0x72, 0xb4, 0x42, 0x88, 0x18, 0xd5, 0xe5, 0xae,
|
||||
0x50, 0xa7, 0x45, 0xc7, 0x35, 0x7a, 0xde, 0x4a, 0x9a, 0xe9, 0x11, 0xfd, 0x4c, 0x87, 0x88, 0x0f,
|
||||
0xee, 0x05, 0xef, 0x75, 0xf9, 0xaa, 0x07, 0x7b, 0x32, 0x86, 0x8e, 0x6b, 0x8a, 0xee, 0x6d, 0x10,
|
||||
0x45, 0x79, 0x20, 0xe5, 0xf7, 0xa9, 0x7f, 0xe5, 0xa8, 0x0f, 0xe5, 0xfc, 0x2b, 0x00, 0x00, 0xff,
|
||||
0xff, 0x51, 0x1b, 0x37, 0x84, 0x54, 0x01, 0x00, 0x00,
|
||||
var file_api_proto_rawDesc = []byte{
|
||||
0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70, 0x69,
|
||||
0x1a, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x73, 0x77, 0x61,
|
||||
0x67, 0x67, 0x65, 0x72, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e,
|
||||
0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x89,
|
||||
0x02, 0x92, 0x41, 0x85, 0x02, 0x12, 0x58, 0x0a, 0x08, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65,
|
||||
0x6c, 0x12, 0x0c, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x20, 0x41, 0x50, 0x49, 0x22,
|
||||
0x36, 0x0a, 0x10, 0x4f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x20, 0x70, 0x72, 0x6f, 0x6a,
|
||||
0x65, 0x63, 0x74, 0x12, 0x22, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x65, 0x70, 0x61, 0x6e, 0x65, 0x6c,
|
||||
0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x32, 0x06, 0x30, 0x2e, 0x31, 0x30, 0x2e, 0x30, 0x1a,
|
||||
0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x3a, 0x38, 0x38, 0x38, 0x38, 0x2a,
|
||||
0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x18, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61,
|
||||
0x6d, 0x5a, 0x49, 0x0a, 0x47, 0x0a, 0x06, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x3d, 0x08,
|
||||
0x02, 0x12, 0x28, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65,
|
||||
0x64, 0x20, 0x62, 0x79, 0x20, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x1a, 0x0d, 0x61, 0x75, 0x74,
|
||||
0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x62, 0x0c, 0x0a, 0x0a,
|
||||
0x0a, 0x06, 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var file_api_proto_goTypes = []interface{}{}
|
||||
var file_api_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_proto_init() }
|
||||
func file_api_proto_init() {
|
||||
if File_api_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_api_proto_goTypes,
|
||||
DependencyIndexes: file_api_proto_depIdxs,
|
||||
}.Build()
|
||||
File_api_proto = out.File
|
||||
file_api_proto_rawDesc = nil
|
||||
file_api_proto_goTypes = nil
|
||||
file_api_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ import "protoc-gen-swagger/options/annotations.proto";
|
||||
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
|
||||
info: {
|
||||
title: "Onepanel Core";
|
||||
description: "Onepanel Core project API";
|
||||
version: "1.0.0-beta1";
|
||||
title: "Onepanel";
|
||||
description: "Onepanel API";
|
||||
version: "0.10.0";
|
||||
contact: {
|
||||
name: "Onepanel Core project";
|
||||
name: "Onepanel project";
|
||||
url: "https://github.com/onepanelio/core";
|
||||
};
|
||||
};
|
||||
@@ -19,6 +19,7 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
|
||||
schemes: HTTPS;
|
||||
consumes: "application/json";
|
||||
produces: "application/json";
|
||||
produces: "application/octet-stream";
|
||||
security_definitions: {
|
||||
security: {
|
||||
key: "Bearer";
|
||||
@@ -36,4 +37,4 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
|
||||
value: {};
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
2804
api/api.swagger.json
2804
api/api.swagger.json
File diff suppressed because it is too large
Load Diff
580
api/auth.pb.go
580
api/auth.pb.go
@@ -1,117 +1,526 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: auth.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
_ "github.com/golang/protobuf/ptypes/empty"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type IsValidTokenResponse struct {
|
||||
Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
type IsAuthorized struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Verb string `protobuf:"bytes,2,opt,name=verb,proto3" json:"verb,omitempty"`
|
||||
Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"`
|
||||
Resource string `protobuf:"bytes,4,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
ResourceName string `protobuf:"bytes,5,opt,name=resourceName,proto3" json:"resourceName,omitempty"`
|
||||
}
|
||||
|
||||
func (m *IsValidTokenResponse) Reset() { *m = IsValidTokenResponse{} }
|
||||
func (m *IsValidTokenResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*IsValidTokenResponse) ProtoMessage() {}
|
||||
func (*IsValidTokenResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_8bbd6f3875b0e874, []int{0}
|
||||
func (x *IsAuthorized) Reset() {
|
||||
*x = IsAuthorized{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *IsValidTokenResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_IsValidTokenResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *IsValidTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_IsValidTokenResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *IsValidTokenResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_IsValidTokenResponse.Merge(m, src)
|
||||
}
|
||||
func (m *IsValidTokenResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_IsValidTokenResponse.Size(m)
|
||||
}
|
||||
func (m *IsValidTokenResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_IsValidTokenResponse.DiscardUnknown(m)
|
||||
func (x *IsAuthorized) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_IsValidTokenResponse proto.InternalMessageInfo
|
||||
func (*IsAuthorized) ProtoMessage() {}
|
||||
|
||||
func (m *IsValidTokenResponse) GetValid() bool {
|
||||
if m != nil {
|
||||
return m.Valid
|
||||
func (x *IsAuthorized) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IsAuthorized.ProtoReflect.Descriptor instead.
|
||||
func (*IsAuthorized) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *IsAuthorized) GetNamespace() string {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IsAuthorized) GetVerb() string {
|
||||
if x != nil {
|
||||
return x.Verb
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IsAuthorized) GetGroup() string {
|
||||
if x != nil {
|
||||
return x.Group
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IsAuthorized) GetResource() string {
|
||||
if x != nil {
|
||||
return x.Resource
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IsAuthorized) GetResourceName() string {
|
||||
if x != nil {
|
||||
return x.ResourceName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type IsAuthorizedRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
IsAuthorized *IsAuthorized `protobuf:"bytes,1,opt,name=isAuthorized,proto3" json:"isAuthorized,omitempty"`
|
||||
}
|
||||
|
||||
func (x *IsAuthorizedRequest) Reset() {
|
||||
*x = IsAuthorizedRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *IsAuthorizedRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IsAuthorizedRequest) ProtoMessage() {}
|
||||
|
||||
func (x *IsAuthorizedRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IsAuthorizedRequest.ProtoReflect.Descriptor instead.
|
||||
func (*IsAuthorizedRequest) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *IsAuthorizedRequest) GetIsAuthorized() *IsAuthorized {
|
||||
if x != nil {
|
||||
return x.IsAuthorized
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type IsAuthorizedResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"`
|
||||
}
|
||||
|
||||
func (x *IsAuthorizedResponse) Reset() {
|
||||
*x = IsAuthorizedResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *IsAuthorizedResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IsAuthorizedResponse) ProtoMessage() {}
|
||||
|
||||
func (x *IsAuthorizedResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IsAuthorizedResponse.ProtoReflect.Descriptor instead.
|
||||
func (*IsAuthorizedResponse) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *IsAuthorizedResponse) GetAuthorized() bool {
|
||||
if x != nil {
|
||||
return x.Authorized
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*IsValidTokenResponse)(nil), "api.IsValidTokenResponse")
|
||||
type IsValidTokenRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
|
||||
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("auth.proto", fileDescriptor_8bbd6f3875b0e874) }
|
||||
func (x *IsValidTokenRequest) Reset() {
|
||||
*x = IsValidTokenRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
var fileDescriptor_8bbd6f3875b0e874 = []byte{
|
||||
// 200 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0x2c, 0x2d, 0xc9,
|
||||
0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x2c, 0xc8, 0x94, 0x92, 0x49, 0xcf, 0xcf,
|
||||
0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9,
|
||||
0xcc, 0xcf, 0x2b, 0x86, 0x28, 0x91, 0x92, 0x86, 0xca, 0x82, 0x79, 0x49, 0xa5, 0x69, 0xfa, 0xa9,
|
||||
0xb9, 0x05, 0x25, 0x95, 0x10, 0x49, 0x25, 0x1d, 0x2e, 0x11, 0xcf, 0xe2, 0xb0, 0xc4, 0x9c, 0xcc,
|
||||
0x94, 0x90, 0xfc, 0xec, 0xd4, 0xbc, 0xa0, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x11,
|
||||
0x2e, 0xd6, 0x32, 0x90, 0xa8, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x47, 0x10, 0x84, 0x63, 0x54, 0xc4,
|
||||
0xc5, 0xed, 0x58, 0x5a, 0x92, 0x11, 0x9c, 0x5a, 0x54, 0x96, 0x99, 0x9c, 0x2a, 0x94, 0xcc, 0xc5,
|
||||
0x83, 0xac, 0x59, 0x48, 0x4c, 0x0f, 0x62, 0x95, 0x1e, 0xcc, 0x2a, 0x3d, 0x57, 0x90, 0x55, 0x52,
|
||||
0x92, 0x7a, 0x89, 0x05, 0x99, 0x7a, 0xd8, 0xec, 0x51, 0x52, 0x68, 0xba, 0xfc, 0x64, 0x32, 0x93,
|
||||
0x94, 0x90, 0x04, 0xc8, 0xf1, 0xc5, 0xfa, 0x65, 0x86, 0x49, 0xa9, 0x25, 0x89, 0x86, 0xfa, 0x20,
|
||||
0x1f, 0xea, 0x97, 0x80, 0x54, 0x26, 0xb1, 0x81, 0x0d, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff,
|
||||
0x50, 0x28, 0xf6, 0x19, 0xf6, 0x00, 0x00, 0x00,
|
||||
func (x *IsValidTokenRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IsValidTokenRequest) ProtoMessage() {}
|
||||
|
||||
func (x *IsValidTokenRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IsValidTokenRequest.ProtoReflect.Descriptor instead.
|
||||
func (*IsValidTokenRequest) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *IsValidTokenRequest) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IsValidTokenRequest) GetToken() string {
|
||||
if x != nil {
|
||||
return x.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type IsValidTokenResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
|
||||
JwtToken string `protobuf:"bytes,2,opt,name=jwtToken,proto3" json:"jwtToken,omitempty"`
|
||||
Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`
|
||||
}
|
||||
|
||||
func (x *IsValidTokenResponse) Reset() {
|
||||
*x = IsValidTokenResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_auth_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *IsValidTokenResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*IsValidTokenResponse) ProtoMessage() {}
|
||||
|
||||
func (x *IsValidTokenResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_auth_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use IsValidTokenResponse.ProtoReflect.Descriptor instead.
|
||||
func (*IsValidTokenResponse) Descriptor() ([]byte, []int) {
|
||||
return file_auth_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *IsValidTokenResponse) GetDomain() string {
|
||||
if x != nil {
|
||||
return x.Domain
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IsValidTokenResponse) GetJwtToken() string {
|
||||
if x != nil {
|
||||
return x.JwtToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *IsValidTokenResponse) GetUsername() string {
|
||||
if x != nil {
|
||||
return x.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_auth_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_auth_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61, 0x70,
|
||||
0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
|
||||
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
|
||||
0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x01, 0x0a,
|
||||
0x0c, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76,
|
||||
0x65, 0x72, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||
0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d,
|
||||
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x13, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f,
|
||||
0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x0c,
|
||||
0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f,
|
||||
0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x0c, 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x22, 0x36, 0x0a, 0x14, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61,
|
||||
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x47, 0x0a, 0x13, 0x49,
|
||||
0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x66, 0x0a, 0x14, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54,
|
||||
0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6a, 0x77, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x77, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xe6, 0x01, 0x0a,
|
||||
0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x0c,
|
||||
0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x2e, 0x61,
|
||||
0x70, 0x69, 0x2e, 0x49, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x56,
|
||||
0x61, 0x6c, 0x69, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x73,
|
||||
0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x74, 0x6f,
|
||||
0x6b, 0x65, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x6d, 0x0a, 0x0c, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x41,
|
||||
0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4,
|
||||
0x93, 0x02, 0x22, 0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74,
|
||||
0x61, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x3a, 0x0c, 0x69, 0x73, 0x41, 0x75, 0x74, 0x68, 0x6f,
|
||||
0x72, 0x69, 0x7a, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_auth_proto_rawDescOnce sync.Once
|
||||
file_auth_proto_rawDescData = file_auth_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_auth_proto_rawDescGZIP() []byte {
|
||||
file_auth_proto_rawDescOnce.Do(func() {
|
||||
file_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_auth_proto_rawDescData)
|
||||
})
|
||||
return file_auth_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_auth_proto_goTypes = []interface{}{
|
||||
(*IsAuthorized)(nil), // 0: api.IsAuthorized
|
||||
(*IsAuthorizedRequest)(nil), // 1: api.IsAuthorizedRequest
|
||||
(*IsAuthorizedResponse)(nil), // 2: api.IsAuthorizedResponse
|
||||
(*IsValidTokenRequest)(nil), // 3: api.IsValidTokenRequest
|
||||
(*IsValidTokenResponse)(nil), // 4: api.IsValidTokenResponse
|
||||
}
|
||||
var file_auth_proto_depIdxs = []int32{
|
||||
0, // 0: api.IsAuthorizedRequest.isAuthorized:type_name -> api.IsAuthorized
|
||||
3, // 1: api.AuthService.IsValidToken:input_type -> api.IsValidTokenRequest
|
||||
1, // 2: api.AuthService.IsAuthorized:input_type -> api.IsAuthorizedRequest
|
||||
4, // 3: api.AuthService.IsValidToken:output_type -> api.IsValidTokenResponse
|
||||
2, // 4: api.AuthService.IsAuthorized:output_type -> api.IsAuthorizedResponse
|
||||
3, // [3:5] is the sub-list for method output_type
|
||||
1, // [1:3] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_auth_proto_init() }
|
||||
func file_auth_proto_init() {
|
||||
if File_auth_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IsAuthorized); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IsAuthorizedRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IsAuthorizedResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IsValidTokenRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*IsValidTokenResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_auth_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_auth_proto_goTypes,
|
||||
DependencyIndexes: file_auth_proto_depIdxs,
|
||||
MessageInfos: file_auth_proto_msgTypes,
|
||||
}.Build()
|
||||
File_auth_proto = out.File
|
||||
file_auth_proto_rawDesc = nil
|
||||
file_auth_proto_goTypes = nil
|
||||
file_auth_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConn
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// AuthServiceClient is the client API for AuthService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type AuthServiceClient interface {
|
||||
IsValidToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*IsValidTokenResponse, error)
|
||||
IsValidToken(ctx context.Context, in *IsValidTokenRequest, opts ...grpc.CallOption) (*IsValidTokenResponse, error)
|
||||
IsAuthorized(ctx context.Context, in *IsAuthorizedRequest, opts ...grpc.CallOption) (*IsAuthorizedResponse, error)
|
||||
}
|
||||
|
||||
type authServiceClient struct {
|
||||
cc *grpc.ClientConn
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuthServiceClient(cc *grpc.ClientConn) AuthServiceClient {
|
||||
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
||||
return &authServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *authServiceClient) IsValidToken(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*IsValidTokenResponse, error) {
|
||||
func (c *authServiceClient) IsValidToken(ctx context.Context, in *IsValidTokenRequest, opts ...grpc.CallOption) (*IsValidTokenResponse, error) {
|
||||
out := new(IsValidTokenResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.AuthService/IsValidToken", in, out, opts...)
|
||||
if err != nil {
|
||||
@@ -120,25 +529,38 @@ func (c *authServiceClient) IsValidToken(ctx context.Context, in *empty.Empty, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) IsAuthorized(ctx context.Context, in *IsAuthorizedRequest, opts ...grpc.CallOption) (*IsAuthorizedResponse, error) {
|
||||
out := new(IsAuthorizedResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.AuthService/IsAuthorized", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthServiceServer is the server API for AuthService service.
|
||||
type AuthServiceServer interface {
|
||||
IsValidToken(context.Context, *empty.Empty) (*IsValidTokenResponse, error)
|
||||
IsValidToken(context.Context, *IsValidTokenRequest) (*IsValidTokenResponse, error)
|
||||
IsAuthorized(context.Context, *IsAuthorizedRequest) (*IsAuthorizedResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedAuthServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedAuthServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedAuthServiceServer) IsValidToken(ctx context.Context, req *empty.Empty) (*IsValidTokenResponse, error) {
|
||||
func (*UnimplementedAuthServiceServer) IsValidToken(context.Context, *IsValidTokenRequest) (*IsValidTokenResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IsValidToken not implemented")
|
||||
}
|
||||
func (*UnimplementedAuthServiceServer) IsAuthorized(context.Context, *IsAuthorizedRequest) (*IsAuthorizedResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IsAuthorized not implemented")
|
||||
}
|
||||
|
||||
func RegisterAuthServiceServer(s *grpc.Server, srv AuthServiceServer) {
|
||||
s.RegisterService(&_AuthService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _AuthService_IsValidToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
in := new(IsValidTokenRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -150,7 +572,25 @@ func _AuthService_IsValidToken_Handler(srv interface{}, ctx context.Context, dec
|
||||
FullMethod: "/api.AuthService/IsValidToken",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).IsValidToken(ctx, req.(*empty.Empty))
|
||||
return srv.(AuthServiceServer).IsValidToken(ctx, req.(*IsValidTokenRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_IsAuthorized_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IsAuthorizedRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).IsAuthorized(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.AuthService/IsAuthorized",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).IsAuthorized(ctx, req.(*IsAuthorizedRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -163,6 +603,10 @@ var _AuthService_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "IsValidToken",
|
||||
Handler: _AuthService_IsValidToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IsAuthorized",
|
||||
Handler: _AuthService_IsAuthorized_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "auth.proto",
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
@@ -33,29 +32,79 @@ var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_AuthService_IsValidToken_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var protoReq IsValidTokenRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.IsValidToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_AuthService_IsValidToken_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var protoReq IsValidTokenRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.IsValidToken(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_AuthService_IsAuthorized_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq IsAuthorizedRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IsAuthorized); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.IsAuthorized(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_AuthService_IsAuthorized_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq IsAuthorizedRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IsAuthorized); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.IsAuthorized(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux".
|
||||
// UnaryRPC :call AuthServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_AuthService_IsValidToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("POST", pattern_AuthService_IsValidToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
@@ -75,6 +124,26 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_IsAuthorized_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_AuthService_IsAuthorized_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_IsAuthorized_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -116,7 +185,7 @@ func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn
|
||||
// "AuthServiceClient" to call the correct interceptors.
|
||||
func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_AuthService_IsValidToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("POST", pattern_AuthService_IsValidToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
@@ -136,13 +205,37 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_AuthService_IsAuthorized_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_AuthService_IsAuthorized_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_AuthService_IsAuthorized_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_AuthService_IsValidToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"apis", "v1beta1", "auth", "token"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_AuthService_IsAuthorized_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "auth"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_AuthService_IsValidToken_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_AuthService_IsAuthorized_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
@@ -6,13 +6,44 @@ import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service AuthService {
|
||||
rpc IsValidToken(google.protobuf.Empty) returns (IsValidTokenResponse) {
|
||||
rpc IsValidToken(IsValidTokenRequest) returns (IsValidTokenResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/auth/token"
|
||||
post: "/apis/v1beta1/auth/token"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
rpc IsAuthorized(IsAuthorizedRequest) returns (IsAuthorizedResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/auth"
|
||||
body: "isAuthorized"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message IsAuthorized {
|
||||
string namespace = 1;
|
||||
string verb = 2;
|
||||
string group = 3;
|
||||
string resource = 4;
|
||||
string resourceName = 5;
|
||||
}
|
||||
|
||||
message IsAuthorizedRequest {
|
||||
IsAuthorized isAuthorized = 1;
|
||||
}
|
||||
|
||||
message IsAuthorizedResponse {
|
||||
bool authorized = 1;
|
||||
}
|
||||
|
||||
message IsValidTokenRequest {
|
||||
string username = 1;
|
||||
string token = 2;
|
||||
}
|
||||
|
||||
message IsValidTokenResponse {
|
||||
bool valid = 1 ;
|
||||
string domain = 1;
|
||||
string jwtToken = 2;
|
||||
string username = 3;
|
||||
}
|
||||
287
api/common.pb.go
Normal file
287
api/common.pb.go
Normal file
@@ -0,0 +1,287 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: common.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Parameter struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
|
||||
DisplayName string `protobuf:"bytes,4,opt,name=displayName,proto3" json:"displayName,omitempty"`
|
||||
Hint string `protobuf:"bytes,5,opt,name=hint,proto3" json:"hint,omitempty"`
|
||||
Required bool `protobuf:"varint,6,opt,name=required,proto3" json:"required,omitempty"`
|
||||
Visibility string `protobuf:"bytes,7,opt,name=visibility,proto3" json:"visibility,omitempty"`
|
||||
Options []*ParameterOption `protobuf:"bytes,8,rep,name=options,proto3" json:"options,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Parameter) Reset() {
|
||||
*x = Parameter{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_common_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Parameter) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Parameter) ProtoMessage() {}
|
||||
|
||||
func (x *Parameter) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_common_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Parameter.ProtoReflect.Descriptor instead.
|
||||
func (*Parameter) Descriptor() ([]byte, []int) {
|
||||
return file_common_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Parameter) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Parameter) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Parameter) GetType() string {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Parameter) GetDisplayName() string {
|
||||
if x != nil {
|
||||
return x.DisplayName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Parameter) GetHint() string {
|
||||
if x != nil {
|
||||
return x.Hint
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Parameter) GetRequired() bool {
|
||||
if x != nil {
|
||||
return x.Required
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *Parameter) GetVisibility() string {
|
||||
if x != nil {
|
||||
return x.Visibility
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Parameter) GetOptions() []*ParameterOption {
|
||||
if x != nil {
|
||||
return x.Options
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ParameterOption struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ParameterOption) Reset() {
|
||||
*x = ParameterOption{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_common_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ParameterOption) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ParameterOption) ProtoMessage() {}
|
||||
|
||||
func (x *ParameterOption) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_common_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ParameterOption.ProtoReflect.Descriptor instead.
|
||||
func (*ParameterOption) Descriptor() ([]byte, []int) {
|
||||
return file_common_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ParameterOption) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ParameterOption) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_common_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_common_proto_rawDesc = []byte{
|
||||
0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
|
||||
0x61, 0x70, 0x69, 0x22, 0xeb, 0x01, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
|
||||
0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74,
|
||||
0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
|
||||
0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x04, 0x68, 0x69, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
|
||||
0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
|
||||
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18,
|
||||
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||
0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74,
|
||||
0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x22, 0x3b, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4f, 0x70,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_common_proto_rawDescOnce sync.Once
|
||||
file_common_proto_rawDescData = file_common_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_common_proto_rawDescGZIP() []byte {
|
||||
file_common_proto_rawDescOnce.Do(func() {
|
||||
file_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_proto_rawDescData)
|
||||
})
|
||||
return file_common_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_common_proto_goTypes = []interface{}{
|
||||
(*Parameter)(nil), // 0: api.Parameter
|
||||
(*ParameterOption)(nil), // 1: api.ParameterOption
|
||||
}
|
||||
var file_common_proto_depIdxs = []int32{
|
||||
1, // 0: api.Parameter.options:type_name -> api.ParameterOption
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_common_proto_init() }
|
||||
func file_common_proto_init() {
|
||||
if File_common_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Parameter); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ParameterOption); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_common_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_common_proto_goTypes,
|
||||
DependencyIndexes: file_common_proto_depIdxs,
|
||||
MessageInfos: file_common_proto_msgTypes,
|
||||
}.Build()
|
||||
File_common_proto = out.File
|
||||
file_common_proto_rawDesc = nil
|
||||
file_common_proto_goTypes = nil
|
||||
file_common_proto_depIdxs = nil
|
||||
}
|
||||
20
api/common.proto
Normal file
20
api/common.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
message Parameter {
|
||||
string name = 1;
|
||||
string value = 2;
|
||||
string type = 3;
|
||||
string displayName = 4;
|
||||
string hint = 5;
|
||||
bool required = 6;
|
||||
string visibility = 7;
|
||||
|
||||
repeated ParameterOption options = 8;
|
||||
}
|
||||
|
||||
message ParameterOption {
|
||||
string name = 1;
|
||||
string value = 2;
|
||||
}
|
||||
422
api/config.pb.go
Normal file
422
api/config.pb.go
Normal file
@@ -0,0 +1,422 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: config.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type GetConfigResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ApiUrl string `protobuf:"bytes,1,opt,name=apiUrl,proto3" json:"apiUrl,omitempty"`
|
||||
Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
|
||||
Fqdn string `protobuf:"bytes,3,opt,name=fqdn,proto3" json:"fqdn,omitempty"`
|
||||
NodePool *NodePool `protobuf:"bytes,4,opt,name=nodePool,proto3" json:"nodePool,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetConfigResponse) Reset() {
|
||||
*x = GetConfigResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_config_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetConfigResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetConfigResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetConfigResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_config_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetConfigResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetConfigResponse) Descriptor() ([]byte, []int) {
|
||||
return file_config_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetConfigResponse) GetApiUrl() string {
|
||||
if x != nil {
|
||||
return x.ApiUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetConfigResponse) GetDomain() string {
|
||||
if x != nil {
|
||||
return x.Domain
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetConfigResponse) GetFqdn() string {
|
||||
if x != nil {
|
||||
return x.Fqdn
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetConfigResponse) GetNodePool() *NodePool {
|
||||
if x != nil {
|
||||
return x.NodePool
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NodePoolOption struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NodePoolOption) Reset() {
|
||||
*x = NodePoolOption{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_config_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NodePoolOption) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NodePoolOption) ProtoMessage() {}
|
||||
|
||||
func (x *NodePoolOption) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_config_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NodePoolOption.ProtoReflect.Descriptor instead.
|
||||
func (*NodePoolOption) Descriptor() ([]byte, []int) {
|
||||
return file_config_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *NodePoolOption) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodePoolOption) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type NodePool struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
|
||||
Options []*NodePoolOption `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NodePool) Reset() {
|
||||
*x = NodePool{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_config_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NodePool) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NodePool) ProtoMessage() {}
|
||||
|
||||
func (x *NodePool) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_config_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NodePool.ProtoReflect.Descriptor instead.
|
||||
func (*NodePool) Descriptor() ([]byte, []int) {
|
||||
return file_config_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *NodePool) GetLabel() string {
|
||||
if x != nil {
|
||||
return x.Label
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodePool) GetOptions() []*NodePoolOption {
|
||||
if x != nil {
|
||||
return x.Options
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_config_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_config_proto_rawDesc = []byte{
|
||||
0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
|
||||
0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||
0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82,
|
||||
0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70,
|
||||
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x70, 0x69, 0x55, 0x72, 0x6c, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x70, 0x69, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x64, 0x6e, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x64, 0x6e, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65,
|
||||
0x50, 0x6f, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x50,
|
||||
0x6f, 0x6f, 0x6c, 0x22, 0x3a, 0x0a, 0x0e, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x4f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22,
|
||||
0x4f, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c,
|
||||
0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65,
|
||||
0x6c, 0x12, 0x2d, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x6f,
|
||||
0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
|
||||
0x32, 0x6a, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x59, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74,
|
||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c,
|
||||
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31,
|
||||
0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_config_proto_rawDescOnce sync.Once
|
||||
file_config_proto_rawDescData = file_config_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_config_proto_rawDescGZIP() []byte {
|
||||
file_config_proto_rawDescOnce.Do(func() {
|
||||
file_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_proto_rawDescData)
|
||||
})
|
||||
return file_config_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_config_proto_goTypes = []interface{}{
|
||||
(*GetConfigResponse)(nil), // 0: api.GetConfigResponse
|
||||
(*NodePoolOption)(nil), // 1: api.NodePoolOption
|
||||
(*NodePool)(nil), // 2: api.NodePool
|
||||
(*empty.Empty)(nil), // 3: google.protobuf.Empty
|
||||
}
|
||||
var file_config_proto_depIdxs = []int32{
|
||||
2, // 0: api.GetConfigResponse.nodePool:type_name -> api.NodePool
|
||||
1, // 1: api.NodePool.options:type_name -> api.NodePoolOption
|
||||
3, // 2: api.ConfigService.GetConfig:input_type -> google.protobuf.Empty
|
||||
0, // 3: api.ConfigService.GetConfig:output_type -> api.GetConfigResponse
|
||||
3, // [3:4] is the sub-list for method output_type
|
||||
2, // [2:3] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_config_proto_init() }
|
||||
func file_config_proto_init() {
|
||||
if File_config_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetConfigResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NodePoolOption); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NodePool); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_config_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_config_proto_goTypes,
|
||||
DependencyIndexes: file_config_proto_depIdxs,
|
||||
MessageInfos: file_config_proto_msgTypes,
|
||||
}.Build()
|
||||
File_config_proto = out.File
|
||||
file_config_proto_rawDesc = nil
|
||||
file_config_proto_goTypes = nil
|
||||
file_config_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// ConfigServiceClient is the client API for ConfigService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type ConfigServiceClient interface {
|
||||
GetConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetConfigResponse, error)
|
||||
}
|
||||
|
||||
type configServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewConfigServiceClient(cc grpc.ClientConnInterface) ConfigServiceClient {
|
||||
return &configServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *configServiceClient) GetConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetConfigResponse, error) {
|
||||
out := new(GetConfigResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.ConfigService/GetConfig", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ConfigServiceServer is the server API for ConfigService service.
|
||||
type ConfigServiceServer interface {
|
||||
GetConfig(context.Context, *empty.Empty) (*GetConfigResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedConfigServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedConfigServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedConfigServiceServer) GetConfig(context.Context, *empty.Empty) (*GetConfigResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented")
|
||||
}
|
||||
|
||||
func RegisterConfigServiceServer(s *grpc.Server, srv ConfigServiceServer) {
|
||||
s.RegisterService(&_ConfigService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _ConfigService_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ConfigServiceServer).GetConfig(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.ConfigService/GetConfig",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ConfigServiceServer).GetConfig(ctx, req.(*empty.Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _ConfigService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api.ConfigService",
|
||||
HandlerType: (*ConfigServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetConfig",
|
||||
Handler: _ConfigService_GetConfig_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "config.proto",
|
||||
}
|
||||
148
api/config.pb.gw.go
Normal file
148
api/config.pb.gw.go
Normal file
@@ -0,0 +1,148 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: config.proto
|
||||
|
||||
/*
|
||||
Package api is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_ConfigService_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ConfigServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := client.GetConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_ConfigService_GetConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ConfigServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.GetConfig(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterConfigServiceHandlerServer registers the http handlers for service ConfigService to "mux".
|
||||
// UnaryRPC :call ConfigServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterConfigServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConfigServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_ConfigService_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_ConfigService_GetConfig_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ConfigService_GetConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterConfigServiceHandlerFromEndpoint is same as RegisterConfigServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterConfigServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterConfigServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterConfigServiceHandler registers the http handlers for service ConfigService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterConfigServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterConfigServiceHandlerClient(ctx, mux, NewConfigServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterConfigServiceHandlerClient registers the http handlers for service ConfigService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ConfigServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ConfigServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "ConfigServiceClient" to call the correct interceptors.
|
||||
func RegisterConfigServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConfigServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_ConfigService_GetConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_ConfigService_GetConfig_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ConfigService_GetConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_ConfigService_GetConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "config"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_ConfigService_GetConfig_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
31
api/config.proto
Normal file
31
api/config.proto
Normal file
@@ -0,0 +1,31 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service ConfigService {
|
||||
rpc GetConfig (google.protobuf.Empty) returns (GetConfigResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/config"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message GetConfigResponse {
|
||||
string apiUrl = 1;
|
||||
string domain = 2;
|
||||
string fqdn = 3;
|
||||
NodePool nodePool = 4;
|
||||
}
|
||||
|
||||
message NodePoolOption {
|
||||
string name = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
message NodePool {
|
||||
string label = 1;
|
||||
repeated NodePoolOption options = 2;
|
||||
}
|
||||
1003
api/cron_workflow.pb.go
Normal file
1003
api/cron_workflow.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
823
api/cron_workflow.pb.gw.go
Normal file
823
api/cron_workflow.pb.gw.go
Normal file
@@ -0,0 +1,823 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: cron_workflow.proto
|
||||
|
||||
/*
|
||||
Package api is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_CronWorkflowService_CreateCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client CronWorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.CronWorkflow); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
msg, err := client.CreateCronWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_CronWorkflowService_CreateCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server CronWorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.CronWorkflow); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
msg, err := server.CreateCronWorkflow(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_CronWorkflowService_UpdateCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client CronWorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.CronWorkflow); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.UpdateCronWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_CronWorkflowService_UpdateCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server CronWorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.CronWorkflow); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.UpdateCronWorkflow(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_CronWorkflowService_GetCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client CronWorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetCronWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_CronWorkflowService_GetCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server CronWorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetCronWorkflow(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_CronWorkflowService_ListCronWorkflows_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
||||
func request_CronWorkflowService_ListCronWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, client CronWorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CronWorkflowService_ListCronWorkflows_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListCronWorkflows(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_CronWorkflowService_ListCronWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, server CronWorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_CronWorkflowService_ListCronWorkflows_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListCronWorkflows(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_CronWorkflowService_ListCronWorkflows_1 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0, "workflow_template_name": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
|
||||
)
|
||||
|
||||
func request_CronWorkflowService_ListCronWorkflows_1(ctx context.Context, marshaler runtime.Marshaler, client CronWorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["workflow_template_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflow_template_name")
|
||||
}
|
||||
|
||||
protoReq.WorkflowTemplateName, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflow_template_name", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_CronWorkflowService_ListCronWorkflows_1); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListCronWorkflows(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_CronWorkflowService_ListCronWorkflows_1(ctx context.Context, marshaler runtime.Marshaler, server CronWorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["workflow_template_name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflow_template_name")
|
||||
}
|
||||
|
||||
protoReq.WorkflowTemplateName, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflow_template_name", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_CronWorkflowService_ListCronWorkflows_1); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListCronWorkflows(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_CronWorkflowService_DeleteCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client CronWorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.DeleteCronWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_CronWorkflowService_DeleteCronWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server CronWorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteCronWorkflowRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.DeleteCronWorkflow(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterCronWorkflowServiceHandlerServer registers the http handlers for service CronWorkflowService to "mux".
|
||||
// UnaryRPC :call CronWorkflowServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterCronWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CronWorkflowServiceServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_CronWorkflowService_CreateCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_CronWorkflowService_CreateCronWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_CreateCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_CronWorkflowService_UpdateCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_CronWorkflowService_UpdateCronWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_UpdateCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_CronWorkflowService_GetCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_CronWorkflowService_GetCronWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_GetCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_CronWorkflowService_ListCronWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_CronWorkflowService_ListCronWorkflows_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_ListCronWorkflows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_CronWorkflowService_ListCronWorkflows_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_CronWorkflowService_ListCronWorkflows_1(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_ListCronWorkflows_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_CronWorkflowService_DeleteCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_CronWorkflowService_DeleteCronWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_DeleteCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterCronWorkflowServiceHandlerFromEndpoint is same as RegisterCronWorkflowServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterCronWorkflowServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterCronWorkflowServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterCronWorkflowServiceHandler registers the http handlers for service CronWorkflowService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterCronWorkflowServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterCronWorkflowServiceHandlerClient(ctx, mux, NewCronWorkflowServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterCronWorkflowServiceHandlerClient registers the http handlers for service CronWorkflowService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CronWorkflowServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CronWorkflowServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "CronWorkflowServiceClient" to call the correct interceptors.
|
||||
func RegisterCronWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CronWorkflowServiceClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_CronWorkflowService_CreateCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_CronWorkflowService_CreateCronWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_CreateCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_CronWorkflowService_UpdateCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_CronWorkflowService_UpdateCronWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_UpdateCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_CronWorkflowService_GetCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_CronWorkflowService_GetCronWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_GetCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_CronWorkflowService_ListCronWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_CronWorkflowService_ListCronWorkflows_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_ListCronWorkflows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_CronWorkflowService_ListCronWorkflows_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_CronWorkflowService_ListCronWorkflows_1(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_ListCronWorkflows_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_CronWorkflowService_DeleteCronWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_CronWorkflowService_DeleteCronWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_CronWorkflowService_DeleteCronWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_CronWorkflowService_CreateCronWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "cron_workflow"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_CronWorkflowService_UpdateCronWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "cron_workflow", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_CronWorkflowService_GetCronWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "cron_workflow", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_CronWorkflowService_ListCronWorkflows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "cron_workflows"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_CronWorkflowService_ListCronWorkflows_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "cron_workflows", "workflow_template_name"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_CronWorkflowService_DeleteCronWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "cron_workflows", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_CronWorkflowService_CreateCronWorkflow_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_CronWorkflowService_UpdateCronWorkflow_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_CronWorkflowService_GetCronWorkflow_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_CronWorkflowService_ListCronWorkflows_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_CronWorkflowService_ListCronWorkflows_1 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_CronWorkflowService_DeleteCronWorkflow_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
92
api/cron_workflow.proto
Normal file
92
api/cron_workflow.proto
Normal file
@@ -0,0 +1,92 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "workflow.proto";
|
||||
import "label.proto";
|
||||
|
||||
service CronWorkflowService {
|
||||
rpc CreateCronWorkflow (CreateCronWorkflowRequest) returns (CronWorkflow) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/cron_workflow"
|
||||
body: "cronWorkflow"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateCronWorkflow(UpdateCronWorkflowRequest) returns (CronWorkflow) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/cron_workflow/{uid}"
|
||||
body: "cronWorkflow"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetCronWorkflow(GetCronWorkflowRequest) returns (CronWorkflow) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/cron_workflow/{uid}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListCronWorkflows(ListCronWorkflowRequest) returns (ListCronWorkflowsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/cron_workflows"
|
||||
additional_bindings {
|
||||
get: "/apis/v1beta1/{namespace}/cron_workflows/{workflow_template_name}"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
rpc DeleteCronWorkflow (DeleteCronWorkflowRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
delete: "/apis/v1beta1/{namespace}/cron_workflows/{uid}"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message CronWorkflow {
|
||||
string name = 1;
|
||||
string uid = 2;
|
||||
string manifest = 3;
|
||||
|
||||
WorkflowExecution workflowExecution = 4;
|
||||
|
||||
repeated KeyValue labels = 5;
|
||||
string namespace = 6;
|
||||
}
|
||||
|
||||
message CreateCronWorkflowRequest {
|
||||
string namespace = 1;
|
||||
CronWorkflow cronWorkflow = 2;
|
||||
}
|
||||
|
||||
message GetCronWorkflowRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message UpdateCronWorkflowRequest {
|
||||
string namespace = 1 ;
|
||||
string uid = 2;
|
||||
CronWorkflow cronWorkflow = 3;
|
||||
}
|
||||
|
||||
message DeleteCronWorkflowRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message ListCronWorkflowRequest {
|
||||
string namespace = 1;
|
||||
string workflow_template_name = 2;
|
||||
int32 pageSize = 3;
|
||||
int32 page = 4;
|
||||
}
|
||||
|
||||
message ListCronWorkflowsResponse {
|
||||
int32 count = 1;
|
||||
repeated CronWorkflow cronWorkflows = 2;
|
||||
int32 page = 3;
|
||||
int32 pages = 4;
|
||||
int32 totalCount = 5;
|
||||
}
|
||||
879
api/label.pb.go
Normal file
879
api/label.pb.go
Normal file
@@ -0,0 +1,879 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: label.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type KeyValue struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
}
|
||||
|
||||
func (x *KeyValue) Reset() {
|
||||
*x = KeyValue{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_label_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *KeyValue) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*KeyValue) ProtoMessage() {}
|
||||
|
||||
func (x *KeyValue) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_label_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.
|
||||
func (*KeyValue) Descriptor() ([]byte, []int) {
|
||||
return file_label_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *KeyValue) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *KeyValue) GetValue() string {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Labels struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Items []*KeyValue `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Labels) Reset() {
|
||||
*x = Labels{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_label_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Labels) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Labels) ProtoMessage() {}
|
||||
|
||||
func (x *Labels) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_label_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Labels.ProtoReflect.Descriptor instead.
|
||||
func (*Labels) Descriptor() ([]byte, []int) {
|
||||
return file_label_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Labels) GetItems() []*KeyValue {
|
||||
if x != nil {
|
||||
return x.Items
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AddLabelsRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"`
|
||||
Labels *Labels `protobuf:"bytes,4,opt,name=labels,proto3" json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
func (x *AddLabelsRequest) Reset() {
|
||||
*x = AddLabelsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_label_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *AddLabelsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*AddLabelsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *AddLabelsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_label_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use AddLabelsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*AddLabelsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_label_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *AddLabelsRequest) GetNamespace() string {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddLabelsRequest) GetResource() string {
|
||||
if x != nil {
|
||||
return x.Resource
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddLabelsRequest) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *AddLabelsRequest) GetLabels() *Labels {
|
||||
if x != nil {
|
||||
return x.Labels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ReplaceLabelsRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"`
|
||||
Labels *Labels `protobuf:"bytes,4,opt,name=labels,proto3" json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ReplaceLabelsRequest) Reset() {
|
||||
*x = ReplaceLabelsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_label_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ReplaceLabelsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ReplaceLabelsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ReplaceLabelsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_label_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ReplaceLabelsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ReplaceLabelsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_label_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ReplaceLabelsRequest) GetNamespace() string {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReplaceLabelsRequest) GetResource() string {
|
||||
if x != nil {
|
||||
return x.Resource
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReplaceLabelsRequest) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReplaceLabelsRequest) GetLabels() *Labels {
|
||||
if x != nil {
|
||||
return x.Labels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetLabelsRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetLabelsRequest) Reset() {
|
||||
*x = GetLabelsRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_label_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetLabelsRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetLabelsRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetLabelsRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_label_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetLabelsRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetLabelsRequest) Descriptor() ([]byte, []int) {
|
||||
return file_label_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *GetLabelsRequest) GetNamespace() string {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetLabelsRequest) GetResource() string {
|
||||
if x != nil {
|
||||
return x.Resource
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetLabelsRequest) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetLabelsResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Labels []*KeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetLabelsResponse) Reset() {
|
||||
*x = GetLabelsResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_label_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetLabelsResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetLabelsResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetLabelsResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_label_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetLabelsResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetLabelsResponse) Descriptor() ([]byte, []int) {
|
||||
return file_label_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *GetLabelsResponse) GetLabels() []*KeyValue {
|
||||
if x != nil {
|
||||
return x.Labels
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DeleteLabelRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Resource string `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"`
|
||||
Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"`
|
||||
Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
|
||||
}
|
||||
|
||||
func (x *DeleteLabelRequest) Reset() {
|
||||
*x = DeleteLabelRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_label_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DeleteLabelRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeleteLabelRequest) ProtoMessage() {}
|
||||
|
||||
func (x *DeleteLabelRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_label_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeleteLabelRequest.ProtoReflect.Descriptor instead.
|
||||
func (*DeleteLabelRequest) Descriptor() ([]byte, []int) {
|
||||
return file_label_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *DeleteLabelRequest) GetNamespace() string {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DeleteLabelRequest) GetResource() string {
|
||||
if x != nil {
|
||||
return x.Resource
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DeleteLabelRequest) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DeleteLabelRequest) GetKey() string {
|
||||
if x != nil {
|
||||
return x.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_label_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_label_proto_rawDesc = []byte{
|
||||
0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x61,
|
||||
0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61,
|
||||
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x22, 0x2d, 0x0a, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x23,
|
||||
0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x69, 0x74,
|
||||
0x65, 0x6d, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c,
|
||||
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x03, 0x75, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c,
|
||||
0x73, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x87, 0x01, 0x0a, 0x14, 0x52, 0x65,
|
||||
0x70, 0x6c, 0x61, 0x63, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x23,
|
||||
0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b,
|
||||
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x06, 0x6c, 0x61, 0x62,
|
||||
0x65, 0x6c, 0x73, 0x22, 0x5e, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
|
||||
0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x75, 0x69, 0x64, 0x22, 0x3a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65,
|
||||
0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4b,
|
||||
0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22,
|
||||
0x72, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
|
||||
0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
|
||||
0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x32, 0x8d, 0x04, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c,
|
||||
0x73, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c,
|
||||
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47,
|
||||
0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x12, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f,
|
||||
0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
|
||||
0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x7d, 0x2f, 0x7b,
|
||||
0x75, 0x69, 0x64, 0x7d, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x7d, 0x0a, 0x09, 0x41,
|
||||
0x64, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41,
|
||||
0x64, 0x64, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x22,
|
||||
0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f,
|
||||
0x75, 0x72, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x6c, 0x61, 0x62, 0x65,
|
||||
0x6c, 0x73, 0x3a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x0d, 0x52,
|
||||
0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x19, 0x2e, 0x61,
|
||||
0x70, 0x69, 0x2e, 0x52, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65,
|
||||
0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x1a, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76,
|
||||
0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
|
||||
0x65, 0x7d, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x75,
|
||||
0x69, 0x64, 0x7d, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x3a, 0x06, 0x6c, 0x61, 0x62, 0x65,
|
||||
0x6c, 0x73, 0x12, 0x7f, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65,
|
||||
0x6c, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x61,
|
||||
0x62, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x3f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x39, 0x2a, 0x37, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73,
|
||||
0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x7d,
|
||||
0x2f, 0x7b, 0x75, 0x69, 0x64, 0x7d, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2f, 0x7b, 0x6b,
|
||||
0x65, 0x79, 0x7d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_label_proto_rawDescOnce sync.Once
|
||||
file_label_proto_rawDescData = file_label_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_label_proto_rawDescGZIP() []byte {
|
||||
file_label_proto_rawDescOnce.Do(func() {
|
||||
file_label_proto_rawDescData = protoimpl.X.CompressGZIP(file_label_proto_rawDescData)
|
||||
})
|
||||
return file_label_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_label_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_label_proto_goTypes = []interface{}{
|
||||
(*KeyValue)(nil), // 0: api.KeyValue
|
||||
(*Labels)(nil), // 1: api.Labels
|
||||
(*AddLabelsRequest)(nil), // 2: api.AddLabelsRequest
|
||||
(*ReplaceLabelsRequest)(nil), // 3: api.ReplaceLabelsRequest
|
||||
(*GetLabelsRequest)(nil), // 4: api.GetLabelsRequest
|
||||
(*GetLabelsResponse)(nil), // 5: api.GetLabelsResponse
|
||||
(*DeleteLabelRequest)(nil), // 6: api.DeleteLabelRequest
|
||||
}
|
||||
var file_label_proto_depIdxs = []int32{
|
||||
0, // 0: api.Labels.items:type_name -> api.KeyValue
|
||||
1, // 1: api.AddLabelsRequest.labels:type_name -> api.Labels
|
||||
1, // 2: api.ReplaceLabelsRequest.labels:type_name -> api.Labels
|
||||
0, // 3: api.GetLabelsResponse.labels:type_name -> api.KeyValue
|
||||
4, // 4: api.LabelService.GetLabels:input_type -> api.GetLabelsRequest
|
||||
2, // 5: api.LabelService.AddLabels:input_type -> api.AddLabelsRequest
|
||||
3, // 6: api.LabelService.ReplaceLabels:input_type -> api.ReplaceLabelsRequest
|
||||
6, // 7: api.LabelService.DeleteLabel:input_type -> api.DeleteLabelRequest
|
||||
5, // 8: api.LabelService.GetLabels:output_type -> api.GetLabelsResponse
|
||||
5, // 9: api.LabelService.AddLabels:output_type -> api.GetLabelsResponse
|
||||
5, // 10: api.LabelService.ReplaceLabels:output_type -> api.GetLabelsResponse
|
||||
5, // 11: api.LabelService.DeleteLabel:output_type -> api.GetLabelsResponse
|
||||
8, // [8:12] is the sub-list for method output_type
|
||||
4, // [4:8] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_label_proto_init() }
|
||||
func file_label_proto_init() {
|
||||
if File_label_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_label_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*KeyValue); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_label_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Labels); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_label_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*AddLabelsRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_label_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ReplaceLabelsRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_label_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetLabelsRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_label_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetLabelsResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_label_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DeleteLabelRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_label_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_label_proto_goTypes,
|
||||
DependencyIndexes: file_label_proto_depIdxs,
|
||||
MessageInfos: file_label_proto_msgTypes,
|
||||
}.Build()
|
||||
File_label_proto = out.File
|
||||
file_label_proto_rawDesc = nil
|
||||
file_label_proto_goTypes = nil
|
||||
file_label_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// LabelServiceClient is the client API for LabelService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type LabelServiceClient interface {
|
||||
GetLabels(ctx context.Context, in *GetLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error)
|
||||
AddLabels(ctx context.Context, in *AddLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error)
|
||||
ReplaceLabels(ctx context.Context, in *ReplaceLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error)
|
||||
DeleteLabel(ctx context.Context, in *DeleteLabelRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error)
|
||||
}
|
||||
|
||||
type labelServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewLabelServiceClient(cc grpc.ClientConnInterface) LabelServiceClient {
|
||||
return &labelServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *labelServiceClient) GetLabels(ctx context.Context, in *GetLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error) {
|
||||
out := new(GetLabelsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.LabelService/GetLabels", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *labelServiceClient) AddLabels(ctx context.Context, in *AddLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error) {
|
||||
out := new(GetLabelsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.LabelService/AddLabels", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *labelServiceClient) ReplaceLabels(ctx context.Context, in *ReplaceLabelsRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error) {
|
||||
out := new(GetLabelsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.LabelService/ReplaceLabels", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *labelServiceClient) DeleteLabel(ctx context.Context, in *DeleteLabelRequest, opts ...grpc.CallOption) (*GetLabelsResponse, error) {
|
||||
out := new(GetLabelsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.LabelService/DeleteLabel", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// LabelServiceServer is the server API for LabelService service.
|
||||
type LabelServiceServer interface {
|
||||
GetLabels(context.Context, *GetLabelsRequest) (*GetLabelsResponse, error)
|
||||
AddLabels(context.Context, *AddLabelsRequest) (*GetLabelsResponse, error)
|
||||
ReplaceLabels(context.Context, *ReplaceLabelsRequest) (*GetLabelsResponse, error)
|
||||
DeleteLabel(context.Context, *DeleteLabelRequest) (*GetLabelsResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedLabelServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedLabelServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedLabelServiceServer) GetLabels(context.Context, *GetLabelsRequest) (*GetLabelsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLabels not implemented")
|
||||
}
|
||||
func (*UnimplementedLabelServiceServer) AddLabels(context.Context, *AddLabelsRequest) (*GetLabelsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddLabels not implemented")
|
||||
}
|
||||
func (*UnimplementedLabelServiceServer) ReplaceLabels(context.Context, *ReplaceLabelsRequest) (*GetLabelsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ReplaceLabels not implemented")
|
||||
}
|
||||
func (*UnimplementedLabelServiceServer) DeleteLabel(context.Context, *DeleteLabelRequest) (*GetLabelsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteLabel not implemented")
|
||||
}
|
||||
|
||||
func RegisterLabelServiceServer(s *grpc.Server, srv LabelServiceServer) {
|
||||
s.RegisterService(&_LabelService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _LabelService_GetLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetLabelsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LabelServiceServer).GetLabels(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.LabelService/GetLabels",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LabelServiceServer).GetLabels(ctx, req.(*GetLabelsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LabelService_AddLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddLabelsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LabelServiceServer).AddLabels(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.LabelService/AddLabels",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LabelServiceServer).AddLabels(ctx, req.(*AddLabelsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LabelService_ReplaceLabels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ReplaceLabelsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LabelServiceServer).ReplaceLabels(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.LabelService/ReplaceLabels",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LabelServiceServer).ReplaceLabels(ctx, req.(*ReplaceLabelsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _LabelService_DeleteLabel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteLabelRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(LabelServiceServer).DeleteLabel(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.LabelService/DeleteLabel",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LabelServiceServer).DeleteLabel(ctx, req.(*DeleteLabelRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _LabelService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api.LabelService",
|
||||
HandlerType: (*LabelServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetLabels",
|
||||
Handler: _LabelService_GetLabels_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AddLabels",
|
||||
Handler: _LabelService_AddLabels_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ReplaceLabels",
|
||||
Handler: _LabelService_ReplaceLabels_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteLabel",
|
||||
Handler: _LabelService_DeleteLabel_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "label.proto",
|
||||
}
|
||||
707
api/label.pb.gw.go
Normal file
707
api/label.pb.gw.go
Normal file
@@ -0,0 +1,707 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: label.proto
|
||||
|
||||
/*
|
||||
Package api is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_LabelService_GetLabels_0(ctx context.Context, marshaler runtime.Marshaler, client LabelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetLabelsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetLabels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_LabelService_GetLabels_0(ctx context.Context, marshaler runtime.Marshaler, server LabelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetLabelsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetLabels(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_LabelService_AddLabels_0(ctx context.Context, marshaler runtime.Marshaler, client LabelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq AddLabelsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Labels); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.AddLabels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_LabelService_AddLabels_0(ctx context.Context, marshaler runtime.Marshaler, server LabelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq AddLabelsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Labels); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.AddLabels(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_LabelService_ReplaceLabels_0(ctx context.Context, marshaler runtime.Marshaler, client LabelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ReplaceLabelsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Labels); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.ReplaceLabels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_LabelService_ReplaceLabels_0(ctx context.Context, marshaler runtime.Marshaler, server LabelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ReplaceLabelsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Labels); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.ReplaceLabels(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_LabelService_DeleteLabel_0(ctx context.Context, marshaler runtime.Marshaler, client LabelServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteLabelRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["key"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key")
|
||||
}
|
||||
|
||||
protoReq.Key, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err)
|
||||
}
|
||||
|
||||
msg, err := client.DeleteLabel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_LabelService_DeleteLabel_0(ctx context.Context, marshaler runtime.Marshaler, server LabelServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteLabelRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["resource"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource")
|
||||
}
|
||||
|
||||
protoReq.Resource, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["key"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "key")
|
||||
}
|
||||
|
||||
protoReq.Key, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "key", err)
|
||||
}
|
||||
|
||||
msg, err := server.DeleteLabel(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterLabelServiceHandlerServer registers the http handlers for service LabelService to "mux".
|
||||
// UnaryRPC :call LabelServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterLabelServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LabelServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_LabelService_GetLabels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_LabelService_GetLabels_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_GetLabels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_LabelService_AddLabels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_LabelService_AddLabels_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_AddLabels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_LabelService_ReplaceLabels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_LabelService_ReplaceLabels_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_ReplaceLabels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_LabelService_DeleteLabel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_LabelService_DeleteLabel_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_DeleteLabel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterLabelServiceHandlerFromEndpoint is same as RegisterLabelServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterLabelServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterLabelServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterLabelServiceHandler registers the http handlers for service LabelService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterLabelServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterLabelServiceHandlerClient(ctx, mux, NewLabelServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterLabelServiceHandlerClient registers the http handlers for service LabelService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LabelServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LabelServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "LabelServiceClient" to call the correct interceptors.
|
||||
func RegisterLabelServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LabelServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_LabelService_GetLabels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_LabelService_GetLabels_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_GetLabels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_LabelService_AddLabels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_LabelService_AddLabels_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_AddLabels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_LabelService_ReplaceLabels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_LabelService_ReplaceLabels_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_ReplaceLabels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_LabelService_DeleteLabel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_LabelService_DeleteLabel_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_LabelService_DeleteLabel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_LabelService_GetLabels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "resource", "uid", "labels"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_LabelService_AddLabels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "resource", "uid", "labels"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_LabelService_ReplaceLabels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "resource", "uid", "labels"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_LabelService_DeleteLabel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"apis", "v1beta1", "namespace", "resource", "uid", "labels", "key"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_LabelService_GetLabels_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_LabelService_AddLabels_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_LabelService_ReplaceLabels_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_LabelService_DeleteLabel_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
73
api/label.proto
Normal file
73
api/label.proto
Normal file
@@ -0,0 +1,73 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
service LabelService {
|
||||
rpc GetLabels (GetLabelsRequest) returns (GetLabelsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/{resource}/{uid}/labels"
|
||||
};
|
||||
}
|
||||
|
||||
rpc AddLabels (AddLabelsRequest) returns (GetLabelsResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/{resource}/{uid}/labels"
|
||||
body: "labels"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ReplaceLabels (ReplaceLabelsRequest) returns (GetLabelsResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/{resource}/{uid}/labels"
|
||||
body: "labels"
|
||||
};
|
||||
}
|
||||
|
||||
rpc DeleteLabel (DeleteLabelRequest) returns (GetLabelsResponse) {
|
||||
option (google.api.http) = {
|
||||
delete: "/apis/v1beta1/{namespace}/{resource}/{uid}/labels/{key}"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message KeyValue {
|
||||
string key = 1;
|
||||
string value = 2;
|
||||
}
|
||||
|
||||
message Labels {
|
||||
repeated KeyValue items = 1;
|
||||
}
|
||||
|
||||
message AddLabelsRequest {
|
||||
string namespace = 1;
|
||||
string resource = 2;
|
||||
string uid = 3;
|
||||
Labels labels = 4;
|
||||
}
|
||||
|
||||
message ReplaceLabelsRequest {
|
||||
string namespace = 1;
|
||||
string resource = 2;
|
||||
string uid = 3;
|
||||
Labels labels = 4;
|
||||
}
|
||||
|
||||
message GetLabelsRequest {
|
||||
string namespace = 1;
|
||||
string resource = 2;
|
||||
string uid = 3;
|
||||
}
|
||||
|
||||
message GetLabelsResponse {
|
||||
repeated KeyValue labels = 1;
|
||||
}
|
||||
|
||||
message DeleteLabelRequest {
|
||||
string namespace = 1;
|
||||
string resource = 2;
|
||||
string uid = 3;
|
||||
string key = 4;
|
||||
}
|
||||
191
api/metric.pb.go
191
api/metric.pb.go
@@ -1,93 +1,164 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: metric.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
math "math"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Metric struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Format string `protobuf:"bytes,3,opt,name=format,proto3" json:"format,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
Format string `protobuf:"bytes,3,opt,name=format,proto3" json:"format,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Metric) Reset() { *m = Metric{} }
|
||||
func (m *Metric) String() string { return proto.CompactTextString(m) }
|
||||
func (*Metric) ProtoMessage() {}
|
||||
func (x *Metric) Reset() {
|
||||
*x = Metric{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_metric_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Metric) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Metric) ProtoMessage() {}
|
||||
|
||||
func (x *Metric) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_metric_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Metric.ProtoReflect.Descriptor instead.
|
||||
func (*Metric) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_da41641f55bff5df, []int{0}
|
||||
return file_metric_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (m *Metric) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Metric.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Metric.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Metric) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Metric.Merge(m, src)
|
||||
}
|
||||
func (m *Metric) XXX_Size() int {
|
||||
return xxx_messageInfo_Metric.Size(m)
|
||||
}
|
||||
func (m *Metric) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Metric.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Metric proto.InternalMessageInfo
|
||||
|
||||
func (m *Metric) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
func (x *Metric) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Metric) GetValue() float64 {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
func (x *Metric) GetValue() float64 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Metric) GetFormat() string {
|
||||
if m != nil {
|
||||
return m.Format
|
||||
func (x *Metric) GetFormat() string {
|
||||
if x != nil {
|
||||
return x.Format
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Metric)(nil), "api.Metric")
|
||||
var File_metric_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_metric_proto_rawDesc = []byte{
|
||||
0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03,
|
||||
0x61, 0x70, 0x69, 0x22, 0x4a, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01,
|
||||
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61,
|
||||
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("metric.proto", fileDescriptor_da41641f55bff5df) }
|
||||
var (
|
||||
file_metric_proto_rawDescOnce sync.Once
|
||||
file_metric_proto_rawDescData = file_metric_proto_rawDesc
|
||||
)
|
||||
|
||||
var fileDescriptor_da41641f55bff5df = []byte{
|
||||
// 105 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x4d, 0x2d, 0x29,
|
||||
0xca, 0x4c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x2c, 0xc8, 0x54, 0xf2, 0xe2,
|
||||
0x62, 0xf3, 0x05, 0x0b, 0x0a, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30,
|
||||
0x6a, 0x70, 0x06, 0x81, 0xd9, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c,
|
||||
0x0a, 0x8c, 0x1a, 0x8c, 0x41, 0x10, 0x8e, 0x90, 0x18, 0x17, 0x5b, 0x5a, 0x7e, 0x51, 0x6e, 0x62,
|
||||
0x89, 0x04, 0x33, 0x58, 0x2d, 0x94, 0x97, 0xc4, 0x06, 0x36, 0xd7, 0x18, 0x10, 0x00, 0x00, 0xff,
|
||||
0xff, 0x88, 0xf0, 0xba, 0x92, 0x67, 0x00, 0x00, 0x00,
|
||||
func file_metric_proto_rawDescGZIP() []byte {
|
||||
file_metric_proto_rawDescOnce.Do(func() {
|
||||
file_metric_proto_rawDescData = protoimpl.X.CompressGZIP(file_metric_proto_rawDescData)
|
||||
})
|
||||
return file_metric_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_metric_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_metric_proto_goTypes = []interface{}{
|
||||
(*Metric)(nil), // 0: api.Metric
|
||||
}
|
||||
var file_metric_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_metric_proto_init() }
|
||||
func file_metric_proto_init() {
|
||||
if File_metric_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_metric_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Metric); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_metric_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_metric_proto_goTypes,
|
||||
DependencyIndexes: file_metric_proto_depIdxs,
|
||||
MessageInfos: file_metric_proto_msgTypes,
|
||||
}.Build()
|
||||
File_metric_proto = out.File
|
||||
file_metric_proto_rawDesc = nil
|
||||
file_metric_proto_goTypes = nil
|
||||
file_metric_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
@@ -1,167 +1,451 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: namespace.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
empty "github.com/golang/protobuf/ptypes/empty"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type ListNamespacesResponse struct {
|
||||
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
|
||||
Namespaces []*Namespace `protobuf:"bytes,2,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
type ListNamespacesRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PageSize int32 `protobuf:"varint,1,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
|
||||
Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
|
||||
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ListNamespacesResponse) Reset() { *m = ListNamespacesResponse{} }
|
||||
func (m *ListNamespacesResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ListNamespacesResponse) ProtoMessage() {}
|
||||
func (*ListNamespacesResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecb1e126f615f5dd, []int{0}
|
||||
func (x *ListNamespacesRequest) Reset() {
|
||||
*x = ListNamespacesRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_namespace_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *ListNamespacesResponse) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_ListNamespacesResponse.Unmarshal(m, b)
|
||||
}
|
||||
func (m *ListNamespacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_ListNamespacesResponse.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *ListNamespacesResponse) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_ListNamespacesResponse.Merge(m, src)
|
||||
}
|
||||
func (m *ListNamespacesResponse) XXX_Size() int {
|
||||
return xxx_messageInfo_ListNamespacesResponse.Size(m)
|
||||
}
|
||||
func (m *ListNamespacesResponse) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_ListNamespacesResponse.DiscardUnknown(m)
|
||||
func (x *ListNamespacesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_ListNamespacesResponse proto.InternalMessageInfo
|
||||
func (*ListNamespacesRequest) ProtoMessage() {}
|
||||
|
||||
func (m *ListNamespacesResponse) GetCount() int32 {
|
||||
if m != nil {
|
||||
return m.Count
|
||||
func (x *ListNamespacesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_namespace_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListNamespacesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListNamespacesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_namespace_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ListNamespacesRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ListNamespacesResponse) GetNamespaces() []*Namespace {
|
||||
if m != nil {
|
||||
return m.Namespaces
|
||||
func (x *ListNamespacesRequest) GetPage() int32 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListNamespacesRequest) GetQuery() string {
|
||||
if x != nil {
|
||||
return x.Query
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListNamespacesResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
|
||||
Namespaces []*Namespace `protobuf:"bytes,2,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
|
||||
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
|
||||
Pages int32 `protobuf:"varint,4,opt,name=pages,proto3" json:"pages,omitempty"`
|
||||
TotalCount int32 `protobuf:"varint,5,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListNamespacesResponse) Reset() {
|
||||
*x = ListNamespacesResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_namespace_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListNamespacesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListNamespacesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListNamespacesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_namespace_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListNamespacesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListNamespacesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_namespace_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ListNamespacesResponse) GetCount() int32 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListNamespacesResponse) GetNamespaces() []*Namespace {
|
||||
if x != nil {
|
||||
return x.Namespaces
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ListNamespacesResponse) GetPage() int32 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListNamespacesResponse) GetPages() int32 {
|
||||
if x != nil {
|
||||
return x.Pages
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListNamespacesResponse) GetTotalCount() int32 {
|
||||
if x != nil {
|
||||
return x.TotalCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type CreateNamespaceRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace *Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CreateNamespaceRequest) Reset() {
|
||||
*x = CreateNamespaceRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_namespace_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CreateNamespaceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreateNamespaceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CreateNamespaceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_namespace_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CreateNamespaceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CreateNamespaceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_namespace_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *CreateNamespaceRequest) GetNamespace() *Namespace {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Namespace struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Namespace) Reset() { *m = Namespace{} }
|
||||
func (m *Namespace) String() string { return proto.CompactTextString(m) }
|
||||
func (*Namespace) ProtoMessage() {}
|
||||
func (x *Namespace) Reset() {
|
||||
*x = Namespace{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_namespace_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Namespace) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Namespace) ProtoMessage() {}
|
||||
|
||||
func (x *Namespace) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_namespace_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Namespace.ProtoReflect.Descriptor instead.
|
||||
func (*Namespace) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ecb1e126f615f5dd, []int{1}
|
||||
return file_namespace_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (m *Namespace) XXX_Unmarshal(b []byte) error {
|
||||
return xxx_messageInfo_Namespace.Unmarshal(m, b)
|
||||
}
|
||||
func (m *Namespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
return xxx_messageInfo_Namespace.Marshal(b, m, deterministic)
|
||||
}
|
||||
func (m *Namespace) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Namespace.Merge(m, src)
|
||||
}
|
||||
func (m *Namespace) XXX_Size() int {
|
||||
return xxx_messageInfo_Namespace.Size(m)
|
||||
}
|
||||
func (m *Namespace) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Namespace.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Namespace proto.InternalMessageInfo
|
||||
|
||||
func (m *Namespace) GetName() string {
|
||||
if m != nil {
|
||||
return m.Name
|
||||
func (x *Namespace) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*ListNamespacesResponse)(nil), "api.ListNamespacesResponse")
|
||||
proto.RegisterType((*Namespace)(nil), "api.Namespace")
|
||||
var File_namespace_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_namespace_proto_rawDesc = []byte{
|
||||
0x0a, 0x0f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61,
|
||||
0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5d, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75,
|
||||
0x65, 0x72, 0x79, 0x22, 0xa8, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63,
|
||||
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
|
||||
0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e,
|
||||
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x67, 0x65,
|
||||
0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73, 0x12, 0x1e,
|
||||
0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x46,
|
||||
0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
|
||||
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x70,
|
||||
0x69, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x1f, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xec, 0x01, 0x0a, 0x10, 0x4e, 0x61, 0x6d, 0x65,
|
||||
0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x0e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x1a,
|
||||
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
|
||||
0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12,
|
||||
0x18, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x6b, 0x0a, 0x0f, 0x43, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x61,
|
||||
0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
|
||||
0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02,
|
||||
0x25, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31,
|
||||
0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x3a, 0x09, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("namespace.proto", fileDescriptor_ecb1e126f615f5dd) }
|
||||
var (
|
||||
file_namespace_proto_rawDescOnce sync.Once
|
||||
file_namespace_proto_rawDescData = file_namespace_proto_rawDesc
|
||||
)
|
||||
|
||||
var fileDescriptor_ecb1e126f615f5dd = []byte{
|
||||
// 238 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcf, 0x4b, 0xcc, 0x4d,
|
||||
0x2d, 0x2e, 0x48, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x4e, 0x2c, 0xc8,
|
||||
0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb,
|
||||
0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0x28, 0x91, 0x92, 0x86, 0xca, 0x82, 0x79,
|
||||
0x49, 0xa5, 0x69, 0xfa, 0xa9, 0xb9, 0x05, 0x25, 0x95, 0x10, 0x49, 0xa5, 0x38, 0x2e, 0x31, 0x9f,
|
||||
0xcc, 0xe2, 0x12, 0x3f, 0x98, 0xb1, 0xc5, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x42,
|
||||
0x22, 0x5c, 0xac, 0xc9, 0xf9, 0xa5, 0x79, 0x25, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10,
|
||||
0x8e, 0x90, 0x1e, 0x17, 0x17, 0xdc, 0x09, 0xc5, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0x7c,
|
||||
0x7a, 0x89, 0x05, 0x99, 0x7a, 0x70, 0x23, 0x82, 0x90, 0x54, 0x28, 0xc9, 0x73, 0x71, 0xc2, 0x25,
|
||||
0x84, 0x84, 0xb8, 0x58, 0x40, 0x52, 0x60, 0x13, 0x39, 0x83, 0xc0, 0x6c, 0xa3, 0x6a, 0x2e, 0x01,
|
||||
0xb8, 0x82, 0xe0, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0xa1, 0x74, 0x2e, 0x3e, 0x54, 0x47, 0x09,
|
||||
0x89, 0xe9, 0x41, 0x3c, 0xa1, 0x07, 0xf3, 0x84, 0x9e, 0x2b, 0xc8, 0x13, 0x52, 0xd2, 0x60, 0xab,
|
||||
0xb1, 0xfb, 0x40, 0x49, 0xa1, 0xe9, 0xf2, 0x93, 0xc9, 0x4c, 0x52, 0x42, 0x12, 0xa0, 0x80, 0x29,
|
||||
0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x47, 0xb8, 0x2e, 0x89, 0x0d, 0x6c, 0x9c,
|
||||
0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xa6, 0xf4, 0xfe, 0x57, 0x01, 0x00, 0x00,
|
||||
func file_namespace_proto_rawDescGZIP() []byte {
|
||||
file_namespace_proto_rawDescOnce.Do(func() {
|
||||
file_namespace_proto_rawDescData = protoimpl.X.CompressGZIP(file_namespace_proto_rawDescData)
|
||||
})
|
||||
return file_namespace_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_namespace_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_namespace_proto_goTypes = []interface{}{
|
||||
(*ListNamespacesRequest)(nil), // 0: api.ListNamespacesRequest
|
||||
(*ListNamespacesResponse)(nil), // 1: api.ListNamespacesResponse
|
||||
(*CreateNamespaceRequest)(nil), // 2: api.CreateNamespaceRequest
|
||||
(*Namespace)(nil), // 3: api.Namespace
|
||||
}
|
||||
var file_namespace_proto_depIdxs = []int32{
|
||||
3, // 0: api.ListNamespacesResponse.namespaces:type_name -> api.Namespace
|
||||
3, // 1: api.CreateNamespaceRequest.namespace:type_name -> api.Namespace
|
||||
0, // 2: api.NamespaceService.ListNamespaces:input_type -> api.ListNamespacesRequest
|
||||
2, // 3: api.NamespaceService.CreateNamespace:input_type -> api.CreateNamespaceRequest
|
||||
1, // 4: api.NamespaceService.ListNamespaces:output_type -> api.ListNamespacesResponse
|
||||
3, // 5: api.NamespaceService.CreateNamespace:output_type -> api.Namespace
|
||||
4, // [4:6] is the sub-list for method output_type
|
||||
2, // [2:4] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_namespace_proto_init() }
|
||||
func file_namespace_proto_init() {
|
||||
if File_namespace_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_namespace_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListNamespacesRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_namespace_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListNamespacesResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_namespace_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CreateNamespaceRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_namespace_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Namespace); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_namespace_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_namespace_proto_goTypes,
|
||||
DependencyIndexes: file_namespace_proto_depIdxs,
|
||||
MessageInfos: file_namespace_proto_msgTypes,
|
||||
}.Build()
|
||||
File_namespace_proto = out.File
|
||||
file_namespace_proto_rawDesc = nil
|
||||
file_namespace_proto_goTypes = nil
|
||||
file_namespace_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConn
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// NamespaceServiceClient is the client API for NamespaceService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type NamespaceServiceClient interface {
|
||||
ListNamespaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListNamespacesResponse, error)
|
||||
ListNamespaces(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error)
|
||||
CreateNamespace(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*Namespace, error)
|
||||
}
|
||||
|
||||
type namespaceServiceClient struct {
|
||||
cc *grpc.ClientConn
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewNamespaceServiceClient(cc *grpc.ClientConn) NamespaceServiceClient {
|
||||
func NewNamespaceServiceClient(cc grpc.ClientConnInterface) NamespaceServiceClient {
|
||||
return &namespaceServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *namespaceServiceClient) ListNamespaces(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ListNamespacesResponse, error) {
|
||||
func (c *namespaceServiceClient) ListNamespaces(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error) {
|
||||
out := new(ListNamespacesResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.NamespaceService/ListNamespaces", in, out, opts...)
|
||||
if err != nil {
|
||||
@@ -170,25 +454,38 @@ func (c *namespaceServiceClient) ListNamespaces(ctx context.Context, in *empty.E
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *namespaceServiceClient) CreateNamespace(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*Namespace, error) {
|
||||
out := new(Namespace)
|
||||
err := c.cc.Invoke(ctx, "/api.NamespaceService/CreateNamespace", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// NamespaceServiceServer is the server API for NamespaceService service.
|
||||
type NamespaceServiceServer interface {
|
||||
ListNamespaces(context.Context, *empty.Empty) (*ListNamespacesResponse, error)
|
||||
ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error)
|
||||
CreateNamespace(context.Context, *CreateNamespaceRequest) (*Namespace, error)
|
||||
}
|
||||
|
||||
// UnimplementedNamespaceServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedNamespaceServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedNamespaceServiceServer) ListNamespaces(ctx context.Context, req *empty.Empty) (*ListNamespacesResponse, error) {
|
||||
func (*UnimplementedNamespaceServiceServer) ListNamespaces(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListNamespaces not implemented")
|
||||
}
|
||||
func (*UnimplementedNamespaceServiceServer) CreateNamespace(context.Context, *CreateNamespaceRequest) (*Namespace, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateNamespace not implemented")
|
||||
}
|
||||
|
||||
func RegisterNamespaceServiceServer(s *grpc.Server, srv NamespaceServiceServer) {
|
||||
s.RegisterService(&_NamespaceService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _NamespaceService_ListNamespaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(empty.Empty)
|
||||
in := new(ListNamespacesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -200,7 +497,25 @@ func _NamespaceService_ListNamespaces_Handler(srv interface{}, ctx context.Conte
|
||||
FullMethod: "/api.NamespaceService/ListNamespaces",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NamespaceServiceServer).ListNamespaces(ctx, req.(*empty.Empty))
|
||||
return srv.(NamespaceServiceServer).ListNamespaces(ctx, req.(*ListNamespacesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NamespaceService_CreateNamespace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateNamespaceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NamespaceServiceServer).CreateNamespace(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.NamespaceService/CreateNamespace",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NamespaceServiceServer).CreateNamespace(ctx, req.(*CreateNamespaceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -213,6 +528,10 @@ var _NamespaceService_serviceDesc = grpc.ServiceDesc{
|
||||
MethodName: "ListNamespaces",
|
||||
Handler: _NamespaceService_ListNamespaces_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateNamespace",
|
||||
Handler: _NamespaceService_CreateNamespace_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "namespace.proto",
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
@@ -32,24 +31,73 @@ var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
var (
|
||||
filter_NamespaceService_ListNamespaces_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_NamespaceService_ListNamespaces_0(ctx context.Context, marshaler runtime.Marshaler, client NamespaceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var protoReq ListNamespacesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NamespaceService_ListNamespaces_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListNamespaces(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_NamespaceService_ListNamespaces_0(ctx context.Context, marshaler runtime.Marshaler, server NamespaceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq empty.Empty
|
||||
var protoReq ListNamespacesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_NamespaceService_ListNamespaces_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListNamespaces(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_NamespaceService_CreateNamespace_0(ctx context.Context, marshaler runtime.Marshaler, client NamespaceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateNamespaceRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Namespace); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.CreateNamespace(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_NamespaceService_CreateNamespace_0(ctx context.Context, marshaler runtime.Marshaler, server NamespaceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateNamespaceRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Namespace); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.CreateNamespace(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterNamespaceServiceHandlerServer registers the http handlers for service NamespaceService to "mux".
|
||||
// UnaryRPC :call NamespaceServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
@@ -75,6 +123,26 @@ func RegisterNamespaceServiceHandlerServer(ctx context.Context, mux *runtime.Ser
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_NamespaceService_CreateNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_NamespaceService_CreateNamespace_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_NamespaceService_CreateNamespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -136,13 +204,37 @@ func RegisterNamespaceServiceHandlerClient(ctx context.Context, mux *runtime.Ser
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_NamespaceService_CreateNamespace_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_NamespaceService_CreateNamespace_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_NamespaceService_CreateNamespace_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_NamespaceService_ListNamespaces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "namespaces"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_NamespaceService_CreateNamespace_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1beta1", "namespaces"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_NamespaceService_ListNamespaces_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_NamespaceService_CreateNamespace_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
|
||||
@@ -3,19 +3,38 @@ syntax = "proto3";
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service NamespaceService {
|
||||
rpc ListNamespaces(google.protobuf.Empty) returns (ListNamespacesResponse) {
|
||||
rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/namespaces"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CreateNamespace(CreateNamespaceRequest) returns (Namespace) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/namespaces"
|
||||
body: "namespace"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message ListNamespacesRequest {
|
||||
int32 pageSize = 1;
|
||||
int32 page = 2;
|
||||
string query = 3;
|
||||
}
|
||||
|
||||
message ListNamespacesResponse {
|
||||
int32 count = 1;
|
||||
repeated Namespace namespaces = 2;
|
||||
int32 page = 3;
|
||||
int32 pages = 4;
|
||||
int32 totalCount = 5;
|
||||
}
|
||||
|
||||
message CreateNamespaceRequest {
|
||||
Namespace namespace = 1;
|
||||
}
|
||||
|
||||
message Namespace {
|
||||
|
||||
1596
api/secret.pb.go
1596
api/secret.pb.go
File diff suppressed because it is too large
Load Diff
557
api/services.pb.go
Normal file
557
api/services.pb.go
Normal file
@@ -0,0 +1,557 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.22.0
|
||||
// protoc v3.11.4
|
||||
// source: services.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/golang/protobuf/ptypes/empty"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Service struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Service) Reset() {
|
||||
*x = Service{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Service) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Service) ProtoMessage() {}
|
||||
|
||||
func (x *Service) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Service.ProtoReflect.Descriptor instead.
|
||||
func (*Service) Descriptor() ([]byte, []int) {
|
||||
return file_services_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Service) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Service) GetUrl() string {
|
||||
if x != nil {
|
||||
return x.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetServiceRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) Reset() {
|
||||
*x = GetServiceRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetServiceRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetServiceRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetServiceRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetServiceRequest) Descriptor() ([]byte, []int) {
|
||||
return file_services_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) GetNamespace() string {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetServiceRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ListServicesRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
||||
PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
|
||||
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListServicesRequest) Reset() {
|
||||
*x = ListServicesRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListServicesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListServicesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListServicesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListServicesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ListServicesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_services_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *ListServicesRequest) GetNamespace() string {
|
||||
if x != nil {
|
||||
return x.Namespace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ListServicesRequest) GetPageSize() int32 {
|
||||
if x != nil {
|
||||
return x.PageSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListServicesRequest) GetPage() int32 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListServicesResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
|
||||
Services []*Service `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"`
|
||||
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
|
||||
Pages int32 `protobuf:"varint,4,opt,name=pages,proto3" json:"pages,omitempty"`
|
||||
TotalCount int32 `protobuf:"varint,5,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ListServicesResponse) Reset() {
|
||||
*x = ListServicesResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_services_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListServicesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ListServicesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListServicesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_services_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ListServicesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ListServicesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_services_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ListServicesResponse) GetCount() int32 {
|
||||
if x != nil {
|
||||
return x.Count
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListServicesResponse) GetServices() []*Service {
|
||||
if x != nil {
|
||||
return x.Services
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ListServicesResponse) GetPage() int32 {
|
||||
if x != nil {
|
||||
return x.Page
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListServicesResponse) GetPages() int32 {
|
||||
if x != nil {
|
||||
return x.Pages
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ListServicesResponse) GetTotalCount() int32 {
|
||||
if x != nil {
|
||||
return x.TotalCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_services_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_services_proto_rawDesc = []byte{
|
||||
0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x22, 0x2f, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72,
|
||||
0x6c, 0x22, 0x45, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73,
|
||||
0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1a, 0x0a,
|
||||
0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67,
|
||||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x22, 0xa0, 0x01,
|
||||
0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x08,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c,
|
||||
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61,
|
||||
0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x67, 0x65, 0x73,
|
||||
0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74,
|
||||
0x32, 0xe6, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12,
|
||||
0x28, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b,
|
||||
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x6e, 0x0a, 0x0c, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29,
|
||||
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x76, 0x31,
|
||||
0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
|
||||
0x7d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_services_proto_rawDescOnce sync.Once
|
||||
file_services_proto_rawDescData = file_services_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_services_proto_rawDescGZIP() []byte {
|
||||
file_services_proto_rawDescOnce.Do(func() {
|
||||
file_services_proto_rawDescData = protoimpl.X.CompressGZIP(file_services_proto_rawDescData)
|
||||
})
|
||||
return file_services_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_services_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_services_proto_goTypes = []interface{}{
|
||||
(*Service)(nil), // 0: api.Service
|
||||
(*GetServiceRequest)(nil), // 1: api.GetServiceRequest
|
||||
(*ListServicesRequest)(nil), // 2: api.ListServicesRequest
|
||||
(*ListServicesResponse)(nil), // 3: api.ListServicesResponse
|
||||
}
|
||||
var file_services_proto_depIdxs = []int32{
|
||||
0, // 0: api.ListServicesResponse.services:type_name -> api.Service
|
||||
1, // 1: api.ServiceService.GetService:input_type -> api.GetServiceRequest
|
||||
2, // 2: api.ServiceService.ListServices:input_type -> api.ListServicesRequest
|
||||
0, // 3: api.ServiceService.GetService:output_type -> api.Service
|
||||
3, // 4: api.ServiceService.ListServices:output_type -> api.ListServicesResponse
|
||||
3, // [3:5] is the sub-list for method output_type
|
||||
1, // [1:3] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_services_proto_init() }
|
||||
func file_services_proto_init() {
|
||||
if File_services_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_services_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Service); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetServiceRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListServicesRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_services_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListServicesResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_services_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_services_proto_goTypes,
|
||||
DependencyIndexes: file_services_proto_depIdxs,
|
||||
MessageInfos: file_services_proto_msgTypes,
|
||||
}.Build()
|
||||
File_services_proto = out.File
|
||||
file_services_proto_rawDesc = nil
|
||||
file_services_proto_goTypes = nil
|
||||
file_services_proto_depIdxs = nil
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ context.Context
|
||||
var _ grpc.ClientConnInterface
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// ServiceServiceClient is the client API for ServiceService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type ServiceServiceClient interface {
|
||||
GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error)
|
||||
ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error)
|
||||
}
|
||||
|
||||
type serviceServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewServiceServiceClient(cc grpc.ClientConnInterface) ServiceServiceClient {
|
||||
return &serviceServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *serviceServiceClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*Service, error) {
|
||||
out := new(Service)
|
||||
err := c.cc.Invoke(ctx, "/api.ServiceService/GetService", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceServiceClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) {
|
||||
out := new(ListServicesResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.ServiceService/ListServices", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ServiceServiceServer is the server API for ServiceService service.
|
||||
type ServiceServiceServer interface {
|
||||
GetService(context.Context, *GetServiceRequest) (*Service, error)
|
||||
ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedServiceServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedServiceServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedServiceServiceServer) GetService(context.Context, *GetServiceRequest) (*Service, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetService not implemented")
|
||||
}
|
||||
func (*UnimplementedServiceServiceServer) ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListServices not implemented")
|
||||
}
|
||||
|
||||
func RegisterServiceServiceServer(s *grpc.Server, srv ServiceServiceServer) {
|
||||
s.RegisterService(&_ServiceService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _ServiceService_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetServiceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServiceServer).GetService(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.ServiceService/GetService",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServiceServer).GetService(ctx, req.(*GetServiceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ServiceService_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListServicesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServiceServer).ListServices(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.ServiceService/ListServices",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServiceServer).ListServices(ctx, req.(*ListServicesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _ServiceService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api.ServiceService",
|
||||
HandlerType: (*ServiceServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetService",
|
||||
Handler: _ServiceService_GetService_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListServices",
|
||||
Handler: _ServiceService_ListServices_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "services.proto",
|
||||
}
|
||||
318
api/services.pb.gw.go
Normal file
318
api/services.pb.gw.go
Normal file
@@ -0,0 +1,318 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: services.proto
|
||||
|
||||
/*
|
||||
Package api is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_ServiceService_GetService_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetServiceRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_ServiceService_GetService_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetServiceRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["name"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
|
||||
}
|
||||
|
||||
protoReq.Name, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetService(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_ServiceService_ListServices_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
||||
func request_ServiceService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListServicesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ServiceService_ListServices_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_ServiceService_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListServicesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_ServiceService_ListServices_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListServices(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterServiceServiceHandlerServer registers the http handlers for service ServiceService to "mux".
|
||||
// UnaryRPC :call ServiceServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterServiceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_ServiceService_GetService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_ServiceService_GetService_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ServiceService_GetService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_ServiceService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_ServiceService_ListServices_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ServiceService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterServiceServiceHandlerFromEndpoint is same as RegisterServiceServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterServiceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterServiceServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterServiceServiceHandler registers the http handlers for service ServiceService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterServiceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterServiceServiceHandlerClient(ctx, mux, NewServiceServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterServiceServiceHandlerClient registers the http handlers for service ServiceService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "ServiceServiceClient" to call the correct interceptors.
|
||||
func RegisterServiceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_ServiceService_GetService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_ServiceService_GetService_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ServiceService_GetService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_ServiceService_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_ServiceService_ListServices_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_ServiceService_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_ServiceService_GetService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "service", "name"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_ServiceService_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "service"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_ServiceService_GetService_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_ServiceService_ListServices_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
44
api/services.proto
Normal file
44
api/services.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service ServiceService {
|
||||
rpc GetService(GetServiceRequest) returns (Service) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/service/{name}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/service"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message Service {
|
||||
string name = 1;
|
||||
string url = 2;
|
||||
}
|
||||
|
||||
message GetServiceRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
message ListServicesRequest {
|
||||
string namespace = 1;
|
||||
int32 pageSize = 2;
|
||||
int32 page = 3;
|
||||
}
|
||||
|
||||
message ListServicesResponse {
|
||||
int32 count = 1;
|
||||
repeated Service services = 2;
|
||||
int32 page = 3;
|
||||
int32 pages = 4;
|
||||
int32 totalCount = 5;
|
||||
}
|
||||
3504
api/workflow.pb.go
3504
api/workflow.pb.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,19 +6,34 @@ import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "workflow_template.proto";
|
||||
import "metric.proto";
|
||||
import "label.proto";
|
||||
import "common.proto";
|
||||
|
||||
service WorkflowService {
|
||||
// Creates a Workflow
|
||||
rpc CreateWorkflowExecution (CreateWorkflowExecutionRequest) returns (WorkflowExecution) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_executions"
|
||||
body: "workflowExecution"
|
||||
body: "body"
|
||||
};
|
||||
}
|
||||
|
||||
// Clone a Workflow. This is the same as running it again.
|
||||
rpc CloneWorkflowExecution (CloneWorkflowExecutionRequest) returns (WorkflowExecution) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_executions/{uid}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkflowExecutionStatisticsForNamespace (GetWorkflowExecutionStatisticsForNamespaceRequest) returns (GetWorkflowExecutionStatisticsForNamespaceResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/statistics"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkflowExecution (GetWorkflowExecutionRequest) returns (WorkflowExecution) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}"
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{uid}"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -30,136 +45,123 @@ service WorkflowService {
|
||||
|
||||
rpc WatchWorkflowExecution (WatchWorkflowExecutionRequest) returns (stream WorkflowExecution) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/watch"
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/watch"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkflowExecutionLogs (GetWorkflowExecutionLogsRequest) returns (stream LogEntry) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/containers/{containerName}/logs"
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/pods/{podName}/containers/{containerName}/logs"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkflowExecutionMetrics (GetWorkflowExecutionMetricsRequest) returns (GetWorkflowExecutionMetricsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/metrics"
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/pods/{podName}/metrics"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ResubmitWorkflowExecution (ResubmitWorkflowExecutionRequest) returns (WorkflowExecution) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workflow_executions/{name}/resubmit"
|
||||
put: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/resubmit"
|
||||
};
|
||||
}
|
||||
|
||||
rpc TerminateWorkflowExecution (TerminateWorkflowExecutionRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workflow_executions/{name}/terminate"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CreateWorkflowTemplate (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_templates"
|
||||
body: "workflowTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateWorkflowTemplateVersion (UpdateWorkflowTemplateVersionRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions/{workflowTemplate.version}"
|
||||
body: "workflowTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CreateWorkflowTemplateVersion (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions"
|
||||
body: "workflowTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkflowTemplate (GetWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}"
|
||||
additional_bindings {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions/{version}"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkflowTemplateVersions (ListWorkflowTemplateVersionsRequest) returns (ListWorkflowTemplateVersionsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkflowTemplates (ListWorkflowTemplatesRequest) returns (ListWorkflowTemplatesResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ArchiveWorkflowTemplate (ArchiveWorkflowTemplateRequest) returns (ArchiveWorkflowTemplateResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/archive"
|
||||
put: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/terminate"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetArtifact (GetArtifactRequest) returns (ArtifactResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/artifacts/{key=**}"
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/artifacts/{key=**}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListFiles (ListFilesRequest) returns (ListFilesResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/files/{path=**}"
|
||||
get: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/files/{path=**}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc AddWorkflowExecutionStatistics (AddWorkflowExecutionStatisticRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/statistics"
|
||||
body: "statistics"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CronStartWorkflowExecutionStatistic (CronStartWorkflowExecutionStatisticRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/cron_start_statistics"
|
||||
body: "statistics"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateWorkflowExecutionStatus (UpdateWorkflowExecutionStatusRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workflow_executions/{uid}/status"
|
||||
body: "status"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message CreateWorkflowExecutionRequest {
|
||||
message CreateWorkflowExecutionBody {
|
||||
string workflowTemplateUid = 2;
|
||||
int64 workflowTemplateVersion = 3;
|
||||
|
||||
repeated Parameter parameters = 4;
|
||||
repeated KeyValue labels = 5;
|
||||
}
|
||||
|
||||
message CreateWorkflowExecutionRequest {
|
||||
string namespace = 1;
|
||||
WorkflowExecution workflowExecution = 2;
|
||||
|
||||
CreateWorkflowExecutionBody body = 2;
|
||||
}
|
||||
|
||||
message CloneWorkflowExecutionRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message GetWorkflowExecutionRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message GetArtifactRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
string key = 3;
|
||||
}
|
||||
|
||||
message WatchWorkflowExecutionRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message ResubmitWorkflowExecutionRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message TerminateWorkflowExecutionRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message GetWorkflowExecutionLogsRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
string podName = 3;
|
||||
string containerName = 4;
|
||||
}
|
||||
|
||||
message GetWorkflowExecutionMetricsRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
string podName = 3;
|
||||
}
|
||||
|
||||
@@ -173,6 +175,10 @@ message ListWorkflowExecutionsRequest {
|
||||
string workflowTemplateVersion = 3;
|
||||
int32 pageSize = 4;
|
||||
int32 page = 5;
|
||||
string order = 6;
|
||||
string labels = 7;
|
||||
string phase = 8;
|
||||
bool includeSystem = 9;
|
||||
}
|
||||
|
||||
message ListWorkflowExecutionsResponse {
|
||||
@@ -188,6 +194,10 @@ message LogEntry {
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
message WorkflowExecutionMetadata {
|
||||
string url = 1;
|
||||
}
|
||||
|
||||
message WorkflowExecution {
|
||||
string createdAt = 1;
|
||||
string uid = 2;
|
||||
@@ -197,14 +207,13 @@ message WorkflowExecution {
|
||||
string finishedAt = 6;
|
||||
string manifest = 7;
|
||||
|
||||
repeated WorkflowExecutionParameter parameters = 8;
|
||||
repeated Parameter parameters = 8;
|
||||
|
||||
WorkflowTemplate workflowTemplate = 9;
|
||||
}
|
||||
|
||||
message WorkflowExecutionParameter {
|
||||
string name = 1;
|
||||
string value = 2;
|
||||
repeated KeyValue labels = 10;
|
||||
|
||||
WorkflowExecutionMetadata metadata = 11;
|
||||
}
|
||||
|
||||
message ArtifactResponse {
|
||||
@@ -223,11 +232,46 @@ message File {
|
||||
|
||||
message ListFilesRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
string uid = 2;
|
||||
string path = 3;
|
||||
}
|
||||
|
||||
message ListFilesResponse {
|
||||
repeated File files = 1;
|
||||
string parentPath = 2;
|
||||
}
|
||||
|
||||
message Statistics {
|
||||
string workflowStatus = 1;
|
||||
int64 workflowTemplateId = 2;
|
||||
}
|
||||
|
||||
message AddWorkflowExecutionStatisticRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
Statistics statistics = 3;
|
||||
}
|
||||
|
||||
message CronStartWorkflowExecutionStatisticRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
Statistics statistics = 3;
|
||||
}
|
||||
|
||||
message WorkflowExecutionStatus {
|
||||
string phase = 1;
|
||||
}
|
||||
|
||||
message UpdateWorkflowExecutionStatusRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
WorkflowExecutionStatus status = 3;
|
||||
}
|
||||
|
||||
message GetWorkflowExecutionStatisticsForNamespaceRequest {
|
||||
string namespace = 1;
|
||||
}
|
||||
|
||||
message GetWorkflowExecutionStatisticsForNamespaceResponse {
|
||||
WorkflowExecutionStatisticReport stats = 1;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
1286
api/workflow_template.pb.gw.go
Normal file
1286
api/workflow_template.pb.gw.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,62 @@ syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "label.proto";
|
||||
import "common.proto";
|
||||
|
||||
service WorkflowTemplateService {
|
||||
rpc CreateWorkflowTemplate (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_templates"
|
||||
body: "workflowTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CreateWorkflowTemplateVersion (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions"
|
||||
body: "workflowTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkflowTemplate (GetWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}"
|
||||
additional_bindings {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions/{version}"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkflowTemplateVersions (ListWorkflowTemplateVersionsRequest) returns (ListWorkflowTemplateVersionsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkflowTemplates (ListWorkflowTemplatesRequest) returns (ListWorkflowTemplatesResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates"
|
||||
};
|
||||
}
|
||||
|
||||
rpc CloneWorkflowTemplate (CloneWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/clone/{name}"
|
||||
additional_bindings {
|
||||
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/clone/{name}/{version}"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
rpc ArchiveWorkflowTemplate (ArchiveWorkflowTemplateRequest) returns (ArchiveWorkflowTemplateResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/archive"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message CreateWorkflowTemplateRequest {
|
||||
string namespace = 1;
|
||||
WorkflowTemplate workflowTemplate = 2;
|
||||
@@ -15,7 +71,14 @@ message UpdateWorkflowTemplateVersionRequest {
|
||||
message GetWorkflowTemplateRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
int32 version = 3;
|
||||
int64 version = 3;
|
||||
}
|
||||
|
||||
message CloneWorkflowTemplateRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
string name = 3;
|
||||
int64 version = 4;
|
||||
}
|
||||
|
||||
message ListWorkflowTemplateVersionsRequest {
|
||||
@@ -30,11 +93,18 @@ message ListWorkflowTemplateVersionsResponse {
|
||||
|
||||
message ListWorkflowTemplatesRequest {
|
||||
string namespace = 1;
|
||||
int32 pageSize = 2;
|
||||
int32 page = 3;
|
||||
|
||||
string labels = 4;
|
||||
}
|
||||
|
||||
message ListWorkflowTemplatesResponse {
|
||||
int32 count = 1;
|
||||
repeated WorkflowTemplate workflowTemplates = 2;
|
||||
int32 page = 3;
|
||||
int32 pages = 4;
|
||||
int32 totalCount = 5;
|
||||
}
|
||||
|
||||
message ArchiveWorkflowTemplateRequest {
|
||||
@@ -46,12 +116,38 @@ message ArchiveWorkflowTemplateResponse {
|
||||
WorkflowTemplate workflowTemplate = 1;
|
||||
}
|
||||
|
||||
message WorkflowExecutionStatisticReport {
|
||||
int32 total = 1;
|
||||
string lastExecuted = 2;
|
||||
int32 running = 3;
|
||||
int32 completed = 4;
|
||||
int32 failed = 5;
|
||||
int32 terminated = 6;
|
||||
}
|
||||
|
||||
message CronWorkflowStatisticsReport {
|
||||
int32 total = 1;
|
||||
}
|
||||
|
||||
message WorkflowTemplate {
|
||||
string createdAt = 1;
|
||||
string uid = 2;
|
||||
string name = 3;
|
||||
int32 version = 4;
|
||||
string manifest = 5;
|
||||
bool isLatest = 6;
|
||||
bool isArchived = 7;
|
||||
string modifiedAt = 2;
|
||||
string uid = 3;
|
||||
string name = 4;
|
||||
int64 version = 5;
|
||||
int64 versions = 6;
|
||||
string manifest = 7;
|
||||
bool isLatest = 8;
|
||||
bool isArchived = 9;
|
||||
repeated KeyValue labels = 10;
|
||||
|
||||
WorkflowExecutionStatisticReport stats = 11;
|
||||
CronWorkflowStatisticsReport cronStats = 12;
|
||||
repeated Parameter parameters = 13;
|
||||
}
|
||||
|
||||
message GetWorkflowTemplateLabelsRequest {
|
||||
string namespace = 1;
|
||||
string name = 2;
|
||||
int64 version = 3;
|
||||
}
|
||||
2202
api/workspace.pb.go
Normal file
2202
api/workspace.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
1282
api/workspace.pb.gw.go
Normal file
1282
api/workspace.pb.gw.go
Normal file
File diff suppressed because it is too large
Load Diff
193
api/workspace.proto
Normal file
193
api/workspace.proto
Normal file
@@ -0,0 +1,193 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "workspace_template.proto";
|
||||
import "common.proto";
|
||||
import "label.proto";
|
||||
|
||||
service WorkspaceService {
|
||||
rpc CreateWorkspace (CreateWorkspaceRequest) returns (Workspace) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workspaces"
|
||||
body: "body"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkspaceStatisticsForNamespace (GetWorkspaceStatisticsForNamespaceRequest) returns (GetWorkspaceStatisticsForNamespaceResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workspace/statistics"
|
||||
};
|
||||
}
|
||||
|
||||
rpc GetWorkspace (GetWorkspaceRequest) returns (Workspace) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workspaces/{uid}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkspaces (ListWorkspaceRequest) returns (ListWorkspaceResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workspaces"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateWorkspaceStatus (UpdateWorkspaceStatusRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/status"
|
||||
body: "status"
|
||||
};
|
||||
}
|
||||
|
||||
rpc UpdateWorkspace (UpdateWorkspaceRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workspaces/{uid}"
|
||||
body: "body"
|
||||
};
|
||||
}
|
||||
|
||||
rpc PauseWorkspace (PauseWorkspaceRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/pause"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ResumeWorkspace (ResumeWorkspaceRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/resume"
|
||||
};
|
||||
}
|
||||
|
||||
rpc DeleteWorkspace (DeleteWorkspaceRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
delete: "/apis/v1beta1/{namespace}/workspaces/{uid}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc RetryLastWorkspaceAction (RetryActionWorkspaceRequest) returns (google.protobuf.Empty) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/retry"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message Workspace {
|
||||
string uid = 1;
|
||||
string name = 2;
|
||||
int64 version = 3;
|
||||
string createdAt = 4;
|
||||
repeated Parameter parameters = 5;
|
||||
WorkspaceTemplate workspaceTemplate = 6;
|
||||
WorkspaceStatus status = 7;
|
||||
repeated KeyValue labels = 8;
|
||||
string url = 9;
|
||||
repeated Parameter templateParameters = 10;
|
||||
}
|
||||
|
||||
message WorkspaceStatus {
|
||||
string phase = 1;
|
||||
string startedAt = 2;
|
||||
string pausedAt = 3;
|
||||
string terminatedAt = 4;
|
||||
}
|
||||
|
||||
message CreateWorkspaceBody {
|
||||
string workspaceTemplateUid = 1;
|
||||
int64 workspaceTemplateVersion = 2;
|
||||
|
||||
repeated Parameter parameters = 3;
|
||||
repeated KeyValue labels = 4;
|
||||
}
|
||||
|
||||
message CreateWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
|
||||
CreateWorkspaceBody body = 2;
|
||||
}
|
||||
|
||||
message GetWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message UpdateWorkspaceStatusRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
WorkspaceStatus status = 3;
|
||||
}
|
||||
|
||||
message UpdateWorkspaceBody {
|
||||
repeated Parameter parameters = 1;
|
||||
repeated KeyValue labels = 2;
|
||||
}
|
||||
|
||||
message UpdateWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
UpdateWorkspaceBody body = 3;
|
||||
}
|
||||
|
||||
message ListWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
int32 pageSize = 2;
|
||||
int32 page = 3;
|
||||
string order = 4;
|
||||
string labels = 5;
|
||||
string phase = 6;
|
||||
}
|
||||
|
||||
message ListWorkspaceResponse {
|
||||
int32 count = 1;
|
||||
repeated Workspace workspaces = 2;
|
||||
int32 page = 3;
|
||||
int32 pages = 4;
|
||||
int32 totalCount = 5;
|
||||
}
|
||||
|
||||
message PauseWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message ResumeWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message DeleteWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message RetryActionWorkspaceRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message WorkspaceStatisticReport {
|
||||
int32 total = 1;
|
||||
string lastCreated = 2;
|
||||
int32 launching = 3;
|
||||
int32 running = 4;
|
||||
int32 updating = 5;
|
||||
int32 pausing = 6;
|
||||
int32 paused = 7;
|
||||
int32 terminating = 8;
|
||||
int32 terminated = 9;
|
||||
int32 failedToPause = 10;
|
||||
int32 failedToResume = 11;
|
||||
int32 failedToTerminate = 12;
|
||||
int32 failedToLaunch = 13;
|
||||
int32 failedToUpdate = 14;
|
||||
int32 failed = 15;
|
||||
}
|
||||
|
||||
message GetWorkspaceStatisticsForNamespaceRequest {
|
||||
string namespace = 1;
|
||||
}
|
||||
|
||||
message GetWorkspaceStatisticsForNamespaceResponse {
|
||||
WorkspaceStatisticReport stats = 1;
|
||||
}
|
||||
1428
api/workspace_template.pb.go
Normal file
1428
api/workspace_template.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
959
api/workspace_template.pb.gw.go
Normal file
959
api/workspace_template.pb.gw.go
Normal file
@@ -0,0 +1,959 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: workspace_template.proto
|
||||
|
||||
/*
|
||||
Package api is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GenerateWorkspaceTemplateWorkflowTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkspaceTemplate); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.GenerateWorkspaceTemplateWorkflowTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GenerateWorkspaceTemplateWorkflowTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkspaceTemplate); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.GenerateWorkspaceTemplateWorkflowTemplate(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_WorkspaceTemplateService_CreateWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkspaceTemplate); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
msg, err := client.CreateWorkspaceTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkspaceTemplateService_CreateWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkspaceTemplate); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
msg, err := server.CreateWorkspaceTemplate(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_WorkspaceTemplateService_UpdateWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkspaceTemplate); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.UpdateWorkspaceTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkspaceTemplateService_UpdateWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkspaceTemplate); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.UpdateWorkspaceTemplate(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ArchiveWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.ArchiveWorkspaceTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ArchiveWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.ArchiveWorkspaceTemplate(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_WorkspaceTemplateService_GetWorkspaceTemplate_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0, "uid": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
|
||||
)
|
||||
|
||||
func request_WorkspaceTemplateService_GetWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorkspaceTemplateService_GetWorkspaceTemplate_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetWorkspaceTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkspaceTemplateService_GetWorkspaceTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetWorkspaceTemplateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WorkspaceTemplateService_GetWorkspaceTemplate_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetWorkspaceTemplate(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_WorkspaceTemplateService_ListWorkspaceTemplates_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
||||
func request_WorkspaceTemplateService_ListWorkspaceTemplates_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListWorkspaceTemplatesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorkspaceTemplateService_ListWorkspaceTemplates_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListWorkspaceTemplates(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkspaceTemplateService_ListWorkspaceTemplates_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListWorkspaceTemplatesRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WorkspaceTemplateService_ListWorkspaceTemplates_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListWorkspaceTemplates(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0(ctx context.Context, marshaler runtime.Marshaler, client WorkspaceTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListWorkspaceTemplateVersionsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListWorkspaceTemplateVersions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0(ctx context.Context, marshaler runtime.Marshaler, server WorkspaceTemplateServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListWorkspaceTemplateVersionsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["namespace"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
|
||||
}
|
||||
|
||||
protoReq.Namespace, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["uid"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
|
||||
}
|
||||
|
||||
protoReq.Uid, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListWorkspaceTemplateVersions(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterWorkspaceTemplateServiceHandlerServer registers the http handlers for service WorkspaceTemplateService to "mux".
|
||||
// UnaryRPC :call WorkspaceTemplateServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterWorkspaceTemplateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorkspaceTemplateServiceServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_WorkspaceTemplateService_CreateWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceTemplateService_CreateWorkspaceTemplate_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_CreateWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_WorkspaceTemplateService_UpdateWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceTemplateService_UpdateWorkspaceTemplate_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_UpdateWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkspaceTemplateService_GetWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceTemplateService_GetWorkspaceTemplate_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_GetWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkspaceTemplateService_ListWorkspaceTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceTemplateService_ListWorkspaceTemplates_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_ListWorkspaceTemplates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterWorkspaceTemplateServiceHandlerFromEndpoint is same as RegisterWorkspaceTemplateServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterWorkspaceTemplateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterWorkspaceTemplateServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterWorkspaceTemplateServiceHandler registers the http handlers for service WorkspaceTemplateService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterWorkspaceTemplateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterWorkspaceTemplateServiceHandlerClient(ctx, mux, NewWorkspaceTemplateServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterWorkspaceTemplateServiceHandlerClient registers the http handlers for service WorkspaceTemplateService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WorkspaceTemplateServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WorkspaceTemplateServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "WorkspaceTemplateServiceClient" to call the correct interceptors.
|
||||
func RegisterWorkspaceTemplateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkspaceTemplateServiceClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_WorkspaceTemplateService_CreateWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceTemplateService_CreateWorkspaceTemplate_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_CreateWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_WorkspaceTemplateService_UpdateWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceTemplateService_UpdateWorkspaceTemplate_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_UpdateWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PUT", pattern_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkspaceTemplateService_GetWorkspaceTemplate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceTemplateService_GetWorkspaceTemplate_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_GetWorkspaceTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkspaceTemplateService_ListWorkspaceTemplates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceTemplateService_ListWorkspaceTemplates_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_ListWorkspaceTemplates_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workspace_templates", "uid", "workflow_template"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkspaceTemplateService_CreateWorkspaceTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workspace_templates"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkspaceTemplateService_UpdateWorkspaceTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workspace_templates", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workspace_templates", "uid", "archive"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkspaceTemplateService_GetWorkspaceTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workspace_templates", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkspaceTemplateService_ListWorkspaceTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workspace_templates"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workspace_templates", "uid", "versions"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_WorkspaceTemplateService_GenerateWorkspaceTemplateWorkflowTemplate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkspaceTemplateService_CreateWorkspaceTemplate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkspaceTemplateService_UpdateWorkspaceTemplate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkspaceTemplateService_ArchiveWorkspaceTemplate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkspaceTemplateService_GetWorkspaceTemplate_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkspaceTemplateService_ListWorkspaceTemplates_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_WorkspaceTemplateService_ListWorkspaceTemplateVersions_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
130
api/workspace_template.proto
Normal file
130
api/workspace_template.proto
Normal file
@@ -0,0 +1,130 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package api;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "workflow_template.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
import "label.proto";
|
||||
|
||||
service WorkspaceTemplateService {
|
||||
// Get the generated WorkflowTemplate for a WorkspaceTemplate
|
||||
rpc GenerateWorkspaceTemplateWorkflowTemplate (GenerateWorkspaceTemplateWorkflowTemplateRequest) returns (WorkflowTemplate) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workspace_templates/{uid}/workflow_template"
|
||||
body: "workspaceTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
// Creates a WorkspaceTemplate
|
||||
rpc CreateWorkspaceTemplate (CreateWorkspaceTemplateRequest) returns (WorkspaceTemplate) {
|
||||
option (google.api.http) = {
|
||||
post: "/apis/v1beta1/{namespace}/workspace_templates"
|
||||
body: "workspaceTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
// Updates a WorkspaceTemplate
|
||||
rpc UpdateWorkspaceTemplate (UpdateWorkspaceTemplateRequest) returns (WorkspaceTemplate) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workspace_templates/{uid}"
|
||||
body: "workspaceTemplate"
|
||||
};
|
||||
}
|
||||
|
||||
// Archives a WorkspaceTemplate
|
||||
rpc ArchiveWorkspaceTemplate (ArchiveWorkspaceTemplateRequest) returns (WorkspaceTemplate) {
|
||||
option (google.api.http) = {
|
||||
put: "/apis/v1beta1/{namespace}/workspace_templates/{uid}/archive"
|
||||
};
|
||||
}
|
||||
|
||||
// Get a WorkspaceTemplate
|
||||
rpc GetWorkspaceTemplate (GetWorkspaceTemplateRequest) returns (WorkspaceTemplate) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workspace_templates/{uid}"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkspaceTemplates (ListWorkspaceTemplatesRequest) returns (ListWorkspaceTemplatesResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workspace_templates"
|
||||
};
|
||||
}
|
||||
|
||||
rpc ListWorkspaceTemplateVersions (ListWorkspaceTemplateVersionsRequest) returns (ListWorkspaceTemplateVersionsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/apis/v1beta1/{namespace}/workspace_templates/{uid}/versions"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message WorkspaceTemplate {
|
||||
string uid = 1;
|
||||
string name = 2;
|
||||
int64 version = 3;
|
||||
string manifest = 4;
|
||||
bool isLatest = 5;
|
||||
string createdAt = 6;
|
||||
WorkflowTemplate workflowTemplate = 7;
|
||||
repeated KeyValue labels = 8;
|
||||
bool isArchived = 9;
|
||||
string description = 10;
|
||||
}
|
||||
|
||||
message GenerateWorkspaceTemplateWorkflowTemplateRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
WorkspaceTemplate workspaceTemplate = 3;
|
||||
}
|
||||
|
||||
message CreateWorkspaceTemplateRequest {
|
||||
string namespace = 1;
|
||||
WorkspaceTemplate workspaceTemplate = 2;
|
||||
}
|
||||
|
||||
message UpdateWorkspaceTemplateRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
WorkspaceTemplate workspaceTemplate = 3;
|
||||
}
|
||||
|
||||
message GetWorkspaceTemplateRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
int64 version = 3;
|
||||
}
|
||||
|
||||
message ArchiveWorkspaceTemplateRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message ListWorkspaceTemplatesRequest {
|
||||
string namespace = 1;
|
||||
int32 pageSize = 2;
|
||||
int32 page = 3;
|
||||
string order = 4;
|
||||
string labels = 5;
|
||||
string uid = 6;
|
||||
}
|
||||
|
||||
message ListWorkspaceTemplatesResponse {
|
||||
int32 count = 1;
|
||||
repeated WorkspaceTemplate workspaceTemplates = 2;
|
||||
int32 page = 3;
|
||||
int32 pages = 4;
|
||||
int32 totalCount = 5;
|
||||
}
|
||||
|
||||
message ListWorkspaceTemplateVersionsRequest {
|
||||
string namespace = 1;
|
||||
string uid = 2;
|
||||
}
|
||||
|
||||
message ListWorkspaceTemplateVersionsResponse {
|
||||
int32 count = 1;
|
||||
repeated WorkspaceTemplate workspaceTemplates = 2;
|
||||
}
|
||||
|
||||
|
||||
17
cmd/README.md
Normal file
17
cmd/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Helper scripts
|
||||
|
||||
## gen-release-md.go
|
||||
Generates markdown for releases.
|
||||
|
||||
Usage:
|
||||
```bash
|
||||
go run cmd/gen-release-md/gen-release-md.go -v=0.10.0 -u=[github-username] > /tmp/release.md
|
||||
```
|
||||
|
||||
## goose.go
|
||||
Supports both Go and SQL migrations.
|
||||
|
||||
```bash
|
||||
go run cmd/goose/goose up # run up migrations
|
||||
go run cmd/goose/goose down # run down migrations
|
||||
```
|
||||
255
cmd/gen-release-md/gen-release-md.go
Normal file
255
cmd/gen-release-md/gen-release-md.go
Normal file
@@ -0,0 +1,255 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type user struct {
|
||||
Login string `json:"login"`
|
||||
URL string `json:"html_url"`
|
||||
AvatarURL string `json:"avatar_url"`
|
||||
ContributionsCount int
|
||||
}
|
||||
|
||||
type label struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type pullRequest struct {
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type issue struct {
|
||||
Number int `json:"number"`
|
||||
URL string `json:"html_url"`
|
||||
Title string `json:"title"`
|
||||
User user `json:"user"`
|
||||
PullRequest *pullRequest `json:"pull_request"`
|
||||
Labels []label `json:"labels"`
|
||||
}
|
||||
|
||||
type milestone struct {
|
||||
Number int `json:"number"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
const (
|
||||
apiPrefix = "https://api.github.com/repos/"
|
||||
)
|
||||
|
||||
var releaseTemplate = `# Documentation
|
||||
See https://docs.onepanel.ai
|
||||
|
||||
# CLI Installation
|
||||
|
||||
## Linux
|
||||
|
||||
` + "```" + `
|
||||
# Download the binary
|
||||
curl -sLO https://github.com/onepanelio/core/releases/download/v%s/opctl-linux-amd64
|
||||
|
||||
# Make binary executable
|
||||
chmod +x opctl-linux-amd64
|
||||
|
||||
# Move binary to path
|
||||
mv ./opctl-linux-amd64 /usr/local/bin/opctl
|
||||
|
||||
# Test installation
|
||||
opctl version
|
||||
` + "```" + `
|
||||
|
||||
## macOS
|
||||
|
||||
` + "```" + `
|
||||
# Download the binary
|
||||
curl -sLO https://github.com/onepanelio/core/releases/download/v%s/opctl-macos-amd64
|
||||
|
||||
# Make binary executable
|
||||
chmod +x opctl-macos-amd64
|
||||
|
||||
# Move binary to path
|
||||
mv ./opctl-macos-amd64 /usr/local/bin/opctl
|
||||
|
||||
# Test installation
|
||||
opctl version
|
||||
` + "```" + `
|
||||
|
||||
## Windows
|
||||
|
||||
Download the [attached executable](https://github.com/onepanelio/core/releases/download/v%s/opctl-windows-amd64.exe), rename it to "opctl" and move it to a folder that is in your PATH environment variable.
|
||||
`
|
||||
|
||||
var repositories = []string{
|
||||
"onepanelio/core",
|
||||
"onepanelio/core-ui",
|
||||
"onepanelio/cli",
|
||||
"onepanelio/manifests",
|
||||
"onepanelio/core-docs",
|
||||
}
|
||||
|
||||
func getPrefixSection(prefix string) (section string) {
|
||||
switch prefix {
|
||||
case "feat":
|
||||
fallthrough
|
||||
case "fix":
|
||||
fallthrough
|
||||
case "docs":
|
||||
section = prefix
|
||||
default:
|
||||
section = "other"
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Parse issues, pulling only PRs and categorize them based on labels
|
||||
// Print everything as MD that can be copied into release notes
|
||||
func printMarkDown(issues []*issue, version *string) {
|
||||
contributorsMap := make(map[string]user, 0)
|
||||
sections := make(map[string]string, 0)
|
||||
|
||||
for _, iss := range issues {
|
||||
if iss.PullRequest == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
parts := strings.Split(iss.Title, ":")
|
||||
if len(parts) > 0 {
|
||||
if user, ok := contributorsMap[iss.User.Login]; ok {
|
||||
user.ContributionsCount++
|
||||
contributorsMap[iss.User.Login] = user
|
||||
} else {
|
||||
iss.User.ContributionsCount = 1
|
||||
contributorsMap[iss.User.Login] = iss.User
|
||||
}
|
||||
sections[getPrefixSection(parts[0])] += fmt.Sprintf("- %s ([#%d](%s))\n", iss.Title, iss.Number, iss.URL)
|
||||
}
|
||||
}
|
||||
|
||||
releaseTemplate := fmt.Sprintf(releaseTemplate, *version, *version, *version)
|
||||
fmt.Println(releaseTemplate)
|
||||
fmt.Println("# Changelog")
|
||||
if sections["feat"] != "" {
|
||||
fmt.Println("## Features")
|
||||
fmt.Println(sections["feat"])
|
||||
}
|
||||
if sections["fix"] != "" {
|
||||
fmt.Println("## Fixes")
|
||||
fmt.Println(sections["fix"])
|
||||
}
|
||||
if sections["docs"] != "" {
|
||||
fmt.Println("## Docs")
|
||||
fmt.Println(sections["docs"])
|
||||
}
|
||||
if sections["other"] != "" {
|
||||
fmt.Println("## Other")
|
||||
fmt.Println(sections["other"])
|
||||
}
|
||||
|
||||
fmt.Println("# Contributors")
|
||||
contributors := make([]user, 0)
|
||||
for _, contributor := range contributorsMap {
|
||||
// Sorry, no bots.
|
||||
if contributor.Login == "dependabot[bot]" {
|
||||
continue
|
||||
}
|
||||
contributors = append(contributors, contributor)
|
||||
}
|
||||
sort.Slice(contributors, func(i, j int) bool { return contributors[i].ContributionsCount > contributors[j].ContributionsCount })
|
||||
for _, user := range contributors {
|
||||
fmt.Println(fmt.Sprintf("- <a href=\"%s\"><img src=\"%s\" width=\"12\"/> <strong>%s</strong></a> %s", user.URL, user.AvatarURL, user.Login, user.Login))
|
||||
}
|
||||
}
|
||||
|
||||
func httpGet(url string, username, token *string) (*http.Response, error) {
|
||||
client := &http.Client{}
|
||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||
if username != nil {
|
||||
req.SetBasicAuth(*username, *token)
|
||||
}
|
||||
res, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// Get milestone by title
|
||||
func getMilestone(repository string, version, username, token *string) (*milestone, error) {
|
||||
url := fmt.Sprintf("%s%s/milestones", apiPrefix, repository)
|
||||
res, err := httpGet(url, username, token)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return nil, errors.New("API rate limit exceeded")
|
||||
}
|
||||
|
||||
milestones := make([]*milestone, 0)
|
||||
if err = json.NewDecoder(res.Body).Decode(&milestones); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for _, milestone := range milestones {
|
||||
if milestone.Title == "v"+*version {
|
||||
return milestone, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, errors.New("milestone not found")
|
||||
}
|
||||
|
||||
// Get issues from repository
|
||||
func getIssues(repository string, milestone *milestone, username, token *string) ([]*issue, error) {
|
||||
url := fmt.Sprintf("%s%s/issues?state=closed&direction=asc&milestone=%d", apiPrefix, repository, milestone.Number)
|
||||
res, err := httpGet(url, username, token)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
if res.StatusCode != http.StatusOK {
|
||||
return nil, errors.New("API rate limit exceeded")
|
||||
}
|
||||
|
||||
issues := make([]*issue, 0)
|
||||
if err = json.NewDecoder(res.Body).Decode(&issues); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return issues, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
version := flag.String("v", "1.0.0", "Version of release, example: -v=1.0.0")
|
||||
username := flag.String("u", "", "GitHub username for request, example: -u=octocat")
|
||||
token := flag.String("t", "", "GitHub token for request, example: -t=<token>")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
issues := make([]*issue, 0)
|
||||
for _, repository := range repositories {
|
||||
mil, err := getMilestone(repository, version, username, token)
|
||||
if err != nil {
|
||||
fmt.Printf(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
iss, err := getIssues(repository, mil, username, token)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
issues = append(issues, iss...)
|
||||
}
|
||||
|
||||
printMarkDown(issues, version)
|
||||
}
|
||||
62
cmd/goose/goose.go
Normal file
62
cmd/goose/goose.go
Normal file
@@ -0,0 +1,62 @@
|
||||
// This is custom goose binary to support .go migration files in ./db dir
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"github.com/jmoiron/sqlx"
|
||||
migrations "github.com/onepanelio/core/db/go"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
var (
|
||||
flags = flag.NewFlagSet("goose", flag.ExitOnError)
|
||||
dir = flags.String("dir", ".", "directory with migration files")
|
||||
)
|
||||
|
||||
func main() {
|
||||
flags.Parse(os.Args[1:])
|
||||
args := flags.Args()
|
||||
|
||||
if len(args) < 1 {
|
||||
flags.Usage()
|
||||
return
|
||||
}
|
||||
|
||||
kubeConfig := v1.NewConfig()
|
||||
client, err := v1.NewClient(kubeConfig, nil, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Kubernetes cluster: %v", err)
|
||||
}
|
||||
config, err := client.GetSystemConfig()
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to get system config: %v", err)
|
||||
}
|
||||
|
||||
dbDriverName, dbDataSourceName := config.DatabaseConnection()
|
||||
db := sqlx.MustConnect(dbDriverName, dbDataSourceName)
|
||||
defer db.Close()
|
||||
|
||||
command := args[0]
|
||||
|
||||
arguments := []string{}
|
||||
if len(args) > 2 {
|
||||
arguments = append(arguments, args[2:]...)
|
||||
}
|
||||
|
||||
goose.SetTableName("goose_db_version")
|
||||
if err := goose.Run(command, db.DB, filepath.Join(*dir, "sql"), arguments...); err != nil {
|
||||
log.Fatalf("Failed to run database sql migrations: %v %v", command, err)
|
||||
}
|
||||
|
||||
goose.SetTableName("goose_db_go_version")
|
||||
migrations.Initialize()
|
||||
if err := goose.Run(command, db.DB, filepath.Join(*dir, "go"), arguments...); err != nil {
|
||||
log.Fatalf("Failed to run database go migrations: %v %v", command, err)
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workflow_templates DROP CONSTRAINT workflow_templates_name_namespace_key;
|
||||
CREATE UNIQUE INDEX workflow_templates_name_namespace_key ON workflow_templates (name, namespace) WHERE is_archived = false;
|
||||
|
||||
-- +goose Down
|
||||
DROP INDEX workflow_templates_name_namespace_key;
|
||||
ALTER TABLE workflow_templates ADD CONSTRAINT workflow_templates_name_namespace_key UNIQUE (name, namespace);
|
||||
137
db/go/20200525160514_add_jupyter_workspace_template.go
Normal file
137
db/go/20200525160514_add_jupyter_workspace_template.go
Normal file
@@ -0,0 +1,137 @@
|
||||
// Package migration is for carrying out migrations against the database.
|
||||
// To support Onepanel Core operations.
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
"log"
|
||||
)
|
||||
|
||||
const jupyterWorkspaceTemplate = `# Docker containers that are part of the Workspace
|
||||
containers:
|
||||
- name: jupyterlab-tensorflow
|
||||
image: jupyter/tensorflow-notebook
|
||||
command: [start.sh, jupyter]
|
||||
env:
|
||||
- name: tornado
|
||||
value: "{ 'headers': { 'Content-Security-Policy': \"frame-ancestors * 'self'\" } }"
|
||||
args:
|
||||
- lab
|
||||
- --LabApp.token=''
|
||||
- --LabApp.allow_remote_access=True
|
||||
- --LabApp.allow_origin="*"
|
||||
- --LabApp.disable_check_xsrf=True
|
||||
- --LabApp.trust_xheaders=True
|
||||
- --LabApp.tornado_settings=$(tornado)
|
||||
- --notebook-dir='/data'
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
name: jupyterlab
|
||||
# Volumes to be mounted in this container
|
||||
# Onepanel will automatically create these volumes and mount them to the container
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
# Ports that need to be exposed
|
||||
ports:
|
||||
- name: jupyterlab
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 8888
|
||||
# Routes that will map to ports
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
# DAG Workflow to be executed once a Workspace action completes
|
||||
# postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
const jupyterLabTemplateName = "JupyterLab"
|
||||
|
||||
func initialize20200525160514() {
|
||||
if _, ok := initializedMigrations[20200525160514]; !ok {
|
||||
goose.AddMigration(Up20200525160514, Down20200525160514)
|
||||
initializedMigrations[20200525160514] = true
|
||||
}
|
||||
}
|
||||
|
||||
func Up20200525160514(tx *sql.Tx) error {
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200525160514]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
Name: jupyterLabTemplateName,
|
||||
Manifest: jupyterWorkspaceTemplate,
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.CreateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func Down20200525160514(tx *sql.Tx) error {
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
uid, err := uid2.GenerateUID(jupyterLabTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.ArchiveWorkspaceTemplate(namespace.Name, uid); err != nil {
|
||||
log.Fatalf("error %v", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
189
db/go/20200528140124_add_cvat_workspace_template.go
Normal file
189
db/go/20200528140124_add_cvat_workspace_template.go
Normal file
@@ -0,0 +1,189 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
"log"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate = `# Docker containers that are part of the Workspace
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:v0.7.0
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:v0.7.0
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
# DAG Workflow to be executed once a Workspace action completes
|
||||
# postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
const cvatTemplateName = "CVAT"
|
||||
|
||||
func initialize20200528140124() {
|
||||
if _, ok := initializedMigrations[20200528140124]; !ok {
|
||||
goose.AddMigration(Up20200528140124, Down20200528140124)
|
||||
initializedMigrations[20200528140124] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200528140124 will insert the cvatTemplate to each user.
|
||||
// Each user is determined by onepanel enabled namespaces.
|
||||
// Any errors reported are logged as fatal.
|
||||
func Up20200528140124(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200528140124]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate,
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.CreateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200528140124 will attempt to remove cvatTemplate from each user.
|
||||
// Each user is determined by onepanel enabled namespaces.
|
||||
// DB entries are archived, K8S components are deleted.
|
||||
// Active workspaces with that template are terminated.
|
||||
// Any errors reported are logged as fatal.
|
||||
func Down20200528140124(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.ArchiveWorkspaceTemplate(namespace.Name, uid); err != nil {
|
||||
log.Fatalf("error %v", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
164
db/go/20200605090509_add_pytorch_workflow_template.go
Normal file
164
db/go/20200605090509_add_pytorch_workflow_template.go
Normal file
@@ -0,0 +1,164 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"log"
|
||||
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const pytorchMnistWorkflowTemplate = `entrypoint: main
|
||||
arguments:
|
||||
parameters:
|
||||
- name: source
|
||||
value: https://github.com/onepanelio/pytorch-examples.git
|
||||
- name: command
|
||||
value: "python mnist/main.py --epochs=1"
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
- metadata:
|
||||
name: output
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
templates:
|
||||
- name: main
|
||||
dag:
|
||||
tasks:
|
||||
- name: train-model
|
||||
template: pytorch
|
||||
# Uncomment section below to send metrics to Slack
|
||||
# - name: notify-in-slack
|
||||
# dependencies: [train-model]
|
||||
# template: slack-notify-success
|
||||
# arguments:
|
||||
# parameters:
|
||||
# - name: status
|
||||
# value: "{{tasks.train-model.status}}"
|
||||
# artifacts:
|
||||
# - name: metrics
|
||||
# from: "{{tasks.train-model.outputs.artifacts.sys-metrics}}"
|
||||
- name: pytorch
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: src
|
||||
path: /mnt/src
|
||||
git:
|
||||
repo: "{{workflow.parameters.source}}"
|
||||
outputs:
|
||||
artifacts:
|
||||
- name: model
|
||||
path: /mnt/output
|
||||
optional: true
|
||||
archive:
|
||||
none: {}
|
||||
container:
|
||||
image: pytorch/pytorch:latest
|
||||
command: [sh,-c]
|
||||
args: ["{{workflow.parameters.command}}"]
|
||||
workingDir: /mnt/src
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /mnt/data
|
||||
- name: output
|
||||
mountPath: /mnt/output
|
||||
- name: slack-notify-success
|
||||
container:
|
||||
image: technosophos/slack-notify
|
||||
command: [sh,-c]
|
||||
args: ['SLACK_USERNAME=Worker SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify']
|
||||
inputs:
|
||||
parameters:
|
||||
- name: status
|
||||
artifacts:
|
||||
- name: metrics
|
||||
path: /tmp/metrics.json
|
||||
optional: true
|
||||
`
|
||||
|
||||
const pytorchMnistWorkflowTemplateName = "PyTorch Training"
|
||||
|
||||
func initialize20200605090509() {
|
||||
if _, ok := initializedMigrations[20200605090509]; !ok {
|
||||
goose.AddMigration(Up20200605090509, Down20200605090509)
|
||||
initializedMigrations[20200605090509] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200605090509 will insert a Pytorch workflow template to each user.
|
||||
// Each user is determined by onepanel enabled namespaces.
|
||||
// Any errors reported are logged as fatal.
|
||||
func Up20200605090509(tx *sql.Tx) error {
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200605090509]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
workflowTemplate := &v1.WorkflowTemplate{
|
||||
Name: pytorchMnistWorkflowTemplateName,
|
||||
Manifest: pytorchMnistWorkflowTemplate,
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.CreateWorkflowTemplate(namespace.Name, workflowTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200605090509 will attempt to remove Pytorch workflow from each user.
|
||||
// Each user is determined by onepanel enabled namespaces.
|
||||
// DB entries are archived, K8S components are deleted.
|
||||
// Active workflows with that template are terminated.
|
||||
// Any errors reported are logged as fatal.
|
||||
func Down20200605090509(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(pytorchMnistWorkflowTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.ArchiveWorkflowTemplate(namespace.Name, uid); err != nil {
|
||||
log.Fatalf("error %v", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
163
db/go/20200605090535_add_tensorflow_workflow_template.go
Normal file
163
db/go/20200605090535_add_tensorflow_workflow_template.go
Normal file
@@ -0,0 +1,163 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"log"
|
||||
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const tensorflowWorkflowTemplate = `entrypoint: main
|
||||
arguments:
|
||||
parameters:
|
||||
- name: source
|
||||
value: https://github.com/onepanelio/tensorflow-examples.git
|
||||
- name: command
|
||||
value: "python mnist/main.py --epochs=5"
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
- metadata:
|
||||
name: output
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
templates:
|
||||
- name: main
|
||||
dag:
|
||||
tasks:
|
||||
- name: train-model
|
||||
template: pytorch
|
||||
# Uncomment section below to send metrics to Slack
|
||||
# - name: notify-in-slack
|
||||
# dependencies: [train-model]
|
||||
# template: slack-notify-success
|
||||
# arguments:
|
||||
# parameters:
|
||||
# - name: status
|
||||
# value: "{{tasks.train-model.status}}"
|
||||
# artifacts:
|
||||
# - name: metrics
|
||||
# from: "{{tasks.train-model.outputs.artifacts.sys-metrics}}"
|
||||
- name: pytorch
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: src
|
||||
path: /mnt/src
|
||||
git:
|
||||
repo: "{{workflow.parameters.source}}"
|
||||
outputs:
|
||||
artifacts:
|
||||
- name: model
|
||||
path: /mnt/output
|
||||
optional: true
|
||||
archive:
|
||||
none: {}
|
||||
container:
|
||||
image: tensorflow/tensorflow:latest
|
||||
command: [sh,-c]
|
||||
args: ["{{workflow.parameters.command}}"]
|
||||
workingDir: /mnt/src
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /mnt/data
|
||||
- name: output
|
||||
mountPath: /mnt/output
|
||||
- name: slack-notify-success
|
||||
container:
|
||||
image: technosophos/slack-notify
|
||||
command: [sh,-c]
|
||||
args: ['SLACK_USERNAME=Worker SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify']
|
||||
inputs:
|
||||
parameters:
|
||||
- name: status
|
||||
artifacts:
|
||||
- name: metrics
|
||||
path: /tmp/metrics.json
|
||||
optional: true
|
||||
`
|
||||
|
||||
const tensorflowWorkflowTemplateName = "TensorFlow Training"
|
||||
|
||||
func initialize20200605090535() {
|
||||
if _, ok := initializedMigrations[20200605090535]; !ok {
|
||||
goose.AddMigration(Up20200605090535, Down20200605090535)
|
||||
initializedMigrations[20200605090535] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200605090535 will insert a tensorflow workflow template to each user.
|
||||
// Each user is determined by onepanel enabled namespaces.
|
||||
// Any errors reported are logged as fatal.
|
||||
func Up20200605090535(tx *sql.Tx) error {
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200605090535]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
workflowTemplate := &v1.WorkflowTemplate{
|
||||
Name: tensorflowWorkflowTemplateName,
|
||||
Manifest: tensorflowWorkflowTemplate,
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.CreateWorkflowTemplate(namespace.Name, workflowTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200605090535 will attempt to remove tensorflow workflow from each user.
|
||||
// Each user is determined by onepanel enabled namespaces.
|
||||
// DB entries are archived, K8S components are deleted.
|
||||
// Active workflows with that template are terminated.
|
||||
// Any errors reported are logged as fatal.
|
||||
func Down20200605090535(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(tensorflowWorkflowTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.ArchiveWorkflowTemplate(namespace.Name, uid); err != nil {
|
||||
log.Fatalf("error %v", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
175
db/go/20200626113635_update_cvat_workspace_template.go
Normal file
175
db/go/20200626113635_update_cvat_workspace_template.go
Normal file
@@ -0,0 +1,175 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate2 = `# Docker containers that are part of the Workspace
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:v0.7.6
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:v0.7.5
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
- name: filesyncer
|
||||
image: onepanel/filesyncer:v0.0.4
|
||||
command: ['python3', 'main.py']
|
||||
volumeMounts:
|
||||
- name: share
|
||||
mountPath: /mnt/share
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
timeout: 600s
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
timeout: 600s
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
func initialize20200626113635() {
|
||||
if _, ok := initializedMigrations[20200626113635]; !ok {
|
||||
goose.AddMigration(Up20200626113635, Down20200626113635)
|
||||
initializedMigrations[20200626113635] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200626113635 updates the CVAT template to a new version.
|
||||
func Up20200626113635(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200626113635]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate2,
|
||||
}
|
||||
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200626113635 removes the CVAT template update
|
||||
func Down20200626113635(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
176
db/go/20200704151301_update_cvat_workspace_template.go
Normal file
176
db/go/20200704151301_update_cvat_workspace_template.go
Normal file
@@ -0,0 +1,176 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate3 = `# Docker containers that are part of the Workspace
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:v0.7.10-stable
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:v0.7.10-stable
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
# Uncomment following lines to enable S3 FileSyncer
|
||||
# Refer to https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_quick_guide#setting-up-environment-variables
|
||||
#- name: filesyncer
|
||||
# image: onepanel/filesyncer:v0.0.4
|
||||
# command: ['python3', 'main.py']
|
||||
# volumeMounts:
|
||||
# - name: share
|
||||
# mountPath: /mnt/share
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
timeout: 600s
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
timeout: 600s
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
func initialize20200704151301() {
|
||||
if _, ok := initializedMigrations[20200704151301]; !ok {
|
||||
goose.AddMigration(Up20200704151301, Down20200704151301)
|
||||
initializedMigrations[20200704151301] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200704151301 updates the CVAT template to a new version.
|
||||
func Up20200704151301(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200704151301]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate3,
|
||||
}
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200704151301 removes the CVAT template update
|
||||
func Down20200704151301(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
205
db/go/20200724220450_update_cvat_workspace.go
Normal file
205
db/go/20200724220450_update_cvat_workspace.go
Normal file
@@ -0,0 +1,205 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate4 = `# Workspace arguments
|
||||
arguments:
|
||||
parameters:
|
||||
- name: storage-prefix
|
||||
displayName: Directory in default object storage
|
||||
value: data
|
||||
hint: Location of data and models in default object storage, will continuously sync to '/mnt/share'
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:v0.7.10-stable
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:v0.7.10-stable
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
# You can add multiple FileSyncer sidecar containers if needed
|
||||
- name: filesyncer
|
||||
image: onepanel/filesyncer:{{.ArtifactRepositoryType}}
|
||||
args:
|
||||
- download
|
||||
env:
|
||||
- name: FS_PATH
|
||||
value: /mnt/share
|
||||
- name: FS_PREFIX
|
||||
value: '{{workspace.parameters.storage-prefix}}'
|
||||
volumeMounts:
|
||||
- name: share
|
||||
mountPath: /mnt/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
timeout: 600s
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
timeout: 600s
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
func initialize20200724220450() {
|
||||
if _, ok := initializedMigrations[20200724220450]; !ok {
|
||||
goose.AddMigration(Up20200724220450, Down20200724220450)
|
||||
initializedMigrations[20200724220450] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200724220450 updates the CVAT template to a new version.
|
||||
func Up20200724220450(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200724220450]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
artifactRepositoryType := "s3"
|
||||
nsConfig, err := client.GetNamespaceConfig(namespace.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if nsConfig.ArtifactRepository.GCS != nil {
|
||||
artifactRepositoryType = "gcs"
|
||||
}
|
||||
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate4,
|
||||
}
|
||||
workspaceTemplate.Manifest = strings.NewReplacer(
|
||||
"{{.ArtifactRepositoryType}}", artifactRepositoryType).Replace(workspaceTemplate.Manifest)
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200724220450 rolls back the CVAT template version
|
||||
func Down20200724220450(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
"github.com/onepanelio/core/pkg/util/request/pagination"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
func initialize20200727144157() {
|
||||
if _, ok := initializedMigrations[20200727144157]; !ok {
|
||||
goose.AddMigration(Up20200727144157, Down20200727144157)
|
||||
initializedMigrations[20200727144157] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200727144157 will go through all WorkflowTemplateVersion database entries
|
||||
// and attempt to generate the "parameters" column from the "manifests" column.
|
||||
func Up20200727144157(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200727144157]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
pageSize := int32(100)
|
||||
page := int32(0)
|
||||
paginator := pagination.NewRequest(page, pageSize)
|
||||
wtvsResults := -1
|
||||
for wtvsResults != 0 {
|
||||
wtvs, err := client.ListWorkflowTemplateVersionsAll(&paginator)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
//Exit condition; Check for more results
|
||||
wtvsResults = len(wtvs)
|
||||
if wtvsResults > 0 {
|
||||
page++
|
||||
paginator = pagination.NewRequest(page, pageSize)
|
||||
}
|
||||
|
||||
for _, wtv := range wtvs {
|
||||
params, err := v1.ParseParametersFromManifest([]byte(wtv.Manifest))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
wtv.Parameters = params
|
||||
err = client.UpdateWorkflowTemplateVersion(wtv)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200727144157 can be run before 20200727155027_add_parameters_col_to_workflow_template_version.sql
|
||||
// Nothing happens because the referenced SQL file will drop the "parameters" column.
|
||||
func Down20200727144157(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
42
db/go/20200728190804_update_workflow_template_labels.go
Normal file
42
db/go/20200728190804_update_workflow_template_labels.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
func initialize20200728190804() {
|
||||
if _, ok := initializedMigrations[20200728190804]; !ok {
|
||||
goose.AddMigration(Up20200728190804, Down20200728190804)
|
||||
initializedMigrations[20200728190804] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200728190804 is a legacy migration. Due to code changes, it no longer does anything.
|
||||
// It used to update labels so that we keep track of WorkflowTemplate labels.
|
||||
// Before, only workflow template versions had labels, but to speed up some queries, we now cache the latest version's labels
|
||||
// for workflow templates themselves.
|
||||
func Up20200728190804(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
if migrationHasAlreadyBeenRun(20200728190804) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Do nothing, be preserve for legacy.
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200728190804 rolls down the migration by deleting all workflow template labels, since they did not exist before this
|
||||
func Down20200728190804(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
return client.DeleteResourceLabels(tx, v1.TypeWorkflowTemplate)
|
||||
}
|
||||
510
db/go/20200812104328_update_maskrcnn_and_tf_od.go
Normal file
510
db/go/20200812104328_update_maskrcnn_and_tf_od.go
Normal file
@@ -0,0 +1,510 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
"github.com/pressly/goose"
|
||||
"log"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const maskRCNNWorkflowTemplate = `arguments:
|
||||
parameters:
|
||||
- name: source
|
||||
value: https://github.com/onepanelio/Mask_RCNN.git
|
||||
displayName: Model source code
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: sys-annotation-path
|
||||
value: annotation-dump/sample_dataset
|
||||
hint: Path to annotated data in default object storage (i.e S3). In CVAT, this parameter will be pre-populated.
|
||||
displayName: Dataset path
|
||||
visibility: private
|
||||
|
||||
- name: sys-output-path
|
||||
value: workflow-data/output/sample_output
|
||||
hint: Path to store output artifacts in default object storage (i.e s3). In CVAT, this parameter will be pre-populated.
|
||||
displayName: Workflow output path
|
||||
visibility: private
|
||||
|
||||
- name: sys-finetune-checkpoint
|
||||
value: ''
|
||||
hint: Select the last fine-tune checkpoint for this model. It may take up to 5 minutes for a recent checkpoint show here. Leave empty if this is the first time you're training this model.
|
||||
displayName: Checkpoint path
|
||||
visibility: public
|
||||
|
||||
- name: sys-num-classes
|
||||
displayName: Number of classes
|
||||
hint: Number of classes (i.e in CVAT taks) + 1 for background
|
||||
value: 81
|
||||
visibility: private
|
||||
|
||||
- name: extras
|
||||
displayName: Hyperparameters
|
||||
visibility: public
|
||||
type: textarea.textarea
|
||||
value: |-
|
||||
stage-1-epochs=1 # Epochs for network heads
|
||||
stage-2-epochs=2 # Epochs for finetune layers
|
||||
stage-3-epochs=3 # Epochs for all layers
|
||||
hint: "Please refer to our <a href='https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_annotation_model#arguments-optional' target='_blank'>documentation</a> for more information on parameters."
|
||||
|
||||
- name: dump-format
|
||||
type: select.select
|
||||
value: cvat_coco
|
||||
displayName: CVAT dump format
|
||||
visibility: public
|
||||
options:
|
||||
- name: 'MS COCO'
|
||||
value: 'cvat_coco'
|
||||
- name: 'TF Detection API'
|
||||
value: 'cvat_tfrecord'
|
||||
|
||||
- name: tf-image
|
||||
visibility: public
|
||||
value: tensorflow/tensorflow:1.13.1-py3
|
||||
type: select.select
|
||||
displayName: Select TensorFlow image
|
||||
hint: Select the GPU image if you are running on a GPU node pool
|
||||
options:
|
||||
- name: 'TensorFlow 1.13.1 CPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-py3'
|
||||
- name: 'TensorFlow 1.13.1 GPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-gpu-py3'
|
||||
|
||||
- displayName: Node pool
|
||||
hint: Name of node pool or group to run this workflow task
|
||||
type: select.select
|
||||
visibility: public
|
||||
name: sys-node-pool
|
||||
value: Standard_D4s_v3
|
||||
required: true
|
||||
options:
|
||||
- name: 'CPU: 2, RAM: 8GB'
|
||||
value: Standard_D2s_v3
|
||||
- name: 'CPU: 4, RAM: 16GB'
|
||||
value: Standard_D4s_v3
|
||||
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
|
||||
value: Standard_NC6
|
||||
|
||||
entrypoint: main
|
||||
templates:
|
||||
- dag:
|
||||
tasks:
|
||||
- name: train-model
|
||||
template: tensorflow
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
# - arguments:
|
||||
# artifacts:
|
||||
# - from: '{{tasks.train-model.outputs.artifacts.sys-metrics}}'
|
||||
# name: metrics
|
||||
# parameters:
|
||||
# - name: status
|
||||
# value: '{{tasks.train-model.status}}'
|
||||
# dependencies:
|
||||
# - train-model
|
||||
# name: notify-in-slack
|
||||
# template: slack-notify-success
|
||||
name: main
|
||||
- container:
|
||||
args:
|
||||
- |
|
||||
apt-get update \
|
||||
&& apt-get install -y git wget libglib2.0-0 libsm6 libxext6 libxrender-dev \
|
||||
&& pip install -r requirements.txt \
|
||||
&& pip install boto3 pyyaml google-cloud-storage \
|
||||
&& git clone https://github.com/waleedka/coco \
|
||||
&& cd coco/PythonAPI \
|
||||
&& python setup.py build_ext install \
|
||||
&& rm -rf build \
|
||||
&& cd ../../ \
|
||||
&& wget https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5 \
|
||||
&& python setup.py install && ls \
|
||||
&& python samples/coco/cvat.py train --dataset=/mnt/data/datasets \
|
||||
--model=workflow_maskrcnn \
|
||||
--extras="{{workflow.parameters.extras}}" \
|
||||
--ref_model_path="{{workflow.parameters.sys-finetune-checkpoint}}" \
|
||||
--num_classes="{{workflow.parameters.sys-num-classes}}" \
|
||||
&& cd /mnt/src/ \
|
||||
&& python prepare_dataset.py /mnt/data/datasets/annotations/instances_default.json
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
image: '{{workflow.parameters.tf-image}}'
|
||||
volumeMounts:
|
||||
- mountPath: /mnt/data
|
||||
name: data
|
||||
- mountPath: /mnt/output
|
||||
name: output
|
||||
workingDir: /mnt/src
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/instance-type: '{{workflow.parameters.sys-node-pool}}'
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: data
|
||||
path: /mnt/data/datasets/
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.sys-annotation-path}}'
|
||||
- git:
|
||||
repo: '{{workflow.parameters.source}}'
|
||||
revision: "no-boto"
|
||||
name: src
|
||||
path: /mnt/src
|
||||
name: tensorflow
|
||||
outputs:
|
||||
artifacts:
|
||||
- name: model
|
||||
optional: true
|
||||
path: /mnt/output
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.sys-output-path}}'
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#- container:
|
||||
# args:
|
||||
# - SLACK_USERNAME=Onepanel SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}"
|
||||
# SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd
|
||||
# SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
# image: technosophos/slack-notify
|
||||
# inputs:
|
||||
# artifacts:
|
||||
# - name: metrics
|
||||
# optional: true
|
||||
# path: /tmp/metrics.json
|
||||
# parameters:
|
||||
# - name: status
|
||||
# name: slack-notify-success
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: output
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi`
|
||||
|
||||
const maskRCNNWorkflowTemplateName = "MaskRCNN Training"
|
||||
|
||||
const tensorflowObjectDetectionWorkflowTemplate = `arguments:
|
||||
parameters:
|
||||
- name: source
|
||||
value: https://github.com/tensorflow/models.git
|
||||
displayName: Model source code
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: trainingsource
|
||||
value: https://github.com/onepanelio/cvat-training.git
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: revision
|
||||
value: v1.13.0
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: sys-annotation-path
|
||||
value: annotation-dump/sample_dataset
|
||||
displayName: Dataset path
|
||||
hint: Path to annotated data in default object storage (i.e S3). In CVAT, this parameter will be pre-populated.
|
||||
|
||||
- name: sys-output-path
|
||||
value: workflow-data/output/sample_output
|
||||
hint: Path to store output artifacts in default object storage (i.e s3). In CVAT, this parameter will be pre-populated.
|
||||
displayName: Workflow output path
|
||||
visibility: private
|
||||
|
||||
- name: ref-model
|
||||
value: frcnn-res50-coco
|
||||
displayName: Model
|
||||
hint: TF Detection API's model to use for training.
|
||||
type: select.select
|
||||
visibility: public
|
||||
options:
|
||||
- name: 'Faster RCNN-ResNet 101-COCO'
|
||||
value: frcnn-res101-coco
|
||||
- name: 'Faster RCNN-ResNet 101-Low Proposal-COCO'
|
||||
value: frcnn-res101-low
|
||||
- name: 'Faster RCNN-ResNet 50-COCO'
|
||||
value: frcnn-res50-coco
|
||||
- name: 'Faster RCNN-NAS-COCO'
|
||||
value: frcnn-nas-coco
|
||||
- name: 'SSD MobileNet V1-COCO'
|
||||
value: ssd-mobilenet-v1-coco2
|
||||
- name: 'SSD MobileNet V2-COCO'
|
||||
value: ssd-mobilenet-v2-coco
|
||||
- name: 'SSDLite MobileNet-COCO'
|
||||
value: ssdlite-mobilenet-coco
|
||||
|
||||
- name: extras
|
||||
value: |-
|
||||
epochs=1000
|
||||
displayName: Hyperparameters
|
||||
visibility: public
|
||||
type: textarea.textarea
|
||||
hint: "Please refer to our <a href='https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_annotation_model#arguments-optional' target='_blank'>documentation</a> for more information on parameters. Number of classes will be automatically populated if you had 'sys-num-classes' parameter in a workflow."
|
||||
|
||||
- name: sys-finetune-checkpoint
|
||||
value: ''
|
||||
hint: Select the last fine-tune checkpoint for this model. It may take up to 5 minutes for a recent checkpoint show here. Leave empty if this is the first time you're training this model.
|
||||
displayName: Checkpoint path
|
||||
visibility: public
|
||||
|
||||
- name: sys-num-classes
|
||||
value: 81
|
||||
hint: Number of classes
|
||||
displayName: Number of classes
|
||||
visibility: private
|
||||
|
||||
- name: tf-image
|
||||
value: tensorflow/tensorflow:1.13.1-py3
|
||||
type: select.select
|
||||
displayName: Select TensorFlow image
|
||||
visibility: public
|
||||
hint: Select the GPU image if you are running on a GPU node pool
|
||||
options:
|
||||
- name: 'TensorFlow 1.13.1 CPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-py3'
|
||||
- name: 'TensorFlow 1.13.1 GPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-gpu-py3'
|
||||
|
||||
- displayName: Node pool
|
||||
hint: Name of node pool or group to run this workflow task
|
||||
type: select.select
|
||||
name: sys-node-pool
|
||||
value: Standard_D4s_v3
|
||||
visibility: public
|
||||
required: true
|
||||
options:
|
||||
- name: 'CPU: 2, RAM: 8GB'
|
||||
value: Standard_D2s_v3
|
||||
- name: 'CPU: 4, RAM: 16GB'
|
||||
value: Standard_D4s_v3
|
||||
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
|
||||
value: Standard_NC6
|
||||
- name: dump-format
|
||||
value: cvat_tfrecord
|
||||
visibility: public
|
||||
entrypoint: main
|
||||
templates:
|
||||
- dag:
|
||||
tasks:
|
||||
- name: train-model
|
||||
template: tensorflow
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
# - arguments:
|
||||
# artifacts:
|
||||
# - from: '{{tasks.train-model.outputs.artifacts.sys-metrics}}'
|
||||
# name: metrics
|
||||
# parameters:
|
||||
# - name: status
|
||||
# value: '{{tasks.train-model.status}}'
|
||||
# dependencies:
|
||||
# - train-model
|
||||
# name: notify-in-slack
|
||||
# template: slack-notify-success
|
||||
name: main
|
||||
- container:
|
||||
args:
|
||||
- |
|
||||
apt-get update && \
|
||||
apt-get install -y python3-pip git wget unzip libglib2.0-0 libsm6 libxext6 libxrender-dev && \
|
||||
pip install pillow lxml Cython contextlib2 jupyter matplotlib numpy scipy boto3 pycocotools pyyaml google-cloud-storage && \
|
||||
cd /mnt/src/tf/research && \
|
||||
export PYTHONPATH=$PYTHONPATH:` + "`pwd`:`pwd`/slim" + ` && \
|
||||
cd /mnt/src/train && \
|
||||
python convert_workflow.py \
|
||||
--extras="{{workflow.parameters.extras}}" \
|
||||
--model="{{workflow.parameters.ref-model}}" \
|
||||
--num_classes="{{workflow.parameters.sys-num-classes}}" \
|
||||
--sys_finetune_checkpoint={{workflow.parameters.sys-finetune-checkpoint}}
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
image: '{{workflow.parameters.tf-image}}'
|
||||
volumeMounts:
|
||||
- mountPath: /mnt/data
|
||||
name: data
|
||||
- mountPath: /mnt/output
|
||||
name: output
|
||||
workingDir: /mnt/src
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/instance-type: '{{workflow.parameters.sys-node-pool}}'
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: data
|
||||
path: /mnt/data/datasets/
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.sys-annotation-path}}'
|
||||
- name: models
|
||||
path: /mnt/data/models/
|
||||
optional: true
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.sys-finetune-checkpoint}}'
|
||||
- git:
|
||||
repo: '{{workflow.parameters.source}}'
|
||||
revision: '{{workflow.parameters.revision}}'
|
||||
name: src
|
||||
path: /mnt/src/tf
|
||||
- git:
|
||||
repo: '{{workflow.parameters.trainingsource}}'
|
||||
revision: 'optional-artifacts'
|
||||
name: tsrc
|
||||
path: /mnt/src/train
|
||||
name: tensorflow
|
||||
outputs:
|
||||
artifacts:
|
||||
- name: model
|
||||
optional: true
|
||||
path: /mnt/output
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.sys-output-path}}'
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#- container:
|
||||
# args:
|
||||
# - SLACK_USERNAME=Onepanel SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}"
|
||||
# SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd
|
||||
# SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
# image: technosophos/slack-notify
|
||||
# inputs:
|
||||
# artifacts:
|
||||
# - name: metrics
|
||||
# optional: true
|
||||
# path: /tmp/metrics.json
|
||||
# parameters:
|
||||
# - name: status
|
||||
# name: slack-notify-success
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: output
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi`
|
||||
|
||||
const tensorflowObjectDetectionWorkflowTemplateName = "TF Object Detection Training"
|
||||
|
||||
func initialize20200812104328() {
|
||||
if _, ok := initializedMigrations[20200812104328]; !ok {
|
||||
goose.AddMigration(Up20200812104328, Down20200812104328)
|
||||
initializedMigrations[20200812104328] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200812104328 runs the migration to update MaskRCNN and TF_OD templates
|
||||
func Up20200812104328(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200812104328]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Create maskrcnn
|
||||
workflowTemplate := &v1.WorkflowTemplate{
|
||||
Name: maskRCNNWorkflowTemplateName,
|
||||
Manifest: maskRCNNWorkflowTemplate,
|
||||
Labels: map[string]string{
|
||||
"used-by": "cvat",
|
||||
},
|
||||
}
|
||||
if err := workflowTemplate.GenerateUID(workflowTemplate.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
existingWorkflowTemplate, err := client.GetLatestWorkflowTemplate(namespace.Name, workflowTemplate.UID)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "Workflow template not found") {
|
||||
err = nil
|
||||
existingWorkflowTemplate = nil
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if existingWorkflowTemplate != nil {
|
||||
log.Printf("Skipping creating template '%v'. It already exists in namespace '%v'", workflowTemplate.Name, namespace.Name)
|
||||
continue
|
||||
}
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, workflowTemplate, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.CreateWorkflowTemplate(namespace.Name, workflowTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Create tf-od
|
||||
workflowTemplate = &v1.WorkflowTemplate{
|
||||
Name: tensorflowObjectDetectionWorkflowTemplateName,
|
||||
Manifest: tensorflowObjectDetectionWorkflowTemplate,
|
||||
Labels: map[string]string{
|
||||
"used-by": "cvat",
|
||||
},
|
||||
}
|
||||
if err := workflowTemplate.GenerateUID(workflowTemplate.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, workflowTemplate, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.CreateWorkflowTemplate(namespace.Name, workflowTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200812104328 does nothing
|
||||
func Down20200812104328(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
213
db/go/20200812113316_update_cvat.go
Normal file
213
db/go/20200812113316_update_cvat.go
Normal file
@@ -0,0 +1,213 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate5 = `# Workspace arguments
|
||||
arguments:
|
||||
parameters:
|
||||
- name: sync-directory
|
||||
displayName: Directory to sync raw input and training output
|
||||
value: workflow-data
|
||||
hint: Location to sync raw input, models and checkpoints from default object storage. Note that this will be relative to the current namespace.
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:0.12.0_cvat.1.0.0-beta.2-cuda
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
- name: ONEPANEL_SYNC_DIRECTORY
|
||||
value: '{{workspace.parameters.sync-directory}}'
|
||||
- name: NVIDIA_VISIBLE_DEVICES
|
||||
value: all
|
||||
- name: NVIDIA_DRIVER_CAPABILITIES
|
||||
value: compute,utility
|
||||
- name: NVIDIA_REQUIRE_CUDA
|
||||
value: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:0.12.0_cvat.1.0.0-beta.2
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
# You can add multiple FileSyncer sidecar containers if needed
|
||||
- name: filesyncer
|
||||
image: onepanel/filesyncer:{{.ArtifactRepositoryType}}
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- download
|
||||
env:
|
||||
- name: FS_PATH
|
||||
value: /mnt/share
|
||||
- name: FS_PREFIX
|
||||
value: '{{workflow.namespace}}/{{workspace.parameters.sync-directory}}'
|
||||
volumeMounts:
|
||||
- name: share
|
||||
mountPath: /mnt/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/onepanelio/.*|/tracking/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
timeout: 600s
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
timeout: 600s
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c`
|
||||
|
||||
func initialize20200812113316() {
|
||||
if _, ok := initializedMigrations[20200812113316]; !ok {
|
||||
goose.AddMigration(Up20200812113316, Down20200812113316)
|
||||
initializedMigrations[20200812113316] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200812113316 runs the go migration to update cvat template
|
||||
func Up20200812113316(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200812113316]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
artifactRepositoryType := "s3"
|
||||
nsConfig, err := client.GetNamespaceConfig(namespace.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if nsConfig.ArtifactRepository.GCS != nil {
|
||||
artifactRepositoryType = "gcs"
|
||||
}
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate5,
|
||||
Description: "Powerful and efficient Computer Vision Annotation Tool (CVAT)",
|
||||
}
|
||||
workspaceTemplate.Manifest = strings.NewReplacer(
|
||||
"{{.ArtifactRepositoryType}}", artifactRepositoryType).Replace(workspaceTemplate.Manifest)
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200812113316 does nothing
|
||||
func Down20200812113316(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
58
db/go/20200814160856_add_description_to_jupyter_template.go
Normal file
58
db/go/20200814160856_add_description_to_jupyter_template.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
func initialize20200814160856() {
|
||||
if _, ok := initializedMigrations[20200814160856]; !ok {
|
||||
goose.AddMigration(Up20200814160856, Down20200814160856)
|
||||
initializedMigrations[20200814160856] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200814160856 runs a migration to add description to jupyterlab template
|
||||
func Up20200814160856(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200814160856]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate, err := client.GetWorkspaceTemplate(namespace.Name, "jupyterlab", 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
workspaceTemplate.Description = "Interactive development environment for notebooks"
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200814160856 does nothing
|
||||
func Down20200814160856(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
155
db/go/20200821162630_update_jupyter_workspace_template.go
Normal file
155
db/go/20200821162630_update_jupyter_workspace_template.go
Normal file
@@ -0,0 +1,155 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const jupyterWorkspaceTemplate2 = `# Docker containers that are part of the Workspace
|
||||
containers:
|
||||
- name: jupyterlab-tensorflow
|
||||
image: onepanel/jupyterlab:1.0.1
|
||||
command: ["/bin/bash", "-c", "start.sh jupyter lab --LabApp.token='' --LabApp.allow_remote_access=True --LabApp.allow_origin=\"*\" --LabApp.disable_check_xsrf=True --LabApp.trust_xheaders=True --LabApp.base_url=/ --LabApp.tornado_settings='{\"headers\":{\"Content-Security-Policy\":\"frame-ancestors * \'self\'\"}}' --notebook-dir='/data' --allow-root"]
|
||||
env:
|
||||
- name: tornado
|
||||
value: "'{'headers':{'Content-Security-Policy':\"frame-ancestors\ *\ \'self'\"}}'"
|
||||
args:
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
name: jupyterlab
|
||||
- containerPort: 6006
|
||||
name: tensorboard
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
ports:
|
||||
- name: jupyterlab
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 8888
|
||||
- name: tensorboard
|
||||
port: 6006
|
||||
protocol: TCP
|
||||
targetPort: 6006
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /tensorboard
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 6006
|
||||
- match:
|
||||
- uri:
|
||||
prefix: / #jupyter runs at the default route
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
func initialize20200821162630() {
|
||||
if _, ok := initializedMigrations[20200821162630]; !ok {
|
||||
goose.AddMigration(Up20200821162630, Down20200821162630)
|
||||
initializedMigrations[20200821162630] = true
|
||||
}
|
||||
}
|
||||
|
||||
//Up20200821162630 updates jupyterlab workspace with new features.
|
||||
// Tensorflow 2.3 compiled to support CUDA 10.2 and cudnn8
|
||||
// Pytorch with GPU support.
|
||||
// OpenCV compiled from source with CUDA support.
|
||||
// Miniconda, Jupyterlab 2.2+, and lots of neat extensions.
|
||||
func Up20200821162630(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200821162630]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(jupyterLabTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: jupyterLabTemplateName,
|
||||
Manifest: jupyterWorkspaceTemplate2,
|
||||
}
|
||||
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200821162630 removes the JupyterLab template update
|
||||
func Down20200821162630(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(jupyterLabTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: jupyterLabTemplateName,
|
||||
Manifest: jupyterWorkspaceTemplate,
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
251
db/go/20200824095513_update_mask_rcnn.go
Normal file
251
db/go/20200824095513_update_mask_rcnn.go
Normal file
@@ -0,0 +1,251 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const maskRCNNTemplate2 = `arguments:
|
||||
parameters:
|
||||
- name: source
|
||||
value: https://github.com/onepanelio/Mask_RCNN.git
|
||||
displayName: Model source code
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: cvat-annotation-path
|
||||
value: annotation-dump/sample_dataset
|
||||
hint: Path to annotated data in default object storage (i.e S3). In CVAT, this parameter will be pre-populated.
|
||||
displayName: Dataset path
|
||||
visibility: private
|
||||
|
||||
- name: cvat-output-path
|
||||
value: workflow-data/output/sample_output
|
||||
hint: Path to store output artifacts in default object storage (i.e s3). In CVAT, this parameter will be pre-populated.
|
||||
displayName: Workflow output path
|
||||
visibility: private
|
||||
|
||||
- name: cvat-finetune-checkpoint
|
||||
value: ''
|
||||
hint: Select the last fine-tune checkpoint for this model. It may take up to 5 minutes for a recent checkpoint show here. Leave empty if this is the first time you're training this model.
|
||||
displayName: Checkpoint path
|
||||
visibility: public
|
||||
|
||||
- name: cvat-num-classes
|
||||
displayName: Number of classes
|
||||
hint: Number of classes (i.e in CVAT taks) + 1 for background
|
||||
value: 81
|
||||
visibility: private
|
||||
|
||||
- name: hyperparameters
|
||||
displayName: Hyperparameters
|
||||
visibility: public
|
||||
type: textarea.textarea
|
||||
value: |-
|
||||
stage-1-epochs=1 # Epochs for network heads
|
||||
stage-2-epochs=2 # Epochs for finetune layers
|
||||
stage-3-epochs=3 # Epochs for all layers
|
||||
hint: "Please refer to our <a href='https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_annotation_model#arguments-optional' target='_blank'>documentation</a> for more information on parameters. Number of classes will be automatically populated if you had 'sys-num-classes' parameter in a workflow."
|
||||
|
||||
- name: dump-format
|
||||
value: cvat_coco
|
||||
displayName: CVAT dump format
|
||||
visibility: public
|
||||
|
||||
- name: tf-image
|
||||
visibility: public
|
||||
value: tensorflow/tensorflow:1.13.1-py3
|
||||
type: select.select
|
||||
displayName: Select TensorFlow image
|
||||
hint: Select the GPU image if you are running on a GPU node pool
|
||||
options:
|
||||
- name: 'TensorFlow 1.13.1 CPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-py3'
|
||||
- name: 'TensorFlow 1.13.1 GPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-gpu-py3'
|
||||
|
||||
- displayName: Node pool
|
||||
hint: Name of node pool or group to run this workflow task
|
||||
type: select.select
|
||||
visibility: public
|
||||
name: sys-node-pool
|
||||
value: Standard_D4s_v3
|
||||
required: true
|
||||
options:
|
||||
- name: 'CPU: 2, RAM: 8GB'
|
||||
value: Standard_D2s_v3
|
||||
- name: 'CPU: 4, RAM: 16GB'
|
||||
value: Standard_D4s_v3
|
||||
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
|
||||
value: Standard_NC6
|
||||
|
||||
entrypoint: main
|
||||
templates:
|
||||
- dag:
|
||||
tasks:
|
||||
- name: train-model
|
||||
template: tensorflow
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
# - arguments:
|
||||
# artifacts:
|
||||
# - from: '{{tasks.train-model.outputs.artifacts.sys-metrics}}'
|
||||
# name: metrics
|
||||
# parameters:
|
||||
# - name: status
|
||||
# value: '{{tasks.train-model.status}}'
|
||||
# dependencies:
|
||||
# - train-model
|
||||
# name: notify-in-slack
|
||||
# template: slack-notify-success
|
||||
name: main
|
||||
- container:
|
||||
args:
|
||||
- |
|
||||
apt-get update \
|
||||
&& apt-get install -y git wget libglib2.0-0 libsm6 libxext6 libxrender-dev \
|
||||
&& pip install -r requirements.txt \
|
||||
&& pip install boto3 pyyaml google-cloud-storage \
|
||||
&& git clone https://github.com/waleedka/coco \
|
||||
&& cd coco/PythonAPI \
|
||||
&& python setup.py build_ext install \
|
||||
&& rm -rf build \
|
||||
&& cd ../../ \
|
||||
&& wget https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5 \
|
||||
&& python setup.py install && ls \
|
||||
&& python samples/coco/cvat.py train --dataset=/mnt/data/datasets \
|
||||
--model=workflow_maskrcnn \
|
||||
--extras="{{workflow.parameters.hyperparameters}}" \
|
||||
--ref_model_path="{{workflow.parameters.cvat-finetune-checkpoint}}" \
|
||||
--num_classes="{{workflow.parameters.cvat-num-classes}}" \
|
||||
&& cd /mnt/src/ \
|
||||
&& python prepare_dataset.py /mnt/data/datasets/annotations/instances_default.json
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
image: '{{workflow.parameters.tf-image}}'
|
||||
volumeMounts:
|
||||
- mountPath: /mnt/data
|
||||
name: data
|
||||
- mountPath: /mnt/output
|
||||
name: output
|
||||
workingDir: /mnt/src
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/instance-type: '{{workflow.parameters.sys-node-pool}}'
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: data
|
||||
path: /mnt/data/datasets/
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.cvat-annotation-path}}'
|
||||
- git:
|
||||
repo: '{{workflow.parameters.source}}'
|
||||
revision: "no-boto"
|
||||
name: src
|
||||
path: /mnt/src
|
||||
name: tensorflow
|
||||
outputs:
|
||||
artifacts:
|
||||
- name: model
|
||||
optional: true
|
||||
path: /mnt/output
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.cvat-output-path}}/{{workflow.name}}'
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#- container:
|
||||
# args:
|
||||
# - SLACK_USERNAME=Onepanel SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}"
|
||||
# SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd
|
||||
# SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
# image: technosophos/slack-notify
|
||||
# inputs:
|
||||
# artifacts:
|
||||
# - name: metrics
|
||||
# optional: true
|
||||
# path: /tmp/metrics.json
|
||||
# parameters:
|
||||
# - name: status
|
||||
# name: slack-notify-success
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: output
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi`
|
||||
|
||||
func initialize20200824095513() {
|
||||
if _, ok := initializedMigrations[20200824095513]; !ok {
|
||||
goose.AddMigration(Up20200824095513, Down20200824095513)
|
||||
initializedMigrations[20200824095513] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200824095513 updates the maskrcnn workflow template
|
||||
func Up20200824095513(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200824095513]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Update maskrcnn
|
||||
workflowTemplate := &v1.WorkflowTemplate{
|
||||
Name: maskRCNNWorkflowTemplateName,
|
||||
Manifest: maskRCNNTemplate2,
|
||||
Labels: map[string]string{
|
||||
"used-by": "cvat",
|
||||
},
|
||||
}
|
||||
if err := workflowTemplate.GenerateUID(workflowTemplate.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, workflowTemplate, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.CreateWorkflowTemplateVersion(namespace.Name, workflowTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200824095513 does nothing
|
||||
func Down20200824095513(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
281
db/go/20200824101019_update_tf_object_detection_training.go
Normal file
281
db/go/20200824101019_update_tf_object_detection_training.go
Normal file
@@ -0,0 +1,281 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const tensorflowObjectDetectionTraining2 = `arguments:
|
||||
parameters:
|
||||
- name: source
|
||||
value: https://github.com/tensorflow/models.git
|
||||
displayName: Model source code
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: trainingsource
|
||||
value: https://github.com/onepanelio/cvat-training.git
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: revision
|
||||
value: v1.13.0
|
||||
type: hidden
|
||||
visibility: private
|
||||
|
||||
- name: cvat-annotation-path
|
||||
value: annotation-dump/sample_dataset
|
||||
displayName: Dataset path
|
||||
hint: Path to annotated data in default object storage (i.e S3). In CVAT, this parameter will be pre-populated.
|
||||
visibility: private
|
||||
|
||||
- name: cvat-output-path
|
||||
value: workflow-data/output/sample_output
|
||||
hint: Path to store output artifacts in default object storage (i.e s3). In CVAT, this parameter will be pre-populated.
|
||||
displayName: Workflow output path
|
||||
visibility: private
|
||||
|
||||
- name: cvat-model
|
||||
value: frcnn-res50-coco
|
||||
displayName: Model
|
||||
hint: TF Detection API's model to use for training.
|
||||
type: select.select
|
||||
visibility: public
|
||||
options:
|
||||
- name: 'Faster RCNN-ResNet 101-COCO'
|
||||
value: frcnn-res101-coco
|
||||
- name: 'Faster RCNN-ResNet 101-Low Proposal-COCO'
|
||||
value: frcnn-res101-low
|
||||
- name: 'Faster RCNN-ResNet 50-COCO'
|
||||
value: frcnn-res50-coco
|
||||
- name: 'Faster RCNN-NAS-COCO'
|
||||
value: frcnn-nas-coco
|
||||
- name: 'SSD MobileNet V1-COCO'
|
||||
value: ssd-mobilenet-v1-coco2
|
||||
- name: 'SSD MobileNet V2-COCO'
|
||||
value: ssd-mobilenet-v2-coco
|
||||
- name: 'SSDLite MobileNet-COCO'
|
||||
value: ssdlite-mobilenet-coco
|
||||
|
||||
- name: hyperparameters
|
||||
value: |-
|
||||
num-steps=10000
|
||||
displayName: Hyperparameters
|
||||
visibility: public
|
||||
type: textarea.textarea
|
||||
hint: "Please refer to our <a href='https://docs.onepanel.ai/docs/getting-started/use-cases/computervision/annotation/cvat/cvat_annotation_model#arguments-optional' target='_blank'>documentation</a> for more information on parameters. Number of classes will be automatically populated if you had 'sys-num-classes' parameter in a workflow."
|
||||
|
||||
- name: cvat-finetune-checkpoint
|
||||
value: ''
|
||||
hint: Select the last fine-tune checkpoint for this model. It may take up to 5 minutes for a recent checkpoint show here. Leave empty if this is the first time you're training this model.
|
||||
displayName: Checkpoint path
|
||||
visibility: public
|
||||
|
||||
- name: cvat-num-classes
|
||||
value: 81
|
||||
hint: Number of classes
|
||||
displayName: Number of classes
|
||||
visibility: private
|
||||
|
||||
- name: tf-image
|
||||
value: tensorflow/tensorflow:1.13.1-py3
|
||||
type: select.select
|
||||
displayName: Select TensorFlow image
|
||||
visibility: public
|
||||
hint: Select the GPU image if you are running on a GPU node pool
|
||||
options:
|
||||
- name: 'TensorFlow 1.13.1 CPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-py3'
|
||||
- name: 'TensorFlow 1.13.1 GPU Image'
|
||||
value: 'tensorflow/tensorflow:1.13.1-gpu-py3'
|
||||
|
||||
- displayName: Node pool
|
||||
hint: Name of node pool or group to run this workflow task
|
||||
type: select.select
|
||||
name: sys-node-pool
|
||||
value: Standard_D4s_v3
|
||||
visibility: public
|
||||
required: true
|
||||
options:
|
||||
- name: 'CPU: 2, RAM: 8GB'
|
||||
value: Standard_D2s_v3
|
||||
- name: 'CPU: 4, RAM: 16GB'
|
||||
value: Standard_D4s_v3
|
||||
- name: 'GPU: 1xK80, CPU: 6, RAM: 56GB'
|
||||
value: Standard_NC6
|
||||
- name: dump-format
|
||||
value: cvat_tfrecord
|
||||
visibility: public
|
||||
entrypoint: main
|
||||
templates:
|
||||
- dag:
|
||||
tasks:
|
||||
- name: train-model
|
||||
template: tensorflow
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
# - arguments:
|
||||
# artifacts:
|
||||
# - from: '{{tasks.train-model.outputs.artifacts.sys-metrics}}'
|
||||
# name: metrics
|
||||
# parameters:
|
||||
# - name: status
|
||||
# value: '{{tasks.train-model.status}}'
|
||||
# dependencies:
|
||||
# - train-model
|
||||
# name: notify-in-slack
|
||||
# template: slack-notify-success
|
||||
name: main
|
||||
- container:
|
||||
args:
|
||||
- |
|
||||
apt-get update && \
|
||||
apt-get install -y python3-pip git wget unzip libglib2.0-0 libsm6 libxext6 libxrender-dev && \
|
||||
pip install pillow lxml Cython contextlib2 jupyter matplotlib numpy scipy boto3 pycocotools pyyaml google-cloud-storage && \
|
||||
cd /mnt/src/tf/research && \
|
||||
export PYTHONPATH=$PYTHONPATH:` + "`pwd`:`pwd`" + `/slim && \
|
||||
cd /mnt/src/train && \
|
||||
python convert_workflow.py \
|
||||
--extras="{{workflow.parameters.hyperparameters}}" \
|
||||
--model="{{workflow.parameters.cvat-model}}" \
|
||||
--num_classes="{{workflow.parameters.cvat-num-classes}}" \
|
||||
--sys_finetune_checkpoint={{workflow.parameters.cvat-finetune-checkpoint}}
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
image: '{{workflow.parameters.tf-image}}'
|
||||
volumeMounts:
|
||||
- mountPath: /mnt/data
|
||||
name: data
|
||||
- mountPath: /mnt/output
|
||||
name: output
|
||||
workingDir: /mnt/src
|
||||
nodeSelector:
|
||||
beta.kubernetes.io/instance-type: '{{workflow.parameters.sys-node-pool}}'
|
||||
inputs:
|
||||
artifacts:
|
||||
- name: data
|
||||
path: /mnt/data/datasets/
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.cvat-annotation-path}}'
|
||||
- name: models
|
||||
path: /mnt/data/models/
|
||||
optional: true
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.cvat-finetune-checkpoint}}'
|
||||
- git:
|
||||
repo: '{{workflow.parameters.source}}'
|
||||
revision: '{{workflow.parameters.revision}}'
|
||||
name: src
|
||||
path: /mnt/src/tf
|
||||
- git:
|
||||
repo: '{{workflow.parameters.trainingsource}}'
|
||||
revision: 'optional-artifacts'
|
||||
name: tsrc
|
||||
path: /mnt/src/train
|
||||
name: tensorflow
|
||||
outputs:
|
||||
artifacts:
|
||||
- name: model
|
||||
optional: true
|
||||
path: /mnt/output
|
||||
{{.ArtifactRepositoryType}}:
|
||||
key: '{{workflow.namespace}}/{{workflow.parameters.cvat-output-path}}/{{workflow.name}}'
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#- container:
|
||||
# args:
|
||||
# - SLACK_USERNAME=Onepanel SLACK_TITLE="{{workflow.name}} {{inputs.parameters.status}}"
|
||||
# SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd
|
||||
# SLACK_MESSAGE=$(cat /tmp/metrics.json)} ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
# image: technosophos/slack-notify
|
||||
# inputs:
|
||||
# artifacts:
|
||||
# - name: metrics
|
||||
# optional: true
|
||||
# path: /tmp/metrics.json
|
||||
# parameters:
|
||||
# - name: status
|
||||
# name: slack-notify-success
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi
|
||||
- metadata:
|
||||
creationTimestamp: null
|
||||
name: output
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 200Gi`
|
||||
|
||||
func initialize20200824101019() {
|
||||
if _, ok := initializedMigrations[20200824101019]; !ok {
|
||||
goose.AddMigration(Up20200824101019, Down20200824101019)
|
||||
initializedMigrations[20200824101019] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200824101019 updates the tf object detection training workflow template
|
||||
func Up20200824101019(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200824101019]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Update tfObjectDetectionTraining
|
||||
workflowTemplate := &v1.WorkflowTemplate{
|
||||
Name: tensorflowObjectDetectionWorkflowTemplateName,
|
||||
Manifest: tensorflowObjectDetectionTraining2,
|
||||
Labels: map[string]string{
|
||||
"used-by": "cvat",
|
||||
},
|
||||
}
|
||||
if err := workflowTemplate.GenerateUID(workflowTemplate.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, workflowTemplate, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.CreateWorkflowTemplateVersion(namespace.Name, workflowTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200824101019 does nothing
|
||||
func Down20200824101019(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
206
db/go/20200824101905_update_cvat_template.go
Normal file
206
db/go/20200824101905_update_cvat_template.go
Normal file
@@ -0,0 +1,206 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate6 = `# Workspace arguments
|
||||
arguments:
|
||||
parameters:
|
||||
- name: sync-directory
|
||||
displayName: Directory to sync raw input and training output
|
||||
value: workflow-data
|
||||
hint: Location to sync raw input, models and checkpoints from default object storage. Note that this will be relative to the current namespace.
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:0.12.0-rc.6_cvat.1.0.0
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
- name: ONEPANEL_SYNC_DIRECTORY
|
||||
value: '{{workspace.parameters.sync-directory}}'
|
||||
- name: NVIDIA_VISIBLE_DEVICES
|
||||
value: all
|
||||
- name: NVIDIA_DRIVER_CAPABILITIES
|
||||
value: compute,utility
|
||||
- name: NVIDIA_REQUIRE_CUDA
|
||||
value: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:0.12.0-rc.1_cvat.1.0.0
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
# You can add multiple FileSyncer sidecar containers if needed
|
||||
- name: filesyncer
|
||||
image: onepanel/filesyncer:{{.ArtifactRepositoryType}}
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- download
|
||||
env:
|
||||
- name: FS_PATH
|
||||
value: /mnt/share
|
||||
- name: FS_PREFIX
|
||||
value: '{{workflow.namespace}}/{{workspace.parameters.sync-directory}}'
|
||||
volumeMounts:
|
||||
- name: share
|
||||
mountPath: /mnt/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/onepanelio/.*|/tracking/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
timeout: 600s
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
timeout: 600s
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c`
|
||||
|
||||
func initialize20200824101905() {
|
||||
if _, ok := initializedMigrations[20200824101905]; !ok {
|
||||
goose.AddMigration(Up20200824101905, Down20200824101905)
|
||||
initializedMigrations[20200824101905] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200824101905 updates the cvat workspace template
|
||||
func Up20200824101905(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200824101905]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate6,
|
||||
Description: "Powerful and efficient Computer Vision Annotation Tool (CVAT)",
|
||||
}
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, nil, workspaceTemplate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200824101905 does nothing
|
||||
func Down20200824101905(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
206
db/go/20200825154403_update_cvat_version.go
Normal file
206
db/go/20200825154403_update_cvat_version.go
Normal file
@@ -0,0 +1,206 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate7 = `# Workspace arguments
|
||||
arguments:
|
||||
parameters:
|
||||
- name: sync-directory
|
||||
displayName: Directory to sync raw input and training output
|
||||
value: workflow-data
|
||||
hint: Location to sync raw input, models and checkpoints from default object storage. Note that this will be relative to the current namespace.
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:0.12.0_cvat.1.0.0
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
- name: ONEPANEL_SYNC_DIRECTORY
|
||||
value: '{{workspace.parameters.sync-directory}}'
|
||||
- name: NVIDIA_VISIBLE_DEVICES
|
||||
value: all
|
||||
- name: NVIDIA_DRIVER_CAPABILITIES
|
||||
value: compute,utility
|
||||
- name: NVIDIA_REQUIRE_CUDA
|
||||
value: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:0.12.0_cvat.1.0.0
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
# You can add multiple FileSyncer sidecar containers if needed
|
||||
- name: filesyncer
|
||||
image: onepanel/filesyncer:{{.ArtifactRepositoryType}}
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- download
|
||||
env:
|
||||
- name: FS_PATH
|
||||
value: /mnt/share
|
||||
- name: FS_PREFIX
|
||||
value: '{{workflow.namespace}}/{{workspace.parameters.sync-directory}}'
|
||||
volumeMounts:
|
||||
- name: share
|
||||
mountPath: /mnt/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/onepanelio/.*|/tracking/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
timeout: 600s
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
timeout: 600s
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c`
|
||||
|
||||
func initialize20200825154403() {
|
||||
if _, ok := initializedMigrations[20200825154403]; !ok {
|
||||
goose.AddMigration(Up20200825154403, Down20200825154403)
|
||||
initializedMigrations[20200825154403] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200825154403 runs the migration to upgrade the cvat workspace template
|
||||
func Up20200825154403(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200825154403]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate7,
|
||||
Description: "Powerful and efficient Computer Vision Annotation Tool (CVAT)",
|
||||
}
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, nil, workspaceTemplate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200825154403 does nothing
|
||||
func Down20200825154403(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
218
db/go/20200826185926_upgrade_cvat.go
Normal file
218
db/go/20200826185926_upgrade_cvat.go
Normal file
@@ -0,0 +1,218 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate8 = `# Workspace arguments
|
||||
arguments:
|
||||
parameters:
|
||||
- name: sync-directory
|
||||
displayName: Directory to sync raw input and training output
|
||||
value: workflow-data
|
||||
hint: Location to sync raw input, models and checkpoints from default object storage. Note that this will be relative to the current namespace.
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:0.12.0_cvat.1.0.0
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
- name: ONEPANEL_SYNC_DIRECTORY
|
||||
value: '{{workspace.parameters.sync-directory}}'
|
||||
- name: NVIDIA_VISIBLE_DEVICES
|
||||
value: all
|
||||
- name: NVIDIA_DRIVER_CAPABILITIES
|
||||
value: compute,utility
|
||||
- name: NVIDIA_REQUIRE_CUDA
|
||||
value: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:0.12.0_cvat.1.0.0
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
# You can add multiple FileSyncer sidecar containers if needed
|
||||
- name: filesyncer
|
||||
image: onepanel/filesyncer:{{.ArtifactRepositoryType}}
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- download
|
||||
- -server-prefix=/sys/filesyncer
|
||||
env:
|
||||
- name: FS_PATH
|
||||
value: /mnt/share
|
||||
- name: FS_PREFIX
|
||||
value: '{{workflow.namespace}}/{{workspace.parameters.sync-directory}}'
|
||||
volumeMounts:
|
||||
- name: share
|
||||
mountPath: /mnt/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
- name: fs
|
||||
port: 8888
|
||||
protocol: TCP
|
||||
targetPort: 8888
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /sys/filesyncer
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8888
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/onepanelio/.*|/tracking/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
timeout: 600s
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
timeout: 600s
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c`
|
||||
|
||||
func initialize20200826185926() {
|
||||
if _, ok := initializedMigrations[20200826185926]; !ok {
|
||||
goose.AddMigration(Up20200826185926, Down20200826185926)
|
||||
initializedMigrations[20200826185926] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200826185926 runs the migration to upgrade the cvat workspace template
|
||||
func Up20200826185926(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200826185926]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate8,
|
||||
Description: "Powerful and efficient Computer Vision Annotation Tool (CVAT)",
|
||||
}
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, nil, workspaceTemplate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200826185926 does nothing
|
||||
func Down20200826185926(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
68
db/go/20200922103448_add_jupyter_lab_description.go
Normal file
68
db/go/20200922103448_add_jupyter_lab_description.go
Normal file
@@ -0,0 +1,68 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
func initialize20200922103448() {
|
||||
if _, ok := initializedMigrations[20200922103448]; !ok {
|
||||
goose.AddMigration(Up20200922103448, Down20200922103448)
|
||||
initializedMigrations[20200922103448] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200922103448 adds a description to the jupyterlab workspace template
|
||||
func Up20200922103448(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200922103448]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(jupyterLabTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate, err := client.GetWorkspaceTemplate(namespace.Name, uid, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if workspaceTemplate == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// Adding description
|
||||
workspaceTemplate.Description = "Interactive development environment for notebooks"
|
||||
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200922103448 does nothing
|
||||
func Down20200922103448(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
123
db/go/20200929144301_add_vscode_workspace_template.go
Normal file
123
db/go/20200929144301_add_vscode_workspace_template.go
Normal file
@@ -0,0 +1,123 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const vscodeWorkspaceTemplate = `
|
||||
# Docker containers that are part of the Workspace
|
||||
containers:
|
||||
- name: vscode
|
||||
image: onepanel/vscode:1.0.0
|
||||
command: ["/bin/bash", "-c", "pip install onepanel-sdk && /usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 --auth none ."]
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: vscode
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
ports:
|
||||
- name: vscode
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: / #vscode runs at the default route
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
const vscodeWorkspaceTemplateName = "Visual Studio Code"
|
||||
|
||||
func initialize20200929144301() {
|
||||
if _, ok := initializedMigrations[20200929144301]; !ok {
|
||||
goose.AddMigration(Up20200929144301, Down20200929144301)
|
||||
initializedMigrations[20200929144301] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200929144301 adds Visual Studio Code as a workspace template.
|
||||
func Up20200929144301(tx *sql.Tx) error {
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200929144301]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
Name: vscodeWorkspaceTemplateName,
|
||||
Manifest: vscodeWorkspaceTemplate,
|
||||
}
|
||||
|
||||
// Adding description
|
||||
workspaceTemplate.Description = "Open source code editor"
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.CreateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200929144301 removes Visual Studio Code from workspace templates.
|
||||
func Down20200929144301(tx *sql.Tx) error {
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
uid, err := uid2.GenerateUID(vscodeWorkspaceTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.ArchiveWorkspaceTemplate(namespace.Name, uid); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
148
db/go/20200929153931_update_jupyter_lab_workspace_command.go
Normal file
148
db/go/20200929153931_update_jupyter_lab_workspace_command.go
Normal file
@@ -0,0 +1,148 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const jupyterWorkspaceTemplate3 = `
|
||||
# Docker containers that are part of the Workspace
|
||||
containers:
|
||||
- name: jupyterlab-tensorflow
|
||||
image: onepanel/jupyterlab:1.0.1
|
||||
command: ["/bin/bash", "-c", "pip install onepanel-sdk && start.sh jupyter lab --LabApp.token='' --LabApp.allow_remote_access=True --LabApp.allow_origin=\"*\" --LabApp.disable_check_xsrf=True --LabApp.trust_xheaders=True --LabApp.base_url=/ --LabApp.tornado_settings='{\"headers\":{\"Content-Security-Policy\":\"frame-ancestors * \'self\'\"}}' --notebook-dir='/data' --allow-root"]
|
||||
env:
|
||||
- name: tornado
|
||||
value: "'{'headers':{'Content-Security-Policy':\"frame-ancestors\ *\ \'self'\"}}'"
|
||||
args:
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
name: jupyterlab
|
||||
- containerPort: 6006
|
||||
name: tensorboard
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
ports:
|
||||
- name: jupyterlab
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 8888
|
||||
- name: tensorboard
|
||||
port: 6006
|
||||
protocol: TCP
|
||||
targetPort: 6006
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /tensorboard
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 6006
|
||||
- match:
|
||||
- uri:
|
||||
prefix: / #jupyter runs at the default route
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c
|
||||
`
|
||||
|
||||
func initialize20200929153931() {
|
||||
if _, ok := initializedMigrations[20200929153931]; !ok {
|
||||
goose.AddMigration(Up20200929153931, Down20200929153931)
|
||||
initializedMigrations[20200929153931] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20200929153931 updates jupyterlab workspace to include the onepanel-sdk
|
||||
func Up20200929153931(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200929153931]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(jupyterLabTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.UpdateWorkspaceTemplateManifest(namespace.Name, uid, jupyterWorkspaceTemplate3); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20200929153931 removes the onepanel-sdk addition.
|
||||
func Down20200929153931(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20200929153931]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(jupyterLabTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
if _, err := client.UpdateWorkspaceTemplateManifest(namespace.Name, uid, jupyterWorkspaceTemplate2); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
216
db/go/20201001070806_update_cvat.go
Normal file
216
db/go/20201001070806_update_cvat.go
Normal file
@@ -0,0 +1,216 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
uid2 "github.com/onepanelio/core/pkg/util/uid"
|
||||
"github.com/pressly/goose"
|
||||
)
|
||||
|
||||
const cvatWorkspaceTemplate9 = `# Workspace arguments
|
||||
arguments:
|
||||
parameters:
|
||||
- name: sync-directory
|
||||
displayName: Directory to sync raw input and training output
|
||||
value: workflow-data
|
||||
hint: Location to sync raw input, models and checkpoints from default object storage. Note that this will be relative to the current namespace.
|
||||
containers:
|
||||
- name: cvat-db
|
||||
image: postgres:10-alpine
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: root
|
||||
- name: POSTGRES_DB
|
||||
value: cvat
|
||||
- name: POSTGRES_HOST_AUTH_METHOD
|
||||
value: trust
|
||||
- name: PGDATA
|
||||
value: /var/lib/psql/data
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: tcp
|
||||
volumeMounts:
|
||||
- name: db
|
||||
mountPath: /var/lib/psql
|
||||
- name: cvat-redis
|
||||
image: redis:4.0-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
name: tcp
|
||||
- name: cvat
|
||||
image: onepanel/cvat:0.12.1_cvat.1.0.0
|
||||
env:
|
||||
- name: DJANGO_MODWSGI_EXTRA_ARGS
|
||||
value: ""
|
||||
- name: ALLOWED_HOSTS
|
||||
value: '*'
|
||||
- name: CVAT_REDIS_HOST
|
||||
value: localhost
|
||||
- name: CVAT_POSTGRES_HOST
|
||||
value: localhost
|
||||
- name: CVAT_SHARE_URL
|
||||
value: /home/django/data
|
||||
- name: ONEPANEL_SYNC_DIRECTORY
|
||||
value: '{{workspace.parameters.sync-directory}}'
|
||||
- name: NVIDIA_VISIBLE_DEVICES
|
||||
value: all
|
||||
- name: NVIDIA_DRIVER_CAPABILITIES
|
||||
value: compute,utility
|
||||
- name: NVIDIA_REQUIRE_CUDA
|
||||
value: "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/django/data
|
||||
- name: keys
|
||||
mountPath: /home/django/keys
|
||||
- name: logs
|
||||
mountPath: /home/django/logs
|
||||
- name: models
|
||||
mountPath: /home/django/models
|
||||
- name: share
|
||||
mountPath: /home/django/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
- name: cvat-ui
|
||||
image: onepanel/cvat-ui:0.12.1_cvat.1.0.0
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
# You can add multiple FileSyncer sidecar containers if needed
|
||||
- name: filesyncer
|
||||
image: onepanel/filesyncer:{{.ArtifactRepositoryType}}
|
||||
imagePullPolicy: Always
|
||||
args:
|
||||
- download
|
||||
- -server-prefix=/sys/filesyncer
|
||||
env:
|
||||
- name: FS_PATH
|
||||
value: /mnt/share
|
||||
- name: FS_PREFIX
|
||||
value: '{{workflow.namespace}}/{{workspace.parameters.sync-directory}}'
|
||||
volumeMounts:
|
||||
- name: share
|
||||
mountPath: /mnt/share
|
||||
- name: sys-namespace-config
|
||||
mountPath: /etc/onepanel
|
||||
readOnly: true
|
||||
ports:
|
||||
- name: cvat-ui
|
||||
port: 80
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
- name: cvat
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: 8080
|
||||
- name: fs
|
||||
port: 8888
|
||||
protocol: TCP
|
||||
targetPort: 8888
|
||||
routes:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /sys/filesyncer
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8888
|
||||
- match:
|
||||
- uri:
|
||||
regex: /api/.*|/git/.*|/tensorflow/.*|/onepanelio/.*|/tracking/.*|/auto_annotation/.*|/analytics/.*|/static/.*|/admin/.*|/documentation/.*|/dextr/.*|/reid/.*
|
||||
- queryParams:
|
||||
id:
|
||||
regex: \d+.*
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 8080
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /
|
||||
route:
|
||||
- destination:
|
||||
port:
|
||||
number: 80
|
||||
# DAG Workflow to be executed once a Workspace action completes (optional)
|
||||
# Uncomment the lines below if you want to send Slack notifications
|
||||
#postExecutionWorkflow:
|
||||
# entrypoint: main
|
||||
# templates:
|
||||
# - name: main
|
||||
# dag:
|
||||
# tasks:
|
||||
# - name: slack-notify
|
||||
# template: slack-notify
|
||||
# - name: slack-notify
|
||||
# container:
|
||||
# image: technosophos/slack-notify
|
||||
# args:
|
||||
# - SLACK_USERNAME=onepanel SLACK_TITLE="Your workspace is ready" SLACK_ICON=https://www.gravatar.com/avatar/5c4478592fe00878f62f0027be59c1bd SLACK_MESSAGE="Your workspace is now running" ./slack-notify
|
||||
# command:
|
||||
# - sh
|
||||
# - -c`
|
||||
|
||||
func initialize20201001070806() {
|
||||
if _, ok := initializedMigrations[20201001070806]; !ok {
|
||||
goose.AddMigration(Up20201001070806, Down20201001070806)
|
||||
initializedMigrations[20201001070806] = true
|
||||
}
|
||||
}
|
||||
|
||||
// Up20201001070806 updates the cvat workspace
|
||||
func Up20201001070806(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is applied.
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer client.DB.Close()
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := migrationsRan[20201001070806]; ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
namespaces, err := client.ListOnepanelEnabledNamespaces()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
uid, err := uid2.GenerateUID(cvatTemplateName, 30)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, namespace := range namespaces {
|
||||
workspaceTemplate := &v1.WorkspaceTemplate{
|
||||
UID: uid,
|
||||
Name: cvatTemplateName,
|
||||
Manifest: cvatWorkspaceTemplate9,
|
||||
Description: "Powerful and efficient Computer Vision Annotation Tool (CVAT)",
|
||||
}
|
||||
err = ReplaceArtifactRepositoryType(client, namespace, nil, workspaceTemplate)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := client.UpdateWorkspaceTemplate(namespace.Name, workspaceTemplate); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Down20201001070806 does nothing
|
||||
func Down20201001070806(tx *sql.Tx) error {
|
||||
// This code is executed when the migration is rolled back.
|
||||
return nil
|
||||
}
|
||||
130
db/go/db.go
Normal file
130
db/go/db.go
Normal file
@@ -0,0 +1,130 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
"github.com/jmoiron/sqlx"
|
||||
v1 "github.com/onepanelio/core/pkg"
|
||||
"log"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// initializedMigrations is used to keep track of which migrations have been initialized.
|
||||
// if they are initialized more than once, goose panics.
|
||||
var initializedMigrations = make(map[int]bool)
|
||||
|
||||
// sqlRanMigrations keeps track of all the sql migrations that have been run.
|
||||
// we need to know this because in an older version some go migrations ran alongside sql.
|
||||
// So if they have already been run, we can't run them again.
|
||||
var sqlRanMigrations = make(map[uint64]bool)
|
||||
|
||||
// migrationHasAlreadyBeenRun returns true if the migration has already been run in sql
|
||||
// see sqlRanMigrations var
|
||||
func migrationHasAlreadyBeenRun(version int) bool {
|
||||
_, ok := sqlRanMigrations[uint64(version)]
|
||||
return ok
|
||||
}
|
||||
|
||||
// Initialize sets up the go migrations.
|
||||
func Initialize() {
|
||||
client, err := getClient()
|
||||
if err != nil {
|
||||
log.Fatalf("unable to get client for go migrations: %v", err)
|
||||
}
|
||||
|
||||
migrationsRan, err := getRanSQLMigrations(client)
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to get already run sql migrations: %v", err)
|
||||
}
|
||||
sqlRanMigrations = migrationsRan
|
||||
|
||||
initialize20200525160514()
|
||||
initialize20200528140124()
|
||||
initialize20200605090509()
|
||||
initialize20200605090535()
|
||||
initialize20200626113635()
|
||||
initialize20200704151301()
|
||||
initialize20200724220450()
|
||||
initialize20200727144157()
|
||||
initialize20200728190804()
|
||||
initialize20200812104328()
|
||||
initialize20200812113316()
|
||||
initialize20200814160856()
|
||||
initialize20200821162630()
|
||||
initialize20200824095513()
|
||||
initialize20200824101019()
|
||||
initialize20200824101905()
|
||||
initialize20200825154403()
|
||||
initialize20200826185926()
|
||||
initialize20200922103448()
|
||||
initialize20200929144301()
|
||||
initialize20200929153931()
|
||||
initialize20201001070806()
|
||||
|
||||
if err := client.DB.Close(); err != nil {
|
||||
log.Printf("[error] closing db %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func getClient() (*v1.Client, error) {
|
||||
kubeConfig := v1.NewConfig()
|
||||
client, err := v1.NewClient(kubeConfig, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config, err := client.GetSystemConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dbDriverName, dbDataSourceName := config.DatabaseConnection()
|
||||
client.DB = v1.NewDB(sqlx.MustConnect(dbDriverName, dbDataSourceName))
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
||||
// getRanSQLMigrations returns a map where each key is a sql migration version ran.
|
||||
func getRanSQLMigrations(client *v1.Client) (map[uint64]bool, error) {
|
||||
sb := sq.StatementBuilder.PlaceholderFormat(sq.Dollar)
|
||||
|
||||
query := sb.Select("version_id").
|
||||
From("goose_db_version")
|
||||
|
||||
versions := make([]uint64, 0)
|
||||
if err := client.Selectx(&versions, query); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := make(map[uint64]bool)
|
||||
for _, version := range versions {
|
||||
result[version] = true
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ReplaceArtifactRepositoryType will look for {{.ArtifactRepositoryType}} in the migration and replace it based on config.
|
||||
func ReplaceArtifactRepositoryType(client *v1.Client, namespace *v1.Namespace, workflowTemplate *v1.WorkflowTemplate, workspaceTemplate *v1.WorkspaceTemplate) error {
|
||||
artifactRepositoryType := "s3"
|
||||
nsConfig, err := client.GetNamespaceConfig(namespace.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if nsConfig.ArtifactRepository.GCS != nil {
|
||||
artifactRepositoryType = "gcs"
|
||||
}
|
||||
|
||||
if workflowTemplate != nil {
|
||||
workflowTemplate.Manifest = strings.NewReplacer(
|
||||
"{{.ArtifactRepositoryType}}", artifactRepositoryType).Replace(workflowTemplate.Manifest)
|
||||
}
|
||||
if workspaceTemplate != nil {
|
||||
workspaceTemplate.Manifest = strings.NewReplacer(
|
||||
"{{.ArtifactRepositoryType}}", artifactRepositoryType).Replace(workspaceTemplate.Manifest)
|
||||
}
|
||||
if workflowTemplate == nil && workspaceTemplate == nil {
|
||||
return errors.New("workflow and workspace template cannot be nil")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -2,15 +2,15 @@
|
||||
CREATE TABLE workflow_templates
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
uid varchar(36) UNIQUE NOT NULL CHECK(uid <> ''),
|
||||
uid varchar(30) UNIQUE NOT NULL CHECK(uid <> ''),
|
||||
name text NOT NULL CHECK(name <> ''),
|
||||
namespace varchar(36) NOT NULL,
|
||||
namespace varchar(30) NOT NULL,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'),
|
||||
modified_at timestamp,
|
||||
|
||||
UNIQUE (name, namespace)
|
||||
UNIQUE (uid, namespace)
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
@@ -0,0 +1,17 @@
|
||||
-- +goose Up
|
||||
DROP TABLE workflow_template_versions;
|
||||
|
||||
-- +goose Down
|
||||
CREATE TABLE workflow_template_versions
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
workflow_template_id integer NOT NULL REFERENCES workflow_templates ON DELETE CASCADE,
|
||||
version integer NOT NULL,
|
||||
is_latest boolean NOT NULL,
|
||||
manifest text NOT NULL,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'),
|
||||
modified_at timestamp
|
||||
);
|
||||
|
||||
21
db/sql/20200413141037_create_workflow_execution.sql
Normal file
21
db/sql/20200413141037_create_workflow_execution.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
CREATE TABLE workflow_executions
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
uid varchar(30) UNIQUE NOT NULL CHECK(uid <> ''),
|
||||
workflow_template_id integer NOT NULL REFERENCES workflow_templates ON DELETE CASCADE,
|
||||
name text NOT NULL CHECK (name <> ''),
|
||||
namespace varchar(30) NOT NULL,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'),
|
||||
finished_at timestamp DEFAULT NULL,
|
||||
failed_at timestamp DEFAULT NULL
|
||||
);
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
DROP TABLE workflow_executions;
|
||||
-- +goose StatementEnd
|
||||
@@ -0,0 +1,7 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workflow_templates ADD COLUMN versions INTEGER;
|
||||
UPDATE workflow_templates SET versions = 1;
|
||||
ALTER TABLE workflow_templates ALTER COLUMN versions SET NOT NULL;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE workflow_templates DROP COLUMN versions;
|
||||
@@ -0,0 +1,23 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE workflow_template_versions
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
uid varchar(30),
|
||||
workflow_template_id integer NOT NULL REFERENCES workflow_templates ON DELETE CASCADE,
|
||||
version integer NOT NULL,
|
||||
is_latest boolean NOT NULL,
|
||||
manifest text NOT NULL,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc')
|
||||
);
|
||||
|
||||
ALTER TABLE workflow_templates DROP COLUMN versions;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE workflow_templates ADD COLUMN versions INTEGER;
|
||||
UPDATE workflow_templates SET versions = 1;
|
||||
ALTER TABLE workflow_templates ALTER COLUMN versions SET NOT NULL;
|
||||
|
||||
DROP TABLE workflow_template_versions;
|
||||
|
||||
23
db/sql/20200422140125_add_cron_workflows.sql
Normal file
23
db/sql/20200422140125_add_cron_workflows.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE cron_workflows
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
uid varchar(30) UNIQUE NOT NULL CHECK(uid <> ''),
|
||||
name varchar(30),
|
||||
workflow_template_version_id INT REFERENCES workflow_template_versions,
|
||||
schedule varchar(255),
|
||||
timezone varchar(255),
|
||||
suspend boolean,
|
||||
concurrency_policy varchar(255),
|
||||
starting_deadline_seconds INT,
|
||||
successful_jobs_history_limit INT,
|
||||
failed_jobs_history_limit INT,
|
||||
workflow_spec TEXT,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'),
|
||||
modified_at timestamp
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE cron_workflows;
|
||||
15
db/sql/20200422160902_add_labels.sql
Normal file
15
db/sql/20200422160902_add_labels.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE labels
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
key varchar(255),
|
||||
value varchar(255),
|
||||
resource varchar(255),
|
||||
resource_id INTEGER,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc')
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE labels;
|
||||
@@ -0,0 +1,24 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workflow_executions
|
||||
ADD COLUMN started_at TIMESTAMP,
|
||||
ADD COLUMN workflow_template_version_id INT REFERENCES workflow_template_versions,
|
||||
ADD COLUMN phase VARCHAR(50),
|
||||
ADD COLUMN cron_workflow_id INT REFERENCES cron_workflows,
|
||||
DROP COLUMN failed_at,
|
||||
DROP COLUMN workflow_template_id
|
||||
;
|
||||
|
||||
UPDATE workflow_executions
|
||||
SET started_at = created_at,
|
||||
phase = 'Succeeded'
|
||||
;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE workflow_executions
|
||||
DROP COLUMN started_at,
|
||||
DROP COLUMN workflow_template_version_id,
|
||||
DROP COLUMN phase,
|
||||
DROP COLUMN cron_workflow_id,
|
||||
ADD COLUMN failed_at TIMESTAMP,
|
||||
ADD COLUMN workflow_template_id INT
|
||||
;
|
||||
21
db/sql/20200425172611_workspace_templates.sql
Normal file
21
db/sql/20200425172611_workspace_templates.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE workspace_templates
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
uid varchar(30) NOT NULL CHECK(uid <> ''),
|
||||
name varchar(30) NOT NULL CHECK(name <> ''),
|
||||
namespace varchar(30) NOT NULL,
|
||||
is_archived boolean DEFAULT false,
|
||||
|
||||
workflow_template_id integer NOT NULL REFERENCES workflow_templates ON DELETE CASCADE,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'),
|
||||
modified_at timestamp
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX workspace_templates_name_namespace_key ON workspace_templates (name, namespace) WHERE is_archived = false;
|
||||
CREATE UNIQUE INDEX workspace_templates_uid_namespace_key ON workspace_templates (uid, namespace) WHERE is_archived = false;
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE workspace_templates;
|
||||
16
db/sql/20200425173049_workspace_template_versions.sql
Normal file
16
db/sql/20200425173049_workspace_template_versions.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE workspace_template_versions
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
workspace_template_id integer NOT NULL REFERENCES workspace_templates ON DELETE CASCADE,
|
||||
version integer NOT NULL,
|
||||
manifest text NOT NULL,
|
||||
is_latest boolean DEFAULT false,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'),
|
||||
modified_at timestamp
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE workspace_template_versions;
|
||||
29
db/sql/20200429141030_add_manifest_to_crons.sql
Normal file
29
db/sql/20200429141030_add_manifest_to_crons.sql
Normal file
@@ -0,0 +1,29 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE cron_workflows ADD COLUMN manifest TEXT;
|
||||
UPDATE cron_workflows SET manifest = '';
|
||||
ALTER TABLE cron_workflows ALTER manifest SET NOT NULL;
|
||||
|
||||
ALTER TABLE cron_workflows
|
||||
DROP COLUMN schedule,
|
||||
DROP COLUMN timezone,
|
||||
DROP COLUMN suspend,
|
||||
DROP COLUMN concurrency_policy,
|
||||
DROP COLUMN starting_deadline_seconds,
|
||||
DROP COLUMN successful_jobs_history_limit,
|
||||
DROP COLUMN failed_jobs_history_limit,
|
||||
DROP COLUMN workflow_spec
|
||||
;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE cron_workflows
|
||||
ADD COLUMN schedule varchar(255),
|
||||
ADD COLUMN timezone varchar(255),
|
||||
ADD COLUMN suspend boolean,
|
||||
ADD COLUMN concurrency_policy varchar(255),
|
||||
ADD COLUMN starting_deadline_seconds INT,
|
||||
ADD COLUMN successful_jobs_history_limit INT,
|
||||
ADD COLUMN failed_jobs_history_limit INT,
|
||||
ADD COLUMN workflow_spec TEXT
|
||||
;
|
||||
|
||||
ALTER TABLE cron_workflows DROP COLUMN manifest;
|
||||
27
db/sql/20200502184729_workspaces.sql
Normal file
27
db/sql/20200502184729_workspaces.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE workspaces
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
uid varchar(30) NOT NULL CHECK(uid <> ''),
|
||||
name varchar(30) NOT NULL CHECK(name <> ''),
|
||||
namespace varchar(30) NOT NULL,
|
||||
phase varchar(50) NOT NULL,
|
||||
parameters jsonb NOT NULL,
|
||||
|
||||
workspace_template_id integer NOT NULL REFERENCES workspace_templates ON DELETE CASCADE,
|
||||
workspace_template_version integer NOT NULL,
|
||||
|
||||
started_at timestamp,
|
||||
paused_at timestamp,
|
||||
terminated_at timestamp,
|
||||
|
||||
-- auditing info
|
||||
created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'),
|
||||
modified_at timestamp
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX workspaces_name_namespace_key ON workspaces (name, namespace) WHERE phase <> 'Terminated';
|
||||
CREATE UNIQUE INDEX workspaces_uid_namespace_key ON workspaces (uid, namespace) WHERE phase <> 'Terminated';
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE workspaces;
|
||||
@@ -0,0 +1,7 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workflow_executions ADD COLUMN parameters JSONB;
|
||||
UPDATE workflow_executions SET parameters = '[]'::JSONB;
|
||||
ALTER TABLE workflow_executions ALTER COLUMN parameters SET NOT NULL;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE workflow_executions DROP COLUMN parameters;
|
||||
@@ -0,0 +1,7 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workflow_templates ADD COLUMN is_system BOOLEAN DEFAULT false;
|
||||
UPDATE workflow_templates SET is_system = false;
|
||||
ALTER TABLE workflow_templates ALTER COLUMN is_system SET NOT NULL;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE workflow_templates DROP COLUMN is_system;
|
||||
7
db/sql/20200511164307_add_path_to_workspaces.sql
Normal file
7
db/sql/20200511164307_add_path_to_workspaces.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workspaces ADD COLUMN url TEXT;
|
||||
UPDATE workspaces set url = '';
|
||||
ALTER TABLE workspaces ALTER COLUMN url SET NOT NULL;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE workspaces DROP COLUMN url;
|
||||
5
db/sql/20200512182928_add_updated_at_to_workspaces.sql
Normal file
5
db/sql/20200512182928_add_updated_at_to_workspaces.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workspaces ADD COLUMN updated_at timestamp;
|
||||
|
||||
-- +goose Down
|
||||
ALTER TABLE workspaces DROP COLUMN updated_at;
|
||||
@@ -0,0 +1,13 @@
|
||||
-- +goose Up
|
||||
ALTER TABLE workflow_templates DROP CONSTRAINT IF EXISTS workflow_templates_uid_key;
|
||||
ALTER TABLE workflow_templates DROP CONSTRAINT IF EXISTS workflow_templates_uid_namespace_key;
|
||||
DROP INDEX IF EXISTS workflow_templates_name_namespace_key;
|
||||
CREATE UNIQUE INDEX workflow_templates_name_namespace_key ON workflow_templates (name, namespace) WHERE is_archived = false;
|
||||
CREATE UNIQUE INDEX workflow_templates_uid_namespace_key ON workflow_templates (uid, namespace) WHERE is_archived = false;
|
||||
|
||||
-- +goose Down
|
||||
-- SQL in this section is executed when the migration is rolled back.
|
||||
DROP INDEX workflow_templates_name_namespace_key;
|
||||
DROP INDEX workflow_templates_uid_namespace_key;
|
||||
ALTER TABLE workflow_templates ADD CONSTRAINT workflow_templates_uid_key UNIQUE (uid);
|
||||
ALTER TABLE workflow_templates ADD CONSTRAINT workflow_templates_uid_namespace_key UNIQUE (uid, namespace);
|
||||
15
db/sql/20200521112757_add_namespace_cron_workflows.sql
Normal file
15
db/sql/20200521112757_add_namespace_cron_workflows.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- +goose Up
|
||||
-- SQL in this section is executed when the migration is applied.
|
||||
ALTER TABLE cron_workflows ADD COLUMN namespace varchar(30);
|
||||
UPDATE cron_workflows cwfs
|
||||
SET namespace = q.namespace
|
||||
FROM (
|
||||
SELECT wft.id, wft.namespace, wtv.id as wtv_id, wtv.workflow_template_id, cw.id
|
||||
FROM workflow_templates wft
|
||||
INNER JOIN workflow_template_versions wtv on wft.id = wtv.workflow_template_id
|
||||
INNER JOIN cron_workflows cw on wtv.id = cw.workflow_template_version_id) q
|
||||
WHERE cwfs.workflow_template_version_id = q.wtv_id;
|
||||
ALTER TABLE cron_workflows ALTER COLUMN namespace SET NOT NULL;
|
||||
-- +goose Down
|
||||
-- SQL in this section is executed when the migration is rolled back.
|
||||
ALTER TABLE cron_workflows DROP COLUMN namespace;
|
||||
@@ -0,0 +1,6 @@
|
||||
-- +goose Up
|
||||
-- SQL in this section is executed when the migration is applied.
|
||||
CREATE UNIQUE INDEX cron_workflow_namespace_uid ON cron_workflows (uid, namespace);
|
||||
-- +goose Down
|
||||
-- SQL in this section is executed when the migration is rolled back.
|
||||
DROP INDEX cron_workflow_namespace_uid;
|
||||
@@ -0,0 +1,8 @@
|
||||
-- +goose Up
|
||||
-- SQL in this section is executed when the migration is applied.
|
||||
ALTER TABLE cron_workflows ADD COLUMN is_archived BOOL DEFAULT false NOT NULL;
|
||||
ALTER TABLE workflow_executions ADD COLUMN is_archived BOOL DEFAULT false NOT NULL;
|
||||
-- +goose Down
|
||||
-- SQL in this section is executed when the migration is rolled back.
|
||||
ALTER TABLE cron_workflows DROP COLUMN is_archived;
|
||||
ALTER TABLE workflow_executions DROP COLUMN is_archived;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user