First part of onap rename
[appc.git] / appc-adapters / appc-ssh-adapter / appc-ssh-adapter-api / src / main / java / org / openecomp / appc / adapter / ssh / Constants.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.onap.appc.adapter.ssh;
26
27 public class Constants {
28
29     private Constants(){}
30
31     // tables and fields
32     public static final String NETCONF_SCHEMA = "sdnctl";
33     public static final String SDNCTL_SCHEMA = "sdnctl";
34     public static final String DEVICE_AUTHENTICATION_TABLE_NAME = "DEVICE_AUTHENTICATION";
35     public static final String CONFIGFILES_TABLE_NAME = "CONFIGFILES";
36     public static final String DEVICE_INTERFACE_LOG_TABLE_NAME = "DEVICE_INTERFACE_LOG";
37     public static final String FILE_CONTENT_TABLE_FIELD_NAME = "FILE_CONTENT";
38     public static final String FILE_NAME_TABLE_FIELD_NAME = "FILE_NAME";
39     public static final String USER_NAME_TABLE_FIELD_NAME = "USER_NAME";
40     public static final String PASSWORD_TABLE_FIELD_NAME = "PASSWORD";
41     public static final String PORT_NUMBER_TABLE_FIELD_NAME = "PORT_NUMBER";
42     public static final String VNF_TYPE_TABLE_FIELD_NAME = "VNF_TYPE";
43     public static final String SERVICE_INSTANCE_ID_FIELD_NAME = "SERVICE_INSTANCE_ID";
44     public static final String REQUEST_ID_FIELD_NAME = "REQUEST_ID";
45     public static final String CREATION_DATE_FIELD_NAME = "CREATION_DATE";
46     public static final String LOG_FIELD_NAME = "LOG";
47     public static final String ASDC_ARTIFACTS_TABLE_NAME = "ASDC_ARTIFACTS";
48
49     // input fields names
50     public static final String PAYLOAD = "payload";
51
52     public static final String CONNECTION_RETRY_DELAY = "org.onap.appc.ssh.connection.retry.delay";
53     public static final String CONNECTION_RETRY_COUNT = "org.onap.appc.ssh.connection.retry.count";
54     public static final int DEFAULT_CONNECTION_RETRY_DELAY = 60;
55     public static final int DEFAULT_CONNECTION_RETRY_COUNT = 5;
56
57     public static final int DEFAULT_SSH_COMMAND_RETRY_COUNT = 3;
58
59     public static final int DEFAULT_CHECKACTIVE_RETRY_COUNT = 3;
60     public static final int DEFAULT_CHECKACTIVE_RETRY_DELAY = 30;
61
62     public static final int DEFAULT_STOP_RETRY_COUNT = 3;
63     public static final int DEFAULT_STOP_RETRY_DELAY = 30; //seconds
64
65     public static final String PARAM_IN_CONNECTION_DETAILS = "connection-details";
66     public static final String PARAM_IN_NODE_NAME = "node-name";
67     public static final String PARAM_IN_NODE_STATUS = "node-status";
68     public static final String PARAM_IN_VM_URL = "vm-url";
69     public static final String SKIP_EXECUTION_INSTALLER_BIN_FILE = "Skip-execution-installer-bin-file";
70     public static final String SKIP_DEPLOY = "Skip-deploy";
71     public static final String UPGRADE_VERSION = "upgrade-version";
72
73     //command to get number of UP hosts
74     public static final String STATE_COMMAND = "/opt/jnetx/skyfall-scp/asp-state.sh | grep -o UP | wc -l";
75     //command to get each VNFC status
76     public static final String VNFC_STATE_COMMAND = "/opt/jnetx/skyfall-scp/asp-state.sh";
77     //command to restart node
78     public static final String RESTART_NODE_COMMAND = "/opt/jnetx/skyfall-scp/asp-stop.sh --restart -f --nodes";
79     //command to start node
80     public static final String START_NODE_COMMAND = "/opt/jnetx/skyfall-scp/asp-start.sh -f --nodes";
81     //command to stop node
82     public static final String STOP_NODE_COMMAND = "/opt/jnetx/skyfall-scp/asp-stop.sh -f --nodes";
83     public static final int STATE_COMMAND_RESULT = 18;
84     //commands to check FE hosts
85     public static final String FE_STATE_TRUE_TEST_COMMAND = "ssh -t -q fe1 /opt/omni/bin/swmml -e display-platform-status | grep -o TRUE | wc -l";
86     public static final int FE_STATE_TRUE_TEST_RESULT = 22;
87     public static final String FE_STATE_FALSE_TEST_COMMAND = "ssh -t -q fe1 /opt/omni/bin/swmml -e display-platform-status | grep -o FALSE | wc -l";
88     public static final int FE_STATE_FALSE_TEST_RESULT = 2;
89     public static final String FE_OPERATIONAL_TEST_COMMAND = "ssh -t -q fe1 /opt/omni/bin/swmml -e display-platform-status | grep -o 'NOT FULLY OPERATIONAL' | wc -l";
90     public static final int FE_OPERATIONAL_TEST_RESULT = 2;
91
92     //smp commands
93     public static final String SMP_CHECK_ACTIVE_STATE_COMMAND = "cat skyfall-scp/runtime/SCP_SMP_*/smp/log/system.log| grep SSS | tail -1";
94     public static final String SMP_STATE_ACTIVE="SMP is active";
95     public static final String SMP_STATE_INACTIVE="SMP is not active";
96
97     //rsync command
98     public static final String RSYNC_COMMAND = "yes n | /opt/jnetx/skyfall-scp/asp-rsync.sh --check | grep -o 'is active' | wc -l";
99     public static final int RSYNC_COMMAND_RESULT = 9;
100
101     public static final String PARAM_IN_TIMEOUT = "timeout";
102     public static final String PARAM_IN_FILE_URL = "source-file-url";
103     public static final String DOWNLOAD_COMMAND = "wget -N %s";
104
105     // pre-define VM names
106     public static final String[] VM_NAMES = {"fe1", "fe2", "be1", "be2", "be3", "be4", "be5", "smp1", "smp2"};
107
108     public static final String DEFAULT_DISK_SPACE = "10240000";
109     public static final String DF_COMMAND_TEMPLATE = "ssh %s df | grep vda1 | grep -v grep | tr -s ' '|cut -d ' ' -f4";
110
111     public static final String DG_OUTPUT_STATUS_MESSAGE = "output.status.message";
112     public static final String ATTRIBUTE_ERROR_MESSAGE = "error-message";
113
114
115     // constants for DG
116     public static final String CONNECTION_DETAILS_FIELD_NAME = PARAM_IN_CONNECTION_DETAILS;
117     public static final String VNF_HOST_IP_ADDRESS_FIELD_NAME = "vnf-host-ip-address";
118     public static final String VNF_HOST_IP2_ADDRESS_FIELD_NAME = "vnf-host-ip2-address";
119     public static final String DG_ERROR_FIELD_NAME = "org.openecom.appc.dg.error";
120 }