SaltStack adaptor API creation
[ccsdk/sli/adaptors.git] / saltstack-adapter / saltstack-adapter-provider / src / main / java / org / onap / ccsdk / sli / adaptors / saltstack / SaltstackAdapter.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.ccsdk.sli.adaptors.saltstack;
26
27 import java.util.Map;
28 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
29 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
30 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
31
32 /**
33  * This interface defines the operations that the Saltstack adapter exposes.
34  *
35  */
36 public interface SaltstackAdapter extends SvcLogicJavaPlugin {
37     /**
38      * Returns the symbolic name of the adapter
39      *
40      * @return The adapter name
41      */
42     String getAdapterName();
43
44     /* Method to post a single command request for execution on SaltState server
45      *  The response from Saltstack comes in json format and it is automatically put
46      *  to context for DGs access, with a certain prefix*/
47     void reqExecCommand(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
48
49     /* When SLS file is created/available then this Method can be used to post
50      *  the file to saltstack server and execute the SLS file on SaltState server
51      *  The response from Saltstack comes in json format and it is automatically put
52      *  to context for DGs access, with a certain prefix*/
53     void reqExecSLS(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
54
55     /* Method to get log of a saltState execution request
56      *  The response from Saltstack comes in json format and it is automatically put
57      *  to context for DGs access, with a certain prefix*/
58     void reqExecLog(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException;
59
60     /**
61      * Set the command execution timeout
62      * @param timeout time in milliseconds
63      */
64     void setExecTimeout(long timeout);
65 }