2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright (C) 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
20 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 package org.openecomp.appc.adapter.chef;
27 import org.openecomp.appc.exceptions.APPCException;
28 import com.att.cdp.zones.model.Server;
29 import org.openecomp.sdnc.sli.SvcLogicContext;
30 import org.openecomp.sdnc.sli.SvcLogicJavaPlugin;
33 * This interface defines the operations that the provider adapter exposes.
35 * This interface defines static constant property values that can be used to configure the adapter. These constants are
36 * prefixed with the name PROPERTY_ to indicate that they are configuration properties. These properties are read from
37 * the configuration file for the adapter and are used to define the providers, identity service URLs, and other
38 * information needed by the adapter to interface with an IaaS provider.
41 public interface ChefAdapter extends SvcLogicJavaPlugin {
44 * The type of provider to be accessed to locate and operate on a virtual machine instance. This is used to load the
45 * correct provider support through the CDP IaaS abstraction layer and can be OpenStackProvider, BareMetalProvider,
46 * or any other supported provider type.
48 static final String PROPERTY_PROVIDER_TYPE = "org.openecomp.appc.provider.type";
51 * The adapter maintains a cache of providers organized by the name of the provider, not its type. This is
52 * equivalent to the system or installation name. All regions within the same installation are assumed to be the
55 static final String PROPERTY_PROVIDER_NAME = "org.openecomp.appc.provider.name";
58 * The fully-qualified URL of the instance to be manipulated as it is known to the provider.
60 static final String PROPERTY_INSTANCE_URL = "org.openecomp.appc.instance.url";
63 * The fully-qualified URL of the instance to be manipulated as it is known to the provider.
65 static final String PROPERTY_IDENTITY_URL = "org.openecomp.appc.identity.url";
68 * This method is used to restart an existing virtual machine given the fully qualified URL of the machine.
70 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
71 * passed to the method are passed as properties in a map. This method expects the following properties to be
74 * <dt>org.openecomp.appc.provider.type</dt>
75 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
76 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
77 * provider types are legal.</dd>
78 * <dt>org.openecomp.appc.instance.url</dt>
79 * <dd>The fully qualified URL of the instance to be restarted, as it is known to the provider (i.e., the self-link
80 * URL of the server)</dd>
85 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
88 * The service logic context of the graph being executed.
89 * @return The <code>Server</code> object that represents the VM being restarted. The returned server object can be
90 * inspected for the final state of the server once the restart has been completed. The method does not
91 * return until the restart has either completed or has failed.
92 * @throws APPCException
93 * If the server cannot be restarted for some reason
95 // Server restartServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
98 * This method is used to stop the indicated server
100 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
101 * passed to the method are passed as properties in a map. This method expects the following properties to be
104 * <dt>org.openecomp.appc.provider.type</dt>
105 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
106 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
107 * provider types are legal.</dd>
108 * <dt>org.openecomp.appc.instance.url</dt>
109 * <dd>The fully qualified URL of the instance to be stopped, as it is known to the provider (i.e., the self-link
110 * URL of the server)</dd>
115 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
118 * The service logic context of the graph being executed.
119 * @return The <code>Server</code> object that represents the VM being stopped. The returned server object can be
120 * inspected for the final state of the server once the stop has been completed. The method does not return
121 * until the stop has either completed or has failed.
122 * @throws APPCException
123 * If the server cannot be stopped for some reason
125 //Server stopServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
128 * This method is used to start the indicated server
130 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
131 * passed to the method are passed as properties in a map. This method expects the following properties to be
134 * <dt>org.openecomp.appc.provider.type</dt>
135 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
136 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
137 * provider types are legal.</dd>
138 * <dt>org.openecomp.appc.instance.url</dt>
139 * <dd>The fully qualified URL of the instance to be started, as it is known to the provider (i.e., the self-link
140 * URL of the server)</dd>
145 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
148 * The service logic context of the graph being executed.
149 * @return The <code>Server</code> object that represents the VM being started. The returned server object can be
150 * inspected for the final state of the server once the start has been completed. The method does not return
151 * until the start has either completed or has failed.
152 * @throws APPCException
153 * If the server cannot be started for some reason
155 // Server startServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
158 * This method is used to rebuild the indicated server
160 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
161 * passed to the method are passed as properties in a map. This method expects the following properties to be
164 * <dt>org.openecomp.appc.provider.type</dt>
165 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
166 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
167 * provider types are legal.</dd>
168 * <dt>org.openecomp.appc.instance.url</dt>
169 * <dd>The fully qualified URL of the instance to be rebuilt, as it is known to the provider (i.e., the self-link
170 * URL of the server)</dd>
175 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
178 * The service logic context of the graph being executed.
179 * @return The <code>Server</code> object that represents the VM being rebuilt. The returned server object can be
180 * inspected for the final state of the server once the rebuild has been completed. The method does not
181 * return until the rebuild has either completed or has failed.
182 * @throws APPCException
183 * If the server cannot be rebuilt for some reason
185 // Server rebuildServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
188 * Returns the symbolic name of the adapter
190 * @return The adapter name
192 String getAdapterName();
194 // Server evacuateServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
196 //Server migrateServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
198 void trigger(Map<String, String> params, SvcLogicContext ctx) ;
200 void chefGet(Map<String, String> params, SvcLogicContext ctx) ;
202 void chefPut(Map<String, String> params, SvcLogicContext ctx) ;
204 void chefPost(Map<String, String> params, SvcLogicContext ctx) ;
206 void chefDelete(Map<String, String> params, SvcLogicContext ctx) ;
208 void nodeObejctBuilder(Map<String, String> params, SvcLogicContext ctx) ;
210 void checkPushJob(Map<String, String> params, SvcLogicContext ctx) ;
212 void pushJob(Map<String, String> params, SvcLogicContext ctx) ;
214 void retrieveData (Map<String, String> params, SvcLogicContext ctx) ;
216 void combineStrings (Map<String, String> params, SvcLogicContext ctx) ;