Class CollectionManagerResource
java.lang.Object
org.odpi.openmetadata.viewservices.collectionmanager.server.spring.CollectionManagerResource
@RestController
@RequestMapping("/servers/{serverName}/api/open-metadata/collection-manager")
public class CollectionManagerResource
extends Object
The CollectionManagerResource provides the Spring API endpoints of the Collection Manager Open Metadata View Service (OMVS).
=
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddToCollection
(String serverName, String collectionGUID, String elementGUID, CollectionMembershipProperties requestBody) Add an element to a collection.attachCollection
(String serverName, String collectionGUID, String parentGUID, boolean makeAnchor, ResourceListProperties requestBody) Connect an existing collection to an element using the ResourceList relationship (0019).createCollection
(String serverName, String classificationName, NewCollectionRequestBody requestBody) Create a new generic collection.createCollectionFromTemplate
(String serverName, TemplateRequestBody requestBody) Create a new metadata element to represent a collection using an existing metadata element as a template.createDataSpecCollection
(String serverName, NewCollectionRequestBody requestBody) Create a new collection with the DataSpec classification.createDigitalProduct
(String serverName, NewDigitalProductRequestBody requestBody) Create a new collection that represents a digital product.createFolderCollection
(String serverName, NewCollectionRequestBody requestBody) Create a new collection with the Folder classification.createRootCollection
(String serverName, NewCollectionRequestBody requestBody) Create a new collection with the RootCollection classification.deleteCollection
(String serverName, String collectionGUID, NullRequestBody requestBody) Delete a collection.detachCollection
(String serverName, String collectionGUID, String parentGUID, NullRequestBody requestBody) Detach an existing collection from an element.findCollections
(String serverName, boolean startsWith, boolean endsWith, boolean ignoreCase, int startFrom, int pageSize, FilterRequestBody requestBody) Returns the list of collections matching the search string.getAttachedCollections
(String serverName, String parentGUID, int startFrom, int pageSize, FilterRequestBody requestBody) Returns the list of collections that are linked off of the supplied element.getClassifiedCollections
(String serverName, int startFrom, int pageSize, FilterRequestBody requestBody) Returns the list of collections with a particular classification.getCollection
(String serverName, String collectionGUID) Return the properties of a specific collection.getCollectionMembers
(String serverName, String collectionGUID, int startFrom, int pageSize) Return a list of elements that are a member of a collection.getCollectionsByName
(String serverName, int startFrom, int pageSize, FilterRequestBody requestBody) Returns the list of collections with a particular name.getCollectionsByType
(String serverName, int startFrom, int pageSize, FilterRequestBody requestBody) Returns the list of collections with a particular collectionType.removeFromCollection
(String serverName, String collectionGUID, String elementGUID, NullRequestBody requestBody) Remove an element from a collection.updateCollection
(String serverName, String collectionGUID, boolean replaceAllProperties, CollectionProperties requestBody) Update the properties of a collection.updateCollectionMembership
(String serverName, String collectionGUID, String elementGUID, boolean replaceAllProperties, CollectionMembershipProperties requestBody) Update an element's membership to a collection.updateDigitalProduct
(String serverName, String collectionGUID, boolean replaceAllProperties, DigitalProductProperties requestBody) Update the properties of the DigitalProduct classification attached to a collection.
-
Constructor Details
-
CollectionManagerResource
public CollectionManagerResource()Default constructor
-
-
Method Details
-
getAttachedCollections
@PostMapping(path="/metadata-elements/{parentGUID}/collections") public CollectionsResponse getAttachedCollections(@PathVariable String serverName, @PathVariable String parentGUID, @RequestParam(required=false,defaultValue="0") int startFrom, @RequestParam(required=false,defaultValue="0") int pageSize, @RequestBody(required=false) FilterRequestBody requestBody) Returns the list of collections that are linked off of the supplied element.- Parameters:
serverName
- name of called serverparentGUID
- unique identifier of referenceable object (typically a personal profile, project or community) that the collections hang off ofstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to returnrequestBody
- filter response by collection type - if null, any value will do- Returns:
- a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
getClassifiedCollections
@PostMapping(path="/collections/by-classifications") public CollectionsResponse getClassifiedCollections(@PathVariable String serverName, @RequestParam(required=false,defaultValue="0") int startFrom, @RequestParam(required=false,defaultValue="0") int pageSize, @RequestBody(required=false) FilterRequestBody requestBody) Returns the list of collections with a particular classification.- Parameters:
serverName
- name of called serverrequestBody
- name of the classification - if null, all collections are returnedstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return- Returns:
- a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
findCollections
@PostMapping(path="/collections/by-search-string") public CollectionsResponse findCollections(@PathVariable String serverName, @RequestParam(required=false,defaultValue="false") boolean startsWith, @RequestParam(required=false,defaultValue="false") boolean endsWith, @RequestParam(required=false,defaultValue="false") boolean ignoreCase, @RequestParam(required=false,defaultValue="0") int startFrom, @RequestParam(required=false,defaultValue="0") int pageSize, @RequestBody(required=false) FilterRequestBody requestBody) Returns the list of collections matching the search string.- Parameters:
serverName
- name of the service to route the request tostartsWith
- does the value start with the supplied string?endsWith
- does the value end with the supplied string?ignoreCase
- should the search ignore case?startFrom
- paging start pointpageSize
- maximum results that can be returnedrequestBody
- string to find in the properties- Returns:
- a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
getCollectionsByName
@PostMapping(path="/collections/by-name") public CollectionsResponse getCollectionsByName(@PathVariable String serverName, @RequestParam(required=false,defaultValue="0") int startFrom, @RequestParam(required=false,defaultValue="0") int pageSize, @RequestBody FilterRequestBody requestBody) Returns the list of collections with a particular name.- Parameters:
serverName
- name of called serverrequestBody
- name of the collections to return - match is full text match in qualifiedName or namestartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return- Returns:
- a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
getCollectionsByType
@PostMapping(path="/collections/by-collection-type") public CollectionsResponse getCollectionsByType(@PathVariable String serverName, @RequestParam(required=false,defaultValue="0") int startFrom, @RequestParam(required=false,defaultValue="0") int pageSize, @RequestBody(required=false) FilterRequestBody requestBody) Returns the list of collections with a particular collectionType. This is an optional text field in the collection element.- Parameters:
serverName
- name of called serverrequestBody
- the collection type value to match on. If it is null, all collections with a null collectionType are returnedstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return- Returns:
- a list of collections InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
getCollection
@GetMapping(path="/collections/{collectionGUID}") public CollectionResponse getCollection(@PathVariable String serverName, @PathVariable String collectionGUID) Return the properties of a specific collection.- Parameters:
serverName
- name of called servercollectionGUID
- unique identifier of the required collection- Returns:
- collection properties InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
createCollection
@PostMapping(path="/collections") public GUIDResponse createCollection(@PathVariable String serverName, @RequestParam(required=false) String classificationName, @RequestBody NewCollectionRequestBody requestBody) Create a new generic collection.- Parameters:
serverName
- name of called server.classificationName
- name of collection classificationrequestBody
- properties for the collection.- Returns:
- unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
createRootCollection
@PostMapping(path="/collections/root-collection") public GUIDResponse createRootCollection(@PathVariable String serverName, @RequestBody NewCollectionRequestBody requestBody) Create a new collection with the RootCollection classification. Used to identify the top of a collection hierarchy.- Parameters:
serverName
- name of called server.requestBody
- properties for the collection.- Returns:
- unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
createDataSpecCollection
@PostMapping(path="/collections/data-spec-collection") public GUIDResponse createDataSpecCollection(@PathVariable String serverName, @RequestBody NewCollectionRequestBody requestBody) Create a new collection with the DataSpec classification. Used to identify a collection of data fields and schema types.- Parameters:
serverName
- name of called server.requestBody
- properties for the collection.- Returns:
- unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
createFolderCollection
@PostMapping(path="/collections/folder") public GUIDResponse createFolderCollection(@PathVariable String serverName, @RequestBody NewCollectionRequestBody requestBody) Create a new collection with the Folder classification. This is used to identify the organizing collections in a collection hierarchy.- Parameters:
serverName
- name of called server.requestBody
- properties for the collection.- Returns:
- unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
createCollectionFromTemplate
@PostMapping(path="/collections/from-template") public GUIDResponse createCollectionFromTemplate(@PathVariable String serverName, @RequestBody TemplateRequestBody requestBody) Create a new metadata element to represent a collection using an existing metadata element as a template. The template defines additional classifications and relationships that should be added to the new collection.- Parameters:
serverName
- calling userrequestBody
- properties that override the template- Returns:
- unique identifier of the new metadata element InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user is not authorized to issue this request PropertyServerException there is a problem reported in the open metadata server(s)
-
createDigitalProduct
@PostMapping(path="/digital-products") public GUIDResponse createDigitalProduct(@PathVariable String serverName, @RequestBody NewDigitalProductRequestBody requestBody) Create a new collection that represents a digital product.- Parameters:
serverName
- name of called server.requestBody
- properties for the collection and attached DigitalProduct classification- Returns:
- unique identifier of the newly created Collection InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
updateCollection
@PostMapping(path="/collections/{collectionGUID}/update") public VoidResponse updateCollection(@PathVariable String serverName, @PathVariable String collectionGUID, @RequestParam boolean replaceAllProperties, @RequestBody CollectionProperties requestBody) Update the properties of a collection.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection (returned from create)replaceAllProperties
- flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.requestBody
- properties for the collection.- Returns:
- void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
updateDigitalProduct
@PostMapping(path="/digital-products/{collectionGUID}/update") public VoidResponse updateDigitalProduct(@PathVariable String serverName, @PathVariable String collectionGUID, @RequestParam boolean replaceAllProperties, @RequestBody DigitalProductProperties requestBody) Update the properties of the DigitalProduct classification attached to a collection.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection (returned from create)replaceAllProperties
- flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.requestBody
- properties for the DigitalProduct classification.- Returns:
- void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
attachCollection
@PostMapping(path="/metadata-elements/{parentGUID}/collections/{collectionGUID}/attach") public VoidResponse attachCollection(@PathVariable String serverName, @PathVariable String collectionGUID, @PathVariable String parentGUID, @RequestParam boolean makeAnchor, @RequestBody ResourceListProperties requestBody) Connect an existing collection to an element using the ResourceList relationship (0019).- Parameters:
serverName
- name of called servercollectionGUID
- unique identifier of the collectionparentGUID
- unique identifier of referenceable object that the collection should be attached torequestBody
- description of how the collection will be used.makeAnchor
- like the lifecycle of the collection to that of the parent so that if the parent is deleted, so is the collection- Returns:
- void or InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
detachCollection
@PostMapping(path="/metadata-elements/{parentGUID}/collections/{collectionGUID}/detach") public VoidResponse detachCollection(@PathVariable String serverName, @PathVariable String collectionGUID, @PathVariable String parentGUID, @RequestBody(required=false) NullRequestBody requestBody) Detach an existing collection from an element. If the collection is anchored to the element, it is deleted.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection.parentGUID
- unique identifier of referenceable object that the collection should be attached to.- Returns:
- void or InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
deleteCollection
@PostMapping(path="/collections/{collectionGUID}/delete") public VoidResponse deleteCollection(@PathVariable String serverName, @PathVariable String collectionGUID, @RequestBody(required=false) NullRequestBody requestBody) Delete a collection. It is detected from all parent elements. If members are anchored to the collection then they are also deleted.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection.- Returns:
- void or InvalidParameterException one of the parameters is null or invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
getCollectionMembers
@GetMapping(path="/collections/{collectionGUID}/members") public CollectionMembersResponse getCollectionMembers(@PathVariable String serverName, @PathVariable String collectionGUID, @RequestParam(required=false,defaultValue="0") int startFrom, @RequestParam(required=false,defaultValue="0") int pageSize) Return a list of elements that are a member of a collection.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection.startFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of asset details InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem retrieving information from the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
addToCollection
@PostMapping(path="/collections/{collectionGUID}/members/{elementGUID}/attach") public VoidResponse addToCollection(@PathVariable String serverName, @PathVariable String collectionGUID, @PathVariable String elementGUID, @RequestBody(required=false) CollectionMembershipProperties requestBody) Add an element to a collection.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection.requestBody
- properties describing the membership characteristics.elementGUID
- unique identifier of the element.- Returns:
- void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem updating information in the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
updateCollectionMembership
@PostMapping(path="/collections/{collectionGUID}/members/{elementGUID}/update") public VoidResponse updateCollectionMembership(@PathVariable String serverName, @PathVariable String collectionGUID, @PathVariable String elementGUID, @RequestParam boolean replaceAllProperties, @RequestBody CollectionMembershipProperties requestBody) Update an element's membership to a collection.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection.replaceAllProperties
- flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.requestBody
- properties describing the membership characteristics.elementGUID
- unique identifier of the element.- Returns:
- void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem updating information in the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-
removeFromCollection
@PostMapping(path="/collections/{collectionGUID}/members/{elementGUID}/detach") public VoidResponse removeFromCollection(@PathVariable String serverName, @PathVariable String collectionGUID, @PathVariable String elementGUID, @RequestBody NullRequestBody requestBody) Remove an element from a collection.- Parameters:
serverName
- name of called server.collectionGUID
- unique identifier of the collection.elementGUID
- unique identifier of the element.requestBody
- null request body- Returns:
- void or InvalidParameterException one of the parameters is invalid. PropertyServerException there is a problem updating information in the property server(s). UserNotAuthorizedException the requesting user is not authorized to issue this request.
-