Class SoftwareRestController
- java.lang.Object
-
- org.neotropic.kuwaiba.northbound.rest.services.SoftwareRestController
-
- All Implemented Interfaces:
SoftwareRestOpenApi
@RestController @RequestMapping("/v2.1.1/software-manager/") public class SoftwareRestController extends Object implements SoftwareRestOpenApi
Software Manager Rest Controller.- Author:
- Mauricio Ruiz Beltrán <mauricio.ruiz@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description SoftwareRestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createLicense(String poolId, String licenseClassName, String licenseName, String licenseProduct, String userName, String sessionId)
Creates a license.String
createLicensePool(String poolName, String poolDescription, String poolClassName, String userName, String sessionId)
Creates a license pool.void
deleteLicense(String licenseClassName, String licenseId, String userName, String sessionId)
Deletes a license and delete its association with the related inventory objects.void
deleteLicensePool(String poolId, String poolClassName, String userName, String sessionId)
Deletes a license pool.List<BusinessObjectLight>
getAllLicenses(String sessionId)
Retrieves the licenses list.List<ClassMetadataLight>
getAllLicenseTypes(String sessionId)
Gets all available license type, which are basically the non-abstract subclasses ofGenericSoftwareAsset
.List<BusinessObjectLight>
getAllProducts(String sessionId)
Gets all available products.BusinessObject
getLicense(String licenseClassName, String licenseId, String sessionId)
Get license properties.InventoryObjectPool
getLicensePool(String poolId, String poolClassName, String sessionId)
Gets the license pool properties.List<InventoryObjectPool>
getLicensePools(String sessionId)
Retrieves the license pools list.List<BusinessObjectLight>
getLicensesInPool(String poolId, int limit, String sessionId)
Gets the licenses inside a license pool.void
relateObjectToLicense(String licenseClassName, String licenseId, String objectClassName, String objectId, String sessionId)
Relates an object or a set of objects to an existing software or hardware license.void
releaseLicense(String licenseClassName, String licenseId, String sessionId)
Releases all the relationships with the given names associated to the license provided.void
releaseRelationship(String sourceObjectClassName, String sourceObjectId, String targetObjectId, String sessionId)
Releases an object from another object whose relationship is "licenseHas".
-
-
-
Field Detail
-
PATH
public static final String PATH
Path that includes the Kuwaiba version and module- See Also:
- Constant Field Values
-
-
Method Detail
-
createLicensePool
@RequestMapping(method=POST, value="createLicensePool/{poolName}/{poolDescription}/{poolClassName}/{userName}/{sessionId}", produces="application/json") public String createLicensePool(@PathVariable("poolName") String poolName, @PathVariable("poolDescription") String poolDescription, @PathVariable("poolClassName") String poolClassName, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Creates a license pool.- Specified by:
createLicensePool
in interfaceSoftwareRestOpenApi
- Parameters:
poolName
- The pool name. Must be subclass of GenericSoftwareAsset.poolDescription
- The pool description.poolClassName
- The pool class name. What kind of objects can this pool contain?userName
- The user name of the session.sessionId
- The session token id.- Returns:
- The id of the newly created license pool.
-
createLicense
@RequestMapping(method=POST, value="createLicense/{poolId}/{licenseClassName}/{licenseName}/{licenseProduct}/{userName}/{sessionId}", produces="application/json") public String createLicense(@PathVariable("poolId") String poolId, @PathVariable("licenseClassName") String licenseClassName, @PathVariable("licenseName") String licenseName, @PathVariable("licenseProduct") String licenseProduct, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Creates a license.- Specified by:
createLicense
in interfaceSoftwareRestOpenApi
- Parameters:
poolId
- The parent pool id.licenseClassName
- The class name of the license to be created (temporarily).licenseName
- The license name.licenseProduct
- The license product.userName
- The user name of the session.sessionId
- The session token id.- Returns:
- The id of the newly created license.
-
deleteLicensePool
@RequestMapping(method=DELETE, value="deleteLicensePool/{poolId}/{poolClassName}/{userName}/{sessionId}", produces="application/json") public void deleteLicensePool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Deletes a license pool.- Specified by:
deleteLicensePool
in interfaceSoftwareRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.userName
- The user name of the session.sessionId
- The session token id.
-
deleteLicense
@RequestMapping(method=DELETE, value="deleteLicense/{licenseClassName}/{licenseId}/{userName}/{sessionId}", produces="application/json") public void deleteLicense(@PathVariable("licenseClassName") String licenseClassName, @PathVariable("licenseId") String licenseId, @PathVariable("userName") String userName, @PathVariable("sessionId") String sessionId)
Deletes a license and delete its association with the related inventory objects. These objects will remain untouched.- Specified by:
deleteLicense
in interfaceSoftwareRestOpenApi
- Parameters:
licenseClassName
- The license class name.licenseId
- The license id.userName
- The user name of the session.sessionId
- The session token id.
-
getLicensePools
@RequestMapping(method=GET, value="getLicensePools/{sessionId}", produces="application/json") public List<InventoryObjectPool> getLicensePools(@PathVariable("sessionId") String sessionId)
Retrieves the license pools list.- Specified by:
getLicensePools
in interfaceSoftwareRestOpenApi
- Parameters:
sessionId
- The session token id.- Returns:
- The available license pools.
-
getLicensePool
@RequestMapping(method=GET, value="getLicensePool/{poolId}/{poolClassName}/{sessionId}", produces="application/json") public InventoryObjectPool getLicensePool(@PathVariable("poolId") String poolId, @PathVariable("poolClassName") String poolClassName, @PathVariable("sessionId") String sessionId)
Gets the license pool properties.- Specified by:
getLicensePool
in interfaceSoftwareRestOpenApi
- Parameters:
poolId
- The pool id.poolClassName
- The pool class name.sessionId
- The session token id.- Returns:
- The pool properties.
-
getAllLicenses
@RequestMapping(method=GET, value="getAllLicenses/{sessionId}", produces="application/json") public List<BusinessObjectLight> getAllLicenses(@PathVariable("sessionId") String sessionId)
Retrieves the licenses list.- Specified by:
getAllLicenses
in interfaceSoftwareRestOpenApi
- Parameters:
sessionId
- The session token id.- Returns:
- The available licenses.
-
getLicensesInPool
@RequestMapping(method=GET, value="getLicensesInPool/{poolId}/{limit}/{sessionId}", produces="application/json") public List<BusinessObjectLight> getLicensesInPool(@PathVariable("poolId") String poolId, @PathVariable("limit") int limit, @PathVariable("sessionId") String sessionId)
Gets the licenses inside a license pool.- Specified by:
getLicensesInPool
in interfaceSoftwareRestOpenApi
- Parameters:
poolId
- The pool id.limit
- The results limit per page. Use -1 to retrieve all.sessionId
- The session token id.- Returns:
- The licenses list.
-
getLicense
@RequestMapping(method=GET, value="getLicense/{licenseClassName}/{licenseId}/{sessionId}", produces="application/json") public BusinessObject getLicense(@PathVariable("licenseClassName") String licenseClassName, @PathVariable("licenseId") String licenseId, @PathVariable("sessionId") String sessionId)
Get license properties.- Specified by:
getLicense
in interfaceSoftwareRestOpenApi
- Parameters:
licenseClassName
- The license class name. Must be subclass of GenericSoftwareAsset.licenseId
- The license id.sessionId
- The session token id.- Returns:
- The license properties.
-
getAllLicenseTypes
@RequestMapping(method=GET, value="getAllLicenseTypes/{sessionId}", produces="application/json") public List<ClassMetadataLight> getAllLicenseTypes(@PathVariable("sessionId") String sessionId)
Gets all available license type, which are basically the non-abstract subclasses ofGenericSoftwareAsset
.- Specified by:
getAllLicenseTypes
in interfaceSoftwareRestOpenApi
- Parameters:
sessionId
- The session token id.- Returns:
- The list of available license types.
-
getAllProducts
@RequestMapping(method=GET, value="getAllProducts/{sessionId}", produces="application/json") public List<BusinessObjectLight> getAllProducts(@PathVariable("sessionId") String sessionId)
Gets all available products.- Specified by:
getAllProducts
in interfaceSoftwareRestOpenApi
- Parameters:
sessionId
- The session token id.- Returns:
- The list of available products.
-
relateObjectToLicense
@RequestMapping(method=PUT, value="relateObjectToLicense/{licenseClassName}/{licenseId}/{objectClassName}/{objectId}/{sessionId}", produces="application/json") public void relateObjectToLicense(@PathVariable("licenseClassName") String licenseClassName, @PathVariable("licenseId") String licenseId, @PathVariable("objectClassName") String objectClassName, @PathVariable("objectId") String objectId, @PathVariable("sessionId") String sessionId)
Relates an object or a set of objects to an existing software or hardware license.- Specified by:
relateObjectToLicense
in interfaceSoftwareRestOpenApi
- Parameters:
licenseClassName
- The class name of the license.licenseId
- The id of the license.objectClassName
- The class name of the object.objectId
- The id of the object.sessionId
- The session token id.
-
releaseRelationship
@RequestMapping(method=PUT, value="releaseRelationship/{sourceObjectClassName}/{sourceObjectId}/{targetObjectId}/{sessionId}", produces="application/json") public void releaseRelationship(@PathVariable("sourceObjectClassName") String sourceObjectClassName, @PathVariable("sourceObjectId") String sourceObjectId, @PathVariable("targetObjectId") String targetObjectId, @PathVariable("sessionId") String sessionId)
Releases an object from another object whose relationship is "licenseHas".- Specified by:
releaseRelationship
in interfaceSoftwareRestOpenApi
- Parameters:
sourceObjectClassName
- The source object class name.sourceObjectId
- The source object id.targetObjectId
- The target object id. The object we want to be released from.sessionId
- The session token id.
-
releaseLicense
@RequestMapping(method=PUT, value="releaseLicense/{licenseClassName}/{licenseId}/{sessionId}", produces="application/json") public void releaseLicense(@PathVariable("licenseClassName") String licenseClassName, @PathVariable("licenseId") String licenseId, @PathVariable("sessionId") String sessionId)
Releases all the relationships with the given names associated to the license provided.- Specified by:
releaseLicense
in interfaceSoftwareRestOpenApi
- Parameters:
licenseClassName
- The license class name.licenseId
- The license id.sessionId
- The session token id.
-
-