-
Notifications
You must be signed in to change notification settings - Fork 1
Creating New Adapter
Before the creation and integration of a new Adapter to Cloud4SOA platform, an appropriate PaaS Profile needs to de available. The creation of an Adapter is not restricted to a specific language or technology, and the developer is free to use the tools that best suit his needs and the PaaS specific restrictions. The only prerequisite is to use REST with the Request – Response as defined in Cloud4SOA.Adapter-REST module. In the following lines the creation of a new adapter is shown, either by using some of the already available code or from scratch.
Generic Adapter, is a maven project that can be used as a template in order to create a Remote Adapter for a new PaaS offering. This project has been created from a maven archetype for cxf-jaxrs-service. It is also easy to set a new project by using this maven archetype or using NetBeans by choosing New Project->Maven Archetype--> cxf-jaxrs-service.
Using this archetype or even CXF is not mandatory but this is the approach followed for Java providers. In order to make proper responses back to the client the appropriate packages of cloud4soa.adapter-REST should be used, as included in the adapter template(common, response, response.model). More details about the calls that the adapter should be able to manage and the functions that a PaaS adapter should implement, can be found in cloudpier-core/adapter-REST module, in the Request and Response elements.
The credentials needed for interaction with PaaS should be retrieved from the header of the client request call. The headers that are used are “apiKey” and “secretKey”.
HttpHeaders headers = context.getHttpHeaders();
List api_key_list = headers.getRequestHeader("apiKey");
List secret_key_list = headers.getRequestHeader("secretKey");
The arguments that should be passed as parameters can be seen above each REST method.
Application Related
GET /ems/application/${applicationName}
PUT /ems/application/${applicationName}
POST /ems/application/${applicationName}/operation/${operationName}
DELETE /ems/application/${applicationName}
GET /ems
GET /ems/application
Deployment Related GET /ems/application/${applicationName}/deployment
GET /ems/application/${applicationName}/deployment/${deploymentName}
PUT /ems/application/${applicationName}/deployment/${deploymentName}
POST /ems/application/${applicationName}
POST /ems/application/${applicationName}/deployment/${deploymentName}
DELETE /ems/application/${applicationName}/deployment/${deploymentName}
Database Related
GET /ems/application/${applicationName}/deployment/${deploymentName}/database
GET /ems/application/${applicationName}/deployment/${deploymentName}/database/${databaseName}
PUT /ems/application/${applicationName}/deployment/${deploymentName}/database/${databaseName}
POST /ems/application/${applicationName}/deployment/${deploymentName}/database/${databaseName}
DELETE /ems/application/${applicationName}/deployment/${deploymentName}/database/${databaseName}
Monitoring Related
GET /monitor
GET /monitor/detail
SSH Key Related
GET /ems/sshkey
POST /ems/sshkey
DELETE /ems/sshkey