001/*
002 * VM-Operator
003 * Copyright (C) 2023 Michael N. Lipp
004 * 
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
017 */
018
019package org.jdrupes.vmoperator.common;
020
021/**
022 * Some constants.
023 */
024@SuppressWarnings("PMD.DataClass")
025public class Constants {
026
027    /** The Constant APP_NAME. */
028    public static final String APP_NAME = "vm-runner";
029
030    /** The Constant VM_OP_NAME. */
031    public static final String VM_OP_NAME = "vm-operator";
032
033    /**
034     * Constants related to the CRD.
035     */
036    @SuppressWarnings("PMD.ShortClassName")
037    public static class Crd {
038        /** The Constant GROUP. */
039        public static final String GROUP = "vmoperator.jdrupes.org";
040
041        /** The Constant KIND_VM. */
042        public static final String KIND_VM = "VirtualMachine";
043
044        /** The Constant KIND_VM_POOL. */
045        public static final String KIND_VM_POOL = "VmPool";
046    }
047
048    /**
049     * Status related constants.
050     */
051    public static class Status {
052        /** The Constant RUNNER_VERSION. */
053        public static final String RUNNER_VERSION = "runnerVersion";
054
055        /** The Constant CPUS. */
056        public static final String CPUS = "cpus";
057
058        /** The Constant RAM. */
059        public static final String RAM = "ram";
060
061        /** The Constant OSINFO. */
062        public static final String OSINFO = "osinfo";
063
064        /** The Constant DISPLAY_PASSWORD_SERIAL. */
065        public static final String DISPLAY_PASSWORD_SERIAL
066            = "displayPasswordSerial";
067
068        /** The Constant LOGGED_IN_USER. */
069        public static final String LOGGED_IN_USER = "loggedInUser";
070
071        /** The Constant CONSOLE_CLIENT. */
072        public static final String CONSOLE_CLIENT = "consoleClient";
073
074        /** The Constant CONSOLE_USER. */
075        public static final String CONSOLE_USER = "consoleUser";
076
077        /** The Constant ASSIGNMENT. */
078        public static final String ASSIGNMENT = "assignment";
079
080        /**
081         * Conditions used in Status.
082         */
083        public static class Condition {
084            /** The Constant COND_RUNNING. */
085            public static final String RUNNING = "Running";
086
087            /** The Constant COND_BOOTED. */
088            public static final String BOOTED = "Booted";
089
090            /** The Constant COND_VMOP_AGENT. */
091            public static final String VMOP_AGENT = "VmopAgentConnected";
092
093            /** The Constant COND_USER_LOGGED_IN. */
094            public static final String USER_LOGGED_IN = "UserLoggedIn";
095
096            /** The Constant COND_CONSOLE. */
097            public static final String CONSOLE_CONNECTED = "ConsoleConnected";
098
099            /**
100             * Reasons used in conditions.
101             */
102            public static class Reason {
103                /** The Constant NOT_REQUESTED. */
104                public static final String NOT_REQUESTED = "NotRequested";
105
106                /** The Constant USER_LOGGED_IN. */
107                public static final String LOGGED_IN = "LoggedIn";
108            }
109        }
110    }
111
112    /**
113     * DisplaySecret related constants.
114     */
115    public static class DisplaySecret {
116
117        /** The Constant NAME. */
118        public static final String NAME = "display-secret";
119
120        /** The Constant PASSWORD. */
121        public static final String PASSWORD = "display-password";
122
123        /** The Constant EXPIRY. */
124        public static final String EXPIRY = "password-expiry";
125
126    }
127}