Class TemplateManagerResource
java.lang.Object
org.odpi.openmetadata.viewservices.templatemanager.server.spring.TemplateManagerResource
@RestController
@RequestMapping("/servers/{serverName}/api/open-metadata/template-manager")
public class TemplateManagerResource
extends Object
The TemplateManagerResource provides part of the server-side implementation of the Template Manager OMVS.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionarchiveMetadataElementInStore
(String serverName, String metadataElementGUID, ArchiveRequestBody requestBody) Archive a specific metadata element.classifyMetadataElementInStore
(String serverName, String metadataElementGUID, String classificationName, NewClassificationRequestBody requestBody) Add a new classification to the metadata element.createMetadataElementFromTemplate
(String serverName, TemplateRequestBody requestBody) Create a new metadata element in the metadata store using a template.createMetadataElementInStore
(String serverName, NewOpenMetadataElementRequestBody requestBody) Create a new metadata element in the metadata store.createRelatedElementsInStore
(String serverName, NewRelatedElementsRequestBody requestBody) Create a relationship between two metadata elements.declassifyMetadataElementInStore
(String serverName, String metadataElementGUID, String classificationName, UpdateRequestBody requestBody) Remove the named classification from a specific metadata element.deleteMetadataElementInStore
(String serverName, String metadataElementGUID, UpdateRequestBody requestBody) Delete a specific metadata element.deleteRelatedElementsInStore
(String serverName, String relationshipGUID, UpdateRequestBody requestBody) Delete a relationship between two metadata elements.reclassifyMetadataElementInStore
(String serverName, String metadataElementGUID, String classificationName, UpdatePropertiesRequestBody requestBody) Update the properties of a classification that is currently attached to a specific metadata element.updateClassificationEffectivityInStore
(String serverName, String metadataElementGUID, String classificationName, UpdateEffectivityDatesRequestBody requestBody) Update the effectivity dates of a specific classification attached to a metadata element.updateMetadataElementEffectivityInStore
(String serverName, String metadataElementGUID, UpdateEffectivityDatesRequestBody requestBody) Update the effectivity dates control the visibility of the element through specific APIs.updateMetadataElementInStore
(String serverName, String metadataElementGUID, UpdatePropertiesRequestBody requestBody) Update the properties of a specific metadata element.updateMetadataElementStatusInStore
(String serverName, String metadataElementGUID, UpdateStatusRequestBody requestBody) Update the status of specific metadata element.updateRelatedElementsEffectivityInStore
(String serverName, String relationshipGUID, UpdateEffectivityDatesRequestBody requestBody) Update the effectivity dates of a specific relationship between metadata elements.updateRelatedElementsInStore
(String serverName, String relationshipGUID, UpdatePropertiesRequestBody requestBody) Update the properties associated with a relationship.
-
Constructor Details
-
TemplateManagerResource
public TemplateManagerResource()Default constructor
-
-
Method Details
-
createMetadataElementInStore
@PostMapping(path="/metadata-elements") public GUIDResponse createMetadataElementInStore(@PathVariable String serverName, @RequestBody NewOpenMetadataElementRequestBody requestBody) Create a new metadata element in the metadata store. The type name comes from the open metadata types. The selected type also controls the names and types of the properties that are allowed. This version of the method allows access to advanced features such as multiple states and effectivity dates.- Parameters:
serverName
- name of server instance to route request torequestBody
- properties for the new element- Returns:
- unique identifier of the new metadata element InvalidParameterException the type name, status or one of the properties is invalid UserNotAuthorizedException the governance action service is not authorized to create this type of element PropertyServerException there is a problem with the metadata store
-
createMetadataElementFromTemplate
@PostMapping(path="/metadata-elements/from-template") public GUIDResponse createMetadataElementFromTemplate(@PathVariable String serverName, @RequestBody TemplateRequestBody requestBody) Create a new metadata element in the metadata store using a template. The type name comes from the open metadata types. The selected type also controls the names and types of the properties that are allowed.- Parameters:
serverName
- name of server instance to route request torequestBody
- properties for the new element- Returns:
- unique identifier of the new metadata element InvalidParameterException the type name, status or one of the properties is invalid UserNotAuthorizedException the governance action service is not authorized to create this type of element PropertyServerException there is a problem with the metadata store
-
updateMetadataElementInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/update-properties") public VoidResponse updateMetadataElementInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @RequestBody UpdatePropertiesRequestBody requestBody) Update the properties of a specific metadata element. The properties must match the type definition associated with the metadata element when it was created. However, it is possible to update a few properties, or replace all them by the value used in the replaceProperties flag.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updaterequestBody
- new properties- Returns:
- void or InvalidParameterException either the unique identifier or the properties are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException there is a problem with the metadata store
-
updateMetadataElementStatusInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/update-status") public VoidResponse updateMetadataElementStatusInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @RequestBody UpdateStatusRequestBody requestBody) Update the status of specific metadata element. The new status must match a status value that is defined for the element's type assigned when it was created.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updaterequestBody
- new status values - use null to leave as is- Returns:
- void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException there is a problem with the metadata store
-
updateMetadataElementEffectivityInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/update-effectivity") public VoidResponse updateMetadataElementEffectivityInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @RequestBody UpdateEffectivityDatesRequestBody requestBody) Update the effectivity dates control the visibility of the element through specific APIs.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updaterequestBody
- new status values - use null to leave as is- Returns:
- void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException there is a problem with the metadata store
-
deleteMetadataElementInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/delete") public VoidResponse deleteMetadataElementInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @RequestBody(required=false) UpdateRequestBody requestBody) Delete a specific metadata element.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updaterequestBody
- null request body- Returns:
- void or InvalidParameterException the unique identifier is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to delete this element PropertyServerException there is a problem with the metadata store
-
archiveMetadataElementInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/archive") public VoidResponse archiveMetadataElementInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @RequestBody(required=false) ArchiveRequestBody requestBody) Archive a specific metadata element.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updaterequestBody
- null request body- Returns:
- void or InvalidParameterException the unique identifier is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to archive this element PropertyServerException there is a problem with the metadata store
-
classifyMetadataElementInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/classifications/{classificationName}") public VoidResponse classifyMetadataElementInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @PathVariable String classificationName, @RequestBody NewClassificationRequestBody requestBody) Add a new classification to the metadata element. Note that only one classification with the same name can be attached to a metadata element.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updateclassificationName
- name of the classification to add (if the classification is already present then use reclassify)requestBody
- properties to store in the new classification. These must conform to the valid properties associated with the classification name- Returns:
- void or InvalidParameterException the unique identifier or classification name is null or invalid in some way; properties do not match the valid properties associated with the classification's type definition UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException there is a problem with the metadata store
-
reclassifyMetadataElementInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/classifications/{classificationName}/update-properties") public VoidResponse reclassifyMetadataElementInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @PathVariable String classificationName, @RequestBody UpdatePropertiesRequestBody requestBody) Update the properties of a classification that is currently attached to a specific metadata element.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updateclassificationName
- unique name of the classification to updaterequestBody
- new properties for the classification- Returns:
- void or InvalidParameterException the unique identifier or classification name is null or invalid in some way; properties do not match the valid properties associated with the classification's type definition UserNotAuthorizedException the governance action service is not authorized to update this element/classification PropertyServerException there is a problem with the metadata store
-
updateClassificationEffectivityInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/classifications/{classificationName}/update-effectivity") public VoidResponse updateClassificationEffectivityInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @PathVariable String classificationName, @RequestBody UpdateEffectivityDatesRequestBody requestBody) Update the effectivity dates of a specific classification attached to a metadata element. The effectivity dates control the visibility of the classification through specific APIs.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updateclassificationName
- unique name of the classification to updaterequestBody
- the dates when this element is active / inactive - null for no restriction- Returns:
- void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException there is a problem with the metadata store
-
declassifyMetadataElementInStore
@PostMapping(path="/metadata-elements/{metadataElementGUID}/classifications/{classificationName}/delete") public VoidResponse declassifyMetadataElementInStore(@PathVariable String serverName, @PathVariable String metadataElementGUID, @PathVariable String classificationName, @RequestBody UpdateRequestBody requestBody) Remove the named classification from a specific metadata element.- Parameters:
serverName
- name of server instance to route request tometadataElementGUID
- unique identifier of the metadata element to updateclassificationName
- unique name of the classification to removerequestBody
- null request body- Returns:
- void or InvalidParameterException the unique identifier or classification name is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to remove this classification PropertyServerException there is a problem with the metadata store
-
createRelatedElementsInStore
@PostMapping(path="/related-elements") public GUIDResponse createRelatedElementsInStore(@PathVariable String serverName, @RequestBody NewRelatedElementsRequestBody requestBody) Create a relationship between two metadata elements. It is important to put the right element at each end of the relationship according to the type definition since this will affect how the relationship is interpreted.- Parameters:
serverName
- name of server instance to route request torequestBody
- the properties of the relationship- Returns:
- unique identifier of the new relationship or InvalidParameterException the unique identifier's of the metadata elements are null or invalid in some way; the properties are not valid for this type of relationship UserNotAuthorizedException the governance action service is not authorized to create this type of relationship PropertyServerException there is a problem with the metadata store
-
updateRelatedElementsInStore
@PostMapping(path="/related-elements/{relationshipGUID}/update-properties") public VoidResponse updateRelatedElementsInStore(@PathVariable String serverName, @PathVariable String relationshipGUID, @RequestBody UpdatePropertiesRequestBody requestBody) Update the properties associated with a relationship.- Parameters:
serverName
- name of server instance to route request torelationshipGUID
- unique identifier of the relationship to updaterequestBody
- new properties for the relationship- Returns:
- void or InvalidParameterException the unique identifier of the relationship is null or invalid in some way; the properties are not valid for this type of relationship UserNotAuthorizedException the governance action service is not authorized to update this relationship PropertyServerException there is a problem with the metadata store
-
updateRelatedElementsEffectivityInStore
@PostMapping(path="/related-elements/{relationshipGUID}/update-effectivity") public VoidResponse updateRelatedElementsEffectivityInStore(@PathVariable String serverName, @PathVariable String relationshipGUID, @RequestBody UpdateEffectivityDatesRequestBody requestBody) Update the effectivity dates of a specific relationship between metadata elements. The effectivity dates control the visibility of the classification through specific APIs.- Parameters:
serverName
- name of server instance to route request torelationshipGUID
- unique identifier of the relationship to updaterequestBody
- the dates when this element is active / inactive - null for no restriction- Returns:
- void or InvalidParameterException either the unique identifier or the status are invalid in some way UserNotAuthorizedException the governance action service is not authorized to update this element PropertyServerException there is a problem with the metadata store
-
deleteRelatedElementsInStore
@PostMapping(path="/related-elements/{relationshipGUID}/delete") public VoidResponse deleteRelatedElementsInStore(@PathVariable String serverName, @PathVariable String relationshipGUID, @RequestBody UpdateRequestBody requestBody) Delete a relationship between two metadata elements.- Parameters:
serverName
- name of server instance to route request torelationshipGUID
- unique identifier of the relationship to deleterequestBody
- null request body- Returns:
- void or InvalidParameterException the unique identifier of the relationship is null or invalid in some way UserNotAuthorizedException the governance action service is not authorized to delete this relationship PropertyServerException there is a problem with the metadata store
-