Class ServiceRestController
- java.lang.Object
-
- org.neotropic.kuwaiba.northbound.rest.services.ServiceRestController
-
- All Implemented Interfaces:
ServiceRestOpenApi
@RestController @RequestMapping("/v2.1.1/service-manager/") public class ServiceRestController extends Object implements ServiceRestOpenApi
Service Manager Rest Controller.- Author:
- Mauricio Ruiz Beltrán <mauricio.ruiz@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description ServiceRestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createCustomer(String poolId, String customerClassName, HashMap<String,String> attributes, String userName, String sessionId)
Creates a customer.String
createCustomerPool(String poolName, String poolDescription, String userName, String sessionId)
Creates a customer pool.String
createService(String poolId, String serviceClassName, HashMap<String,String> attributes, String userName, String sessionId)
Creates a service.String
createServicePool(String customerClassName, String customerId, String poolName, String poolDescription, String userName, String sessionId)
Creates a service pool.void
deleteCostumer(String customerClassName, String customerId, String userName, String sessionId)
Deletes a customer.void
deleteCustomerPool(String poolId, String poolClassName, String userName, String sessionId)
Deletes a customer pool.void
deleteService(String serviceClassName, String serviceId, String userName, String sessionId)
Deletes a service.void
deleteServicePool(String poolId, String poolClassName, String userName, String sessionId)
Deletes a service pool.List<BusinessObjectLight>
getAllCustomers(HashMap<String,String> filters, long page, long limit, String sessionId)
Gets all the customer.List<BusinessObjectLight>
getAllServices(HashMap<String,String> filters, long page, long limit, String sessionId)
Gets all the services.BusinessObject
getCustomer(String customerClassName, String customerId, String sessionId)
Gets the detailed information about a customer.InventoryObjectPool
getCustomerPool(String poolId, String poolClassName, String sessionId)
Gets a customer pool.List<InventoryObjectPool>
getCustomerPools(String sessionId)
Retrieves the list of customer pools.List<BusinessObjectLight>
getCustomersInPool(String poolId, String customerClassName, int page, int limit, String sessionId)
Retrieves the list of customers from a pool.List<BusinessObjectLight>
getObjectsRelatedToService(String serviceClassName, String serviceId, String sessionId)
Retrieves the objects related to service.BusinessObject
getService(String serviceClassName, String serviceId, String sessionId)
Gets the detailed information about a service.InventoryObjectPool
getServicePool(String poolId, String poolClassName, String sessionId)
Gets a service pool.List<InventoryObjectPool>
getServicePoolsInCostumer(String customerClassName, String customerId, String servicePoolClassName, String sessionId)
Retrieves the pools associated to a particular customer.List<BusinessObjectLight>
getServicesInPool(String poolId, String serviceClassName, int page, int limit, String sessionId)
Retrieves the list of services from a pool.void
relateObjectsToService(String[] objectsClassNames, String[] objectsIds, String serviceClassName, String serviceId, String userName, String sessionId)
Relates inventory objects (resources) to a service.void
relateObjectToService(String objectClassName, String objectId, String serviceClassName, String serviceId, String userName, String sessionId)
Relates an inventory object (resource) to a service.void
releaseObjectFromService(String serviceClassName, String serviceId, String objectId, String userName, String sessionId)
Releases an inventory object from a service.void
updateCustomer(String customerClassName, String customerId, HashMap<String,String> attributes, String userName, String sessionId)
Updates a customer.void
updateCustomerPool(String poolId, String poolClassName, String poolName, String poolDescription, String userName, String sessionId)
Updates a customer pool.void
updateService(String serviceClassName, String serviceId, HashMap<String,String> attributes, String userName, String sessionId)
Updates a service.void
updateServicePool(String poolId, String poolClassName, String poolName, String poolDescription, String userName, String sessionId)
Updates a service pool.
-
-
-
Field Detail
-
PATH
public static final String PATH
Path that includes the Kuwaiba version and module- See Also:
- Constant Field Values
-
-
Method Detail
-
createCustomerPool
@RequestMapping(method=POST, value="createCustomerPool/{poolName}/{poolDescription}/{userName}/{sessionId}", produces="application/json") public String createCustomerPool(@PathVariable("poolName") String poolName, @PathVariable("poolDescription") String poolDescription, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Creates a customer pool.- Specified by:
createCustomerPool
in interfaceServiceRestOpenApi
- Parameters:
poolName
- The pool name.poolDescription
- The pool description.userName
- The user name of the session.sessionId
- The session token id.- Returns:
- The id newly created customer pool.
-
createCustomer
@RequestMapping(method=POST, value="createCustomer/{poolId}/{customerClassName}/{userName}/{sessionId}", produces="application/json") public String createCustomer(@PathVariable("poolId") String poolId, @PathVariable("customerClassName") String customerClassName, @RequestBody(required=false) HashMap<String,String> attributes, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Creates a customer.- Specified by:
createCustomer
in interfaceServiceRestOpenApi
- Parameters:
poolId
- Parent pool id.customerClassName
- This customer is going to be instance of.attributes
- The list of attributes to be set initially. The values are serialized objects.userName
- The user name of the session.sessionId
- The session token id.- Returns:
- The id newly created customer.
-
createServicePool
@RequestMapping(method=POST, value="createServicePool/{customerClassName}/{customerId}/{poolName}/{poolDescription}/{userName}/{sessionId}", produces="application/json") public String createServicePool(@PathVariable("customerClassName") String customerClassName, @PathVariable("customerId") String customerId, @PathVariable("poolName") String poolName, @PathVariable("poolDescription") String poolDescription, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Creates a service pool.- Specified by:
createServicePool
in interfaceServiceRestOpenApi
- Parameters:
customerClassName
- Customer class name.customerId
- Customer id.poolName
- The service pool name.poolDescription
- The service pool description.userName
- The user name of the session.sessionId
- The session token id.- Returns:
- The id newly created service pool.
-
createService
@RequestMapping(method=POST, value="createService/{poolId}/{serviceClassName}/{userName}/{sessionId}", produces="application/json") public String createService(@PathVariable("poolId") String poolId, @PathVariable("serviceClassName") String serviceClassName, @RequestBody(required=false) HashMap<String,String> attributes, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Creates a service.- Specified by:
createService
in interfaceServiceRestOpenApi
- Parameters:
poolId
- Parent pool id.serviceClassName
- This service is going to be instance of.attributes
- The list of attributes to be set initially. The values are serialized objects.userName
- The user name of the session.sessionId
- The session token id.- Returns:
- The id newly created service.
-
updateCustomerPool
@RequestMapping(method=PUT, value="updateCustomerPool/{poolId}/{poolClassName}/{poolName}/{poolDescription}/{userName}/{sessionId}", produces="application/json") public void updateCustomerPool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("poolName") String poolName, @PathVariable("poolDescription") String poolDescription, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Updates a customer pool.- Specified by:
updateCustomerPool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.poolName
- The pool name.poolDescription
- The pool description.userName
- The user name of the session.sessionId
- The session token id.
-
updateCustomer
@RequestMapping(method=PUT, value="updateCustomer/{customerClassName}/{customerId}/{userName}/{sessionId}", produces="application/json") public void updateCustomer(@PathVariable("customerClassName") String customerClassName, @PathVariable("customerId") String customerId, @RequestBody(required=false) HashMap<String,String> attributes, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Updates a customer.- Specified by:
updateCustomer
in interfaceServiceRestOpenApi
- Parameters:
customerClassName
- Customer class name.customerId
- Customer id.attributes
- The attributes to be updated (the key is the attribute name, the value is and array with the value -or values in case of MANY TO MANY list type attributes-).userName
- The user name of the session.sessionId
- The session token id.
-
updateServicePool
@RequestMapping(method=PUT, value="updateServicePool/{poolId}/{poolClassName}/{poolName}/{poolDescription}/{userName}/{sessionId}", produces="application/json") public void updateServicePool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("poolName") String poolName, @PathVariable("poolDescription") String poolDescription, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Updates a service pool.- Specified by:
updateServicePool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.poolName
- The pool name.poolDescription
- The pool description.userName
- The user name of the session.sessionId
- The session token id.
-
updateService
@RequestMapping(method=PUT, value="updateService/{serviceClassName}/{serviceId}/{userName}/{sessionId}", produces="application/json") public void updateService(@PathVariable("serviceClassName") String serviceClassName, @PathVariable("serviceId") String serviceId, @RequestBody(required=false) HashMap<String,String> attributes, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Updates a service.- Specified by:
updateService
in interfaceServiceRestOpenApi
- Parameters:
serviceClassName
- Service class name.serviceId
- Service id.attributes
- The attributes to be updated (the key is the attribute name, the value is and array with the value -or values in case of MANY TO MANY list type attributes-).userName
- The user name of the session.sessionId
- The session token id.
-
deleteCustomerPool
@RequestMapping(method=DELETE, value="deleteCustomerPool/{poolId}/{poolClassName}/{userName}/{sessionId}", produces="application/json") public void deleteCustomerPool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Deletes a customer pool.- Specified by:
deleteCustomerPool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.userName
- The user name of the session.sessionId
- The session token id.
-
deleteCostumer
@RequestMapping(method=DELETE, value="deleteCostumer/{customerClassName}/{customerId}/{userName}/{sessionId}", produces="application/json") public void deleteCostumer(@PathVariable("customerClassName") String customerClassName, @PathVariable("customerId") String customerId, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Deletes a customer.- Specified by:
deleteCostumer
in interfaceServiceRestOpenApi
- Parameters:
customerClassName
- Customer class name.customerId
- Customer id.userName
- The user name of the session.sessionId
- The session token id.
-
deleteServicePool
@RequestMapping(method=DELETE, value="deleteServicePool/{poolId}/{poolClassName}/{userName}/{sessionId}", produces="application/json") public void deleteServicePool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Deletes a service pool.- Specified by:
deleteServicePool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.userName
- The user name of the session.sessionId
- The session token id.
-
deleteService
@RequestMapping(method=DELETE, value="deleteService/{serviceClassName}/{serviceId}/{userName}/{sessionId}", produces="application/json") public void deleteService(@PathVariable("serviceClassName") String serviceClassName, @PathVariable("serviceId") String serviceId, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Deletes a service.- Specified by:
deleteService
in interfaceServiceRestOpenApi
- Parameters:
serviceClassName
- Service class name.serviceId
- Service id.userName
- The user name of the session.sessionId
- The session token id.
-
getCustomerPools
@RequestMapping(method=GET, value="getCustomerPools/{sessionId}", produces="application/json") public List<InventoryObjectPool> getCustomerPools(@PathVariable("sessionId") String sessionId)
Retrieves the list of customer pools.- Specified by:
getCustomerPools
in interfaceServiceRestOpenApi
- Parameters:
sessionId
- The session token id.- Returns:
- A set of customer pools.
-
getCustomerPool
@RequestMapping(method=GET, value="getCustomerPool/{poolId}/{poolClassName}/{sessionId}", produces="application/json") public InventoryObjectPool getCustomerPool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("sessionId") String sessionId)
Gets a customer pool.- Specified by:
getCustomerPool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.sessionId
- The session token id.- Returns:
- The pool as a Pool object.
-
getAllCustomers
@RequestMapping(method=POST, value="getAllCustomers/{page}/{limit}/{sessionId}", produces="application/json") public List<BusinessObjectLight> getAllCustomers(@RequestBody(required=false) HashMap<String,String> filters, @PathVariable("page") long page, @PathVariable("limit") long limit, @PathVariable("sessionId") String sessionId)
Gets all the customer.- Specified by:
getAllCustomers
in interfaceServiceRestOpenApi
- Parameters:
filters
- Map of filters key: attribute name, value: attribute value.page
- Page or number of elements to skip.limit
- Max count of child per page.sessionId
- The session token id.- Returns:
- The customers list.
-
getCustomersInPool
@RequestMapping(method=GET, value="getCustomersInPool/{poolId}/{customerClassName}/{page}/{limit}/{sessionId}", produces="application/json") public List<BusinessObjectLight> getCustomersInPool(@PathVariable("poolId") String poolId, @PathVariable("customerClassName") String customerClassName, @PathVariable("page") int page, @PathVariable("limit") int limit, @PathVariable("sessionId") String sessionId)
Retrieves the list of customers from a pool.- Specified by:
getCustomersInPool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- Parent pool id.customerClassName
- A given className to retrieve a set of objects of that className form the pool used when the pool is a Generic class and could have objects of different class. Use "null" to get all.page
- The number of values of the result to skip or the page 0 to avoid.limit
- The results limit. Per page 0 to avoid the limit.sessionId
- The session token id.- Returns:
- The list of customers inside the pool.
-
getCustomer
@RequestMapping(method=GET, value="getCustomer/{customerClassName}/{customerId}/{sessionId}", produces="application/json") public BusinessObject getCustomer(@PathVariable("customerClassName") String customerClassName, @PathVariable("customerId") String customerId, @PathVariable("sessionId") String sessionId)
Gets the detailed information about a customer.- Specified by:
getCustomer
in interfaceServiceRestOpenApi
- Parameters:
customerClassName
- Customer class name.customerId
- Customer id.sessionId
- The session token id.- Returns:
- A detailed representation of the requested customer.
-
getServicePoolsInCostumer
@RequestMapping(method=GET, value="getServicePoolsInCostumer/{customerClassName}/{customerId}/{servicePoolClassName}/{sessionId}", produces="application/json") public List<InventoryObjectPool> getServicePoolsInCostumer(@PathVariable("customerClassName") String customerClassName, @PathVariable("customerId") String customerId, @PathVariable("servicePoolClassName") String servicePoolClassName, @PathVariable("sessionId") String sessionId)
Retrieves the pools associated to a particular customer.- Specified by:
getServicePoolsInCostumer
in interfaceServiceRestOpenApi
- Parameters:
customerClassName
- The parent customer class name.customerId
- The parent customer id.servicePoolClassName
- The class name used to filter the results.sessionId
- The session token id.- Returns:
- A set of service pools.
-
getServicePool
@RequestMapping(method=GET, value="getServicePool/{poolId}/{poolClassName}/{sessionId}", produces="application/json") public InventoryObjectPool getServicePool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("sessionId") String sessionId)
Gets a service pool.- Specified by:
getServicePool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.sessionId
- The session token id.- Returns:
- The pool as a Pool object.
-
getAllServices
@RequestMapping(method=POST, value="getAllServices/{page}/{limit}/{sessionId}", produces="application/json") public List<BusinessObjectLight> getAllServices(@RequestBody(required=false) HashMap<String,String> filters, @PathVariable("page") long page, @PathVariable("limit") long limit, @PathVariable("sessionId") String sessionId)
Gets all the services.- Specified by:
getAllServices
in interfaceServiceRestOpenApi
- Parameters:
filters
- Map of filters key: attribute name, value: attribute value.page
- Page or number of elements to skip.limit
- Max count of child per page.sessionId
- The session token id.- Returns:
- The services list.
-
getServicesInPool
@RequestMapping(method=GET, value="getServicesInPool/{poolId}/{serviceClassName}/{page}/{limit}/{sessionId}", produces="application/json") public List<BusinessObjectLight> getServicesInPool(@PathVariable("poolId") String poolId, @PathVariable("serviceClassName") String serviceClassName, @PathVariable("page") int page, @PathVariable("limit") int limit, @PathVariable("sessionId") String sessionId)
Retrieves the list of services from a pool.- Specified by:
getServicesInPool
in interfaceServiceRestOpenApi
- Parameters:
poolId
- Parent pool id.serviceClassName
- A given className to retrieve a set of objects of that className form the pool used when the pool is a Generic class and could have objects of different class. Use "null" to get all.page
- The number of values of the result to skip or the page 0 to avoid.limit
- The results limit. Per page 0 to avoid the limit.sessionId
- The session token id.- Returns:
- The list of services inside the pool.
-
getService
@RequestMapping(method=GET, value="getService/{serviceClassName}/{serviceId}/{sessionId}", produces="application/json") public BusinessObject getService(@PathVariable("serviceClassName") String serviceClassName, @PathVariable("serviceId") String serviceId, @PathVariable("sessionId") String sessionId)
Gets the detailed information about a service.- Specified by:
getService
in interfaceServiceRestOpenApi
- Parameters:
serviceClassName
- Service class name.serviceId
- Service id.sessionId
- The session token id.- Returns:
- A detailed representation of the requested service.
-
getObjectsRelatedToService
@RequestMapping(method=GET, value="getObjectsRelatedToService/{serviceClassName}/{serviceId}/{sessionId}", produces="application/json") public List<BusinessObjectLight> getObjectsRelatedToService(@PathVariable("serviceClassName") String serviceClassName, @PathVariable("serviceId") String serviceId, @PathVariable("sessionId") String sessionId)
Retrieves the objects related to service.- Specified by:
getObjectsRelatedToService
in interfaceServiceRestOpenApi
- Parameters:
serviceClassName
- The service class name.serviceId
- The service id.sessionId
- The session token id.- Returns:
- A list of objects related to service.
-
relateObjectToService
@RequestMapping(method=PUT, value="relateObjectToService/{objectClassName}/{objectId}/{serviceClassName}/{serviceId}/{userName}/{sessionId}", produces="application/json") public void relateObjectToService(@PathVariable("objectClassName") String objectClassName, @PathVariable("objectId") String objectId, @PathVariable("serviceClassName") String serviceClassName, @PathVariable("serviceId") String serviceId, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Relates an inventory object (resource) to a service.- Specified by:
relateObjectToService
in interfaceServiceRestOpenApi
- Parameters:
objectClassName
- The class name of the object.objectId
- The id of the object.serviceClassName
- The class name of the service.serviceId
- The id of the service.userName
- The user name of the session.sessionId
- The session token id.
-
relateObjectsToService
@RequestMapping(method=PUT, value="relateObjectsToService/{objectsClassNames}/{objectsIds}/{serviceClassName}/{serviceId}/{userName}/{sessionId}", produces="application/json") public void relateObjectsToService(@PathVariable("objectsClassNames") String[] objectsClassNames, @PathVariable("objectsIds") String[] objectsIds, @PathVariable("serviceClassName") String serviceClassName, @PathVariable("serviceId") String serviceId, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Relates inventory objects (resources) to a service.- Specified by:
relateObjectsToService
in interfaceServiceRestOpenApi
- Parameters:
objectsClassNames
- The class names of the objects.objectsIds
- The ids of the objects.serviceClassName
- The class name of the service.serviceId
- The id of the service.userName
- The user name of the session.sessionId
- The session token id.
-
releaseObjectFromService
@RequestMapping(method=PUT, value="releaseObjectFromService/{serviceClassName}/{serviceId}/{objectId}/{userName}/{sessionId}", produces="application/json") public void releaseObjectFromService(@PathVariable("serviceClassName") String serviceClassName, @PathVariable("serviceId") String serviceId, @PathVariable("objectId") String objectId, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Releases an inventory object from a service.- Specified by:
releaseObjectFromService
in interfaceServiceRestOpenApi
- Parameters:
serviceClassName
- The class name of the service.serviceId
- The id of the service.objectId
- The id of the object.userName
- The user name of the session.sessionId
- The session token id.
-
-