Class ITProfileResource
java.lang.Object
org.odpi.openmetadata.accessservices.itinfrastructure.server.spring.ITProfileResource
@RestController
@RequestMapping("/servers/{serverName}/open-metadata/access-services/it-infrastructure/users/{userId}")
public class ITProfileResource
extends Object
The ITProfileResource provides a Spring based server-side REST API
that supports the ITProfileManagerInterface. It delegates each request to the
OrganizationRESTServices. This provides the server-side implementation of the IT Infrastructure Open Metadata
Assess Service (OMAS) which is used to manage information about IT profiles and their userIds.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddContactMethod
(String serverName, String userId, String itProfileGUID, ContactMethodRequestBody requestBody) Add a new contact method to the profile.addIdentityToProfile
(String serverName, String userId, String userIdentityGUID, String profileGUID, ExternalSourceRequestBody requestBody) Link a user identity to a profile.createITProfile
(String serverName, String userId, ITProfileRequestBody requestBody) Create a definition of an IT profile.createUserIdentity
(String serverName, String userId, UserIdentityRequestBody requestBody) Create a UserIdentity.deleteContactMethod
(String serverName, String userId, String contactMethodGUID, ExternalSourceRequestBody requestBody) Remove an obsolete contact method from the profile.deleteITProfile
(String serverName, String userId, String itProfileGUID, ExternalSourceRequestBody requestBody) Remove the definition of an IT profile.deleteUserIdentity
(String serverName, String userId, String userIdentityGUID, ExternalSourceRequestBody requestBody) Remove a user identity object.findITProfile
(String serverName, String userId, int startFrom, int pageSize, SearchStringRequestBody requestBody) Retrieve the list of matching profiles for the search string.findUserIdentities
(String serverName, String userId, int startFrom, int pageSize, SearchStringRequestBody requestBody) Retrieve the list of user identity metadata elements that contain the search string.getITProfileByGUID
(String serverName, String userId, String itProfileGUID) Return information about a specific IT profile.getITProfileByName
(String serverName, String userId, int startFrom, int pageSize, NameRequestBody requestBody) Return information about a named IT profile.getITProfileByUserId
(String serverName, String userId, String itProfileUserId) Return information about a specific IT profile.getUserIdentitiesByName
(String serverName, String userId, int startFrom, int pageSize, NameRequestBody requestBody) Retrieve the list of user identity metadata elements with a matching qualified name.getUserIdentityByGUID
(String serverName, String userId, String userIdentityGUID) Retrieve the userIdentity metadata element with the supplied unique identifier.removeIdentityFromProfile
(String serverName, String userId, String userIdentityGUID, String profileGUID, ExternalSourceRequestBody requestBody) Remove a user identity object.updateITProfile
(String serverName, String userId, String itProfileGUID, boolean isMergeUpdate, ITProfileRequestBody requestBody) Update the definition of an IT profile.updateUserIdentity
(String serverName, String userId, String userIdentityGUID, boolean isMergeUpdate, UserIdentityRequestBody requestBody) Update a UserIdentity.
-
Constructor Details
-
ITProfileResource
public ITProfileResource()Default constructor
-
-
Method Details
-
createITProfile
@PostMapping(path="/profiles") public GUIDResponse createITProfile(@PathVariable String serverName, @PathVariable String userId, @RequestBody ITProfileRequestBody requestBody) Create a definition of an IT profile.- Parameters:
serverName
- called serveruserId
- calling userrequestBody
- properties for an IT profile- Returns:
- unique identifier of IT profile InvalidParameterException qualifiedName or userId is null; qualifiedName is not unique PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
updateITProfile
@PostMapping(path="/profiles/{itProfileGUID}") public VoidResponse updateITProfile(@PathVariable String serverName, @PathVariable String userId, @PathVariable String itProfileGUID, @RequestParam boolean isMergeUpdate, @RequestBody ITProfileRequestBody requestBody) Update the definition of an IT profile.- Parameters:
serverName
- called serveruserId
- calling useritProfileGUID
- unique identifier of IT profileisMergeUpdate
- are unspecified properties unchanged (true) or replaced with null?requestBody
- properties to change- Returns:
- void or InvalidParameterException guid, qualifiedName or userId is null; qualifiedName is not unique; guid is not known PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
deleteITProfile
@PostMapping(path="/profiles/{itProfileGUID}/delete") public VoidResponse deleteITProfile(@PathVariable String serverName, @PathVariable String userId, @PathVariable String itProfileGUID, @RequestBody ExternalSourceRequestBody requestBody) Remove the definition of an IT profile.- Parameters:
serverName
- called serveruserId
- calling useritProfileGUID
- unique identifier of IT profilerequestBody
- identifiers of the software server capability entity that represented the external source - null for local- Returns:
- void or InvalidParameterException guid or userId is null; guid is not known PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
addContactMethod
@PostMapping(path="/profiles/{itProfileGUID}/contact-methods") public GUIDResponse addContactMethod(@PathVariable String serverName, @PathVariable String userId, @PathVariable String itProfileGUID, @RequestBody ContactMethodRequestBody requestBody) Add a new contact method to the profile.- Parameters:
serverName
- called serveruserId
- the name of the calling user.itProfileGUID
- identifier of the profile to update.requestBody
- properties of contact method.- Returns:
- unique identifier (guid) for the new contact method. InvalidParameterException the userId is null or invalid. Another property 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.
-
deleteContactMethod
@PostMapping(path="/profiles/contact-methods/{contactMethodGUID}/delete") public VoidResponse deleteContactMethod(@PathVariable String serverName, @PathVariable String userId, @PathVariable String contactMethodGUID, @RequestBody ExternalSourceRequestBody requestBody) Remove an obsolete contact method from the profile.- Parameters:
serverName
- called serveruserId
- the name of the calling user.contactMethodGUID
- unique identifier (guid) for the obsolete contact method.requestBody
- identifiers of the software server capability entity that represented the external source - null for local- Returns:
- void or InvalidParameterException the userId is null or invalid. Another property 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.
-
getITProfileByGUID
@GetMapping(path="/profiles/{itProfileGUID}") public ITProfileResponse getITProfileByGUID(@PathVariable String serverName, @PathVariable String userId, @PathVariable String itProfileGUID) Return information about a specific IT profile.- Parameters:
serverName
- called serveruserId
- calling useritProfileGUID
- unique identifier for the IT profile- Returns:
- properties of the IT profile InvalidParameterException itProfileGUID or userId is null PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
getITProfileByUserId
@GetMapping(path="/profiles/user-ids/{itProfileUserId}") public ITProfileResponse getITProfileByUserId(@PathVariable String serverName, @PathVariable String userId, @PathVariable String itProfileUserId) Return information about a specific IT profile.- Parameters:
serverName
- called serveruserId
- calling useritProfileUserId
- unique identifier for the IT profile- Returns:
- properties of the IT profile InvalidParameterException itProfileUserId or userId is null PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
getITProfileByName
@PostMapping(path="/profiles/by-name") public ITProfilesResponse getITProfileByName(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize, @RequestBody NameRequestBody requestBody) Return information about a named IT profile.- Parameters:
serverName
- called serveruserId
- calling userstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.requestBody
- unique name for the IT profile- Returns:
- list of matching IT profiles (hopefully only one) InvalidParameterException name or userId is null PropertyServerException problem accessing property server UserNotAuthorizedException security access problem
-
findITProfile
@PostMapping(path="/profiles/by-search-string") public ITProfilesResponse findITProfile(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize, @RequestBody SearchStringRequestBody requestBody) Retrieve the list of matching profiles for the search string.- Parameters:
serverName
- called serveruserId
- the name of the calling user.requestBody
- RegEx string to search forstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of matching IT profiles InvalidParameterException guid invalid or the external references are not correctly specified, or are null. PropertyServerException the server is not available. UserNotAuthorizedException the calling user is not authorized to issue the call.
-
createUserIdentity
@PostMapping(path="/user-identities") public GUIDResponse createUserIdentity(@PathVariable String serverName, @PathVariable String userId, @RequestBody UserIdentityRequestBody requestBody) Create a UserIdentity. This is not connected to a profile.- Parameters:
serverName
- name of target serveruserId
- the name of the calling user.requestBody
- userId for the new userIdentity.- Returns:
- guid or InvalidParameterException - one of the parameters is invalid or PropertyServerException - there is a problem retrieving information from the property server(s) or UserNotAuthorizedException - the requesting user is not authorized to issue this request.
-
updateUserIdentity
@PostMapping(path="/user-identities/{userIdentityGUID}") public VoidResponse updateUserIdentity(@PathVariable String serverName, @PathVariable String userId, @PathVariable String userIdentityGUID, @RequestParam boolean isMergeUpdate, @RequestBody UserIdentityRequestBody requestBody) Update a UserIdentity.- Parameters:
serverName
- name of target serveruserId
- the name of the calling useruserIdentityGUID
- unique identifier of the UserIdentityisMergeUpdate
- should the supplied properties be overlaid on the existing properties (true) or replace them (falserequestBody
- updated properties for the new userIdentity- 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.
-
deleteUserIdentity
@PostMapping(path="/user-identities/{userIdentityGUID}/delete") public VoidResponse deleteUserIdentity(@PathVariable String serverName, @PathVariable String userId, @PathVariable String userIdentityGUID, @RequestBody ExternalSourceRequestBody requestBody) Remove a user identity object. This will fail if a profile would be left without an associated user identity.- Parameters:
serverName
- name of target serveruserId
- the name of the calling user.userIdentityGUID
- unique identifier of the UserIdentityrequestBody
- external source identifiers- Returns:
- void or InvalidParameterException - one of the parameters is invalid or PropertyServerException - there is a problem retrieving information from the property server(s) or UserNotAuthorizedException - the requesting user is not authorized to issue this request.
-
addIdentityToProfile
@PostMapping(path="/user-identities/{userIdentityGUID}/profiles/{profileGUID}/link") public VoidResponse addIdentityToProfile(@PathVariable String serverName, @PathVariable String userId, @PathVariable String userIdentityGUID, @PathVariable String profileGUID, @RequestBody ExternalSourceRequestBody requestBody) Link a user identity to a profile. This will fail if the user identity is already connected to a profile.- Parameters:
serverName
- name of target serveruserId
- the name of the calling user.userIdentityGUID
- unique identifier of the UserIdentityprofileGUID
- the profile to add the identity to.requestBody
- external source identifiers- Returns:
- void or InvalidParameterException - one of the parameters is invalid or PropertyServerException - there is a problem retrieving information from the property server(s) or UserNotAuthorizedException - the requesting user is not authorized to issue this request.
-
removeIdentityFromProfile
@PostMapping(path="/user-identities/{userIdentityGUID}/profiles/{profileGUID}/unlink") public VoidResponse removeIdentityFromProfile(@PathVariable String serverName, @PathVariable String userId, @PathVariable String userIdentityGUID, @PathVariable String profileGUID, @RequestBody ExternalSourceRequestBody requestBody) Remove a user identity object. This will fail if the profile would be left without an associated user identity.- Parameters:
serverName
- name of target serveruserId
- the name of the calling user.userIdentityGUID
- unique identifier of the UserIdentityprofileGUID
- the profile to add the identity to.requestBody
- external source identifiers- Returns:
- void or InvalidParameterException - one of the parameters is invalid or PropertyServerException - there is a problem retrieving information from the property server(s) or UserNotAuthorizedException - the requesting user is not authorized to issue this request.
-
findUserIdentities
@PostMapping(path="/user-identities/by-search-string") public UserIdentitiesResponse findUserIdentities(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize, @RequestBody SearchStringRequestBody requestBody) Retrieve the list of user identity metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
serverName
- name of target serveruserId
- calling userstartFrom
- paging start pointpageSize
- maximum results that can be returnedrequestBody
- string to find in the properties- Returns:
- list of matching metadata elements or 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)
-
getUserIdentitiesByName
@PostMapping(path="/user-identities/by-name") public UserIdentitiesResponse getUserIdentitiesByName(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize, @RequestBody NameRequestBody requestBody) Retrieve the list of user identity metadata elements with a matching qualified name. There are no wildcards supported on this request.- Parameters:
serverName
- name of target serveruserId
- calling userstartFrom
- paging start pointpageSize
- maximum results that can be returnedrequestBody
- name to search for- Returns:
- list of matching metadata elements 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)
-
getUserIdentityByGUID
@GetMapping(path="/user-identities/{userIdentityGUID}") public UserIdentityResponse getUserIdentityByGUID(@PathVariable String serverName, @PathVariable String userId, @PathVariable String userIdentityGUID) Retrieve the userIdentity metadata element with the supplied unique identifier.- Parameters:
serverName
- name of target serveruserId
- calling useruserIdentityGUID
- unique identifier of the requested metadata element- Returns:
- matching metadata element or 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)
-