2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 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
13 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * ============LICENSE_END=========================================================
24 package org.onap.ccsdk.sli.adaptors.rest;
27 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
28 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
31 * This interface defines the operations that the provider adaptor exposes.
33 * This interface defines static constant property values that can be used to configure the adaptor. These constants are
34 * prefixed with the name PROPERTY_ to indicate that they are configuration properties. These properties are read from
35 * the configuration file for the adaptor and are used to define the providers, identity service URLs, and other
36 * information needed by the adaptor to interface with an IaaS provider.
39 public interface RestAdaptor extends SvcLogicJavaPlugin {
42 * The type of provider to be accessed to locate and operate on a virtual machine instance. This is used to load the
43 * correct provider support through the CDP IaaS abstraction layer and can be OpenStackProvider, BareMetalProvider,
44 * or any other supported provider type.
46 static final String PROPERTY_PROVIDER_TYPE = "org.onap.appc.provider.type";
49 * The adaptor maintains a cache of providers organized by the name of the provider, not its type. This is
50 * equivalent to the system or installation name. All regions within the same installation are assumed to be the
53 static final String PROPERTY_PROVIDER_NAME = "org.onap.appc.provider.name";
56 * The fully-qualified URL of the instance to be manipulated as it is known to the provider.
58 static final String PROPERTY_INSTANCE_URL = "org.onap.appc.instance.url";
61 * The fully-qualified URL of the instance to be manipulated as it is known to the provider.
63 static final String PROPERTY_IDENTITY_URL = "org.onap.appc.identity.url";
66 * This method is used to restart an existing virtual machine given the fully qualified URL of the machine.
68 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
69 * passed to the method are passed as properties in a map. This method expects the following properties to be
72 * <dt>org.onap.appc.provider.type</dt>
73 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
74 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
75 * provider types are legal.</dd>
76 * <dt>org.onap.appc.instance.url</dt>
77 * <dd>The fully qualified URL of the instance to be restarted, as it is known to the provider (i.e., the self-link
78 * URL of the server)</dd>
83 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
86 * The service logic context of the graph being executed.
87 * @return The <code>Server</code> object that represents the VM being restarted. The returned server object can be
88 * inspected for the final state of the server once the restart has been completed. The method does not
89 * return until the restart has either completed or has failed.
90 * @throws APPCException
91 * If the server cannot be restarted for some reason
93 // Server restartServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
96 * This method is used to stop the indicated server
98 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
99 * passed to the method are passed as properties in a map. This method expects the following properties to be
102 * <dt>org.onap.appc.provider.type</dt>
103 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
104 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
105 * provider types are legal.</dd>
106 * <dt>org.onap.appc.instance.url</dt>
107 * <dd>The fully qualified URL of the instance to be stopped, as it is known to the provider (i.e., the self-link
108 * URL of the server)</dd>
113 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
116 * The service logic context of the graph being executed.
117 * @return The <code>Server</code> object that represents the VM being stopped. The returned server object can be
118 * inspected for the final state of the server once the stop has been completed. The method does not return
119 * until the stop has either completed or has failed.
120 * @throws APPCException
121 * If the server cannot be stopped for some reason
123 //Server stopServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
126 * This method is used to start the indicated server
128 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
129 * passed to the method are passed as properties in a map. This method expects the following properties to be
132 * <dt>org.onap.appc.provider.type</dt>
133 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
134 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
135 * provider types are legal.</dd>
136 * <dt>org.onap.appc.instance.url</dt>
137 * <dd>The fully qualified URL of the instance to be started, as it is known to the provider (i.e., the self-link
138 * URL of the server)</dd>
143 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
146 * The service logic context of the graph being executed.
147 * @return The <code>Server</code> object that represents the VM being started. The returned server object can be
148 * inspected for the final state of the server once the start has been completed. The method does not return
149 * until the start has either completed or has failed.
150 * @throws APPCException
151 * If the server cannot be started for some reason
153 // Server startServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
156 * This method is used to rebuild the indicated server
158 * This method is invoked from a directed graph as an <code>Executor</code> node. This means that the parameters
159 * passed to the method are passed as properties in a map. This method expects the following properties to be
162 * <dt>org.onap.appc.provider.type</dt>
163 * <dd>The appropriate provider type, such as <code>OpenStackProvider</code>. This is used by the CDP IaaS
164 * abstraction layer to dynamically load and open a connection to the appropriate provider type. All CDP supported
165 * provider types are legal.</dd>
166 * <dt>org.onap.appc.instance.url</dt>
167 * <dd>The fully qualified URL of the instance to be rebuilt, as it is known to the provider (i.e., the self-link
168 * URL of the server)</dd>
173 * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
176 * The service logic context of the graph being executed.
177 * @return The <code>Server</code> object that represents the VM being rebuilt. The returned server object can be
178 * inspected for the final state of the server once the rebuild has been completed. The method does not
179 * return until the rebuild has either completed or has failed.
180 * @throws APPCException
181 * If the server cannot be rebuilt for some reason
183 // Server rebuildServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
186 * Returns the symbolic name of the adaptor
188 * @return The adaptor name
190 String getAdaptorName();
192 // Server evacuateServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
194 //Server migrateServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
196 void commonGet(Map<String, String> params, SvcLogicContext ctx);
198 void commonPost(Map<String, String> params, SvcLogicContext ctx);
200 void commonPut(Map<String, String> params, SvcLogicContext ctx);
202 void commonDelete(Map<String, String> params, SvcLogicContext ctx);