diff --git a/src/main/java/com/h1alexbel/k8sojo/Container.java b/src/main/java/com/h1alexbel/k8sojo/Container.java index 5e642a2..6f2bae8 100644 --- a/src/main/java/com/h1alexbel/k8sojo/Container.java +++ b/src/main/java/com/h1alexbel/k8sojo/Container.java @@ -1,14 +1,53 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.h1alexbel.k8sojo; /** + * Container. + * * @author Aliaksei Bialiauski (abialiauski@solvd.com) - * @since 1.0 + * @since 0.0.1 */ public interface Container { + /** + * Name + * + * @return container name as string + */ String name(); + /** + * Image. + * + * @return container image as string + */ String image(); + /** + * Commands. + * + * @return list of commands + */ Iterable commands(); } diff --git a/src/main/java/com/h1alexbel/k8sojo/DcContainer.java b/src/main/java/com/h1alexbel/k8sojo/DcContainer.java index 9a5962c..877c318 100644 --- a/src/main/java/com/h1alexbel/k8sojo/DcContainer.java +++ b/src/main/java/com/h1alexbel/k8sojo/DcContainer.java @@ -1,16 +1,49 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.h1alexbel.k8sojo; import lombok.RequiredArgsConstructor; /** + * Docker container. + * * @author Aliaksei Bialiauski (abialiauski@solvd.com) - * @since 1.0 + * @since 0.0.1 */ @RequiredArgsConstructor public final class DcContainer implements Container { + /** + * Container name. + */ private final String name; + /** + * Container image. + */ private final String image; + /** + * Container commands. + */ private final Iterable commands; @Override diff --git a/src/main/java/com/h1alexbel/k8sojo/Kojo.java b/src/main/java/com/h1alexbel/k8sojo/Kojo.java index 816a681..4f4b659 100644 --- a/src/main/java/com/h1alexbel/k8sojo/Kojo.java +++ b/src/main/java/com/h1alexbel/k8sojo/Kojo.java @@ -1,16 +1,60 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.h1alexbel.k8sojo; /** + * Kubernetes Object. + * * @author Aliaksei Bialiauski (abialiauski@solvd.com) - * @since 1.0 + * @since 0.0.1 */ public interface Kojo { + /** + * Api version. + * + * @return api version as string + */ String apiVersion(); + /** + * Kind. + * + * @return kind as string + */ String kind(); + /** + * Metadata. + * + * @return metadata + */ Metadata meta(); + /** + * Spec. + * + * @return spec + */ Spec spec(); } \ No newline at end of file diff --git a/src/main/java/com/h1alexbel/k8sojo/Metadata.java b/src/main/java/com/h1alexbel/k8sojo/Metadata.java index 3354d15..2e39d66 100644 --- a/src/main/java/com/h1alexbel/k8sojo/Metadata.java +++ b/src/main/java/com/h1alexbel/k8sojo/Metadata.java @@ -1,10 +1,39 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.h1alexbel.k8sojo; /** + * Kubernetes metadata. + * * @author Aliaksei Bialiauski (abialiauski@solvd.com) - * @since 1.0 + * @since 0.0.1 */ public interface Metadata { + /** + * Name. + * + * @return name as string + */ String name(); } \ No newline at end of file diff --git a/src/main/java/com/h1alexbel/k8sojo/Spec.java b/src/main/java/com/h1alexbel/k8sojo/Spec.java index 85a12ab..786a859 100644 --- a/src/main/java/com/h1alexbel/k8sojo/Spec.java +++ b/src/main/java/com/h1alexbel/k8sojo/Spec.java @@ -1,12 +1,46 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.h1alexbel.k8sojo; /** + * Kubernetes spec. + * * @author Aliaksei Bialiauski (abialiauski@solvd.com) - * @since 1.0 + * @since 0.0.1 */ public interface Spec { + /** + * Template. + * + * @return template + */ Template template(); + /** + * BackOffLimit. + * + * @return backoff limit as int + */ int backOffLimit(); } \ No newline at end of file diff --git a/src/main/java/com/h1alexbel/k8sojo/Template.java b/src/main/java/com/h1alexbel/k8sojo/Template.java index 025a6c7..f587af9 100644 --- a/src/main/java/com/h1alexbel/k8sojo/Template.java +++ b/src/main/java/com/h1alexbel/k8sojo/Template.java @@ -1,10 +1,39 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.h1alexbel.k8sojo; /** + * Template + * * @author Aliaksei Bialiauski (abialiauski@solvd.com) - * @since 1.0 + * @since 0.0.1 */ public interface Template { + /** + * Template spec. + * + * @return spec + */ TemplateSpec spec(); } \ No newline at end of file diff --git a/src/main/java/com/h1alexbel/k8sojo/TemplateSpec.java b/src/main/java/com/h1alexbel/k8sojo/TemplateSpec.java index 6e7cbdd..f2c2bf4 100644 --- a/src/main/java/com/h1alexbel/k8sojo/TemplateSpec.java +++ b/src/main/java/com/h1alexbel/k8sojo/TemplateSpec.java @@ -1,12 +1,44 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.h1alexbel.k8sojo; /** * @author Aliaksei Bialiauski (abialiauski@solvd.com) - * @since 1.0 + * @since 0.0.1 */ public interface TemplateSpec { + /** + * Containers. + * + * @return list of containers + */ Iterable containers(); + /** + * Restart policy. + * + * @return restart policy as string + */ String restartPolicy(); } \ No newline at end of file diff --git a/src/main/java/com/h1alexbel/k8sojo/package-info.java b/src/main/java/com/h1alexbel/k8sojo/package-info.java new file mode 100644 index 0000000..82c858d --- /dev/null +++ b/src/main/java/com/h1alexbel/k8sojo/package-info.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 Aliaksei Bialiauski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** K8sojo + * @author Aliaksei Bialiauski (abialiauski@solvd.com) + * @since 0.0.1 + */ + +package com.h1alexbel.k8sojo; \ No newline at end of file