Class HostManagerClient
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.itinfrastructure.client.AssetManagerClient
-
- org.odpi.openmetadata.accessservices.itinfrastructure.client.HostManagerClient
-
- All Implemented Interfaces:
HostManagerInterface
public class HostManagerClient extends AssetManagerClient implements HostManagerInterface
HostManagerClient supports the APIs to maintain hosts and their related objects.
-
-
Constructor Summary
Constructors Constructor Description HostManagerClient(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.HostManagerClient(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.HostManagerClient(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.HostManagerClient(String serverName, String serverPlatformURLRoot, ITInfrastructureRESTClient restClient, int maxPageSize)Create a new client that is going to be used in an OMAG Server.HostManagerClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearClusterMember(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String clusterMemberGUID)Remove a relationship between a host and an cluster member host.voidclearHostedHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String hostedHostGUID)Remove a relationship between a host and a hosted host.StringcreateHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, boolean infrastructureManagerIsHome, HostProperties hostProperties)Create a new metadata element to represent a host.StringcreateHostFromTemplate(String userId, String infrastructureManagerGUID, String infrastructureManagerName, boolean infrastructureManagerIsHome, String templateGUID, TemplateProperties templateProperties)Create a new metadata element to represent a host using an existing metadata element as a template.List<HostElement>findHosts(String userId, String searchString, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of host metadata elements that contain the search string.List<HostElement>getClusterMembersForHost(String userId, String hostGUID, Date effectiveTime, int startFrom, int pageSize)Return the list of cluster members associated with a host.HostElementgetHostByGUID(String userId, String guid)Retrieve the host metadata element with the supplied unique identifier.List<HostElement>getHostedHosts(String userId, String supportingHostGUID, Date effectiveTime, int startFrom, int pageSize)Return the list of hosts hosted by another host.List<HostElement>getHostsByName(String userId, String name, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of host metadata elements with a matching qualified or display name.List<HostElement>getHostsForInfrastructureManager(String userId, String infrastructureManagerGUID, String infrastructureManagerName, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of hosts created by this caller.voidpublishHost(String userId, String hostGUID)Update the zones for the host asset so that it becomes visible to consumers.voidremoveHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID)Remove the metadata element representing a host.voidsetupClusterMember(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String clusterMemberGUID)Create a relationship between a host and an cluster member host.voidsetupHostedHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String hostedHostGUID)Create a relationship between a host and a hosted host.voidupdateHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, boolean isMergeUpdate, HostProperties hostProperties)Update the metadata element representing a host.voidwithdrawHost(String userId, String hostGUID)Update the zones for the host asset so that it is no longer visible to consumers.-
Methods inherited from class org.odpi.openmetadata.accessservices.itinfrastructure.client.AssetManagerClient
clearRelatedAsset, createAsset, createAssetFromTemplate, findAssets, getAssetByGUID, getAssetsByName, getAssetsForInfrastructureManager, getRelatedAssets, publishAsset, removeAsset, setupRelatedAsset, updateAsset, withdrawAsset
-
-
-
-
Constructor Detail
-
HostManagerClient
public HostManagerClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
HostManagerClient
public HostManagerClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servers- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
HostManagerClient
public HostManagerClient(String serverName, String serverPlatformURLRoot, String userId, String password) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
HostManagerClient
public HostManagerClient(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requestsauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
HostManagerClient
public HostManagerClient(String serverName, String serverPlatformURLRoot, ITInfrastructureRESTClient restClient, int maxPageSize) throws InvalidParameterException
Create a new client that is going to be used in an OMAG Server.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- client that issues the REST API callsmaxPageSize- maximum number of results supported by this server- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Detail
-
createHost
public String createHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, boolean infrastructureManagerIsHome, HostProperties hostProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new metadata element to represent a host.- Specified by:
createHostin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerinfrastructureManagerIsHome- should the host be marked as owned by the infrastructure manager so others can not update?hostProperties- properties to store- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
createHostFromTemplate
public String createHostFromTemplate(String userId, String infrastructureManagerGUID, String infrastructureManagerName, boolean infrastructureManagerIsHome, String templateGUID, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new metadata element to represent a host using an existing metadata element as a template.- Specified by:
createHostFromTemplatein interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerinfrastructureManagerIsHome- should the host be marked as owned by the infrastructure manager so others can not update?templateGUID- unique identifier of the metadata element to copytemplateProperties- properties that override the template- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
updateHost
public void updateHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, boolean isMergeUpdate, HostProperties hostProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the metadata element representing a host.- Specified by:
updateHostin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerhostGUID- unique identifier of the metadata element to updateisMergeUpdate- are unspecified properties unchanged (true) or removed?hostProperties- new properties for this element- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setupHostedHost
public void setupHostedHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String hostedHostGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a relationship between a host and a hosted host.- Specified by:
setupHostedHostin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerhostGUID- unique identifier of the hosthostedHostGUID- unique identifier of the hosted host- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
clearHostedHost
public void clearHostedHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String hostedHostGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove a relationship between a host and a hosted host.- Specified by:
clearHostedHostin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerhostGUID- unique identifier of the hosthostedHostGUID- unique identifier of the hosted host- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setupClusterMember
public void setupClusterMember(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String clusterMemberGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a relationship between a host and an cluster member host.- Specified by:
setupClusterMemberin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerhostGUID- unique identifier of the hostclusterMemberGUID- unique identifier of the cluster member host- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
clearClusterMember
public void clearClusterMember(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID, String clusterMemberGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove a relationship between a host and an cluster member host.- Specified by:
clearClusterMemberin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerhostGUID- unique identifier of the hostclusterMemberGUID- unique identifier of the cluster member host- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
publishHost
public void publishHost(String userId, String hostGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the zones for the host asset so that it becomes visible to consumers. (The zones are set to the list of zones in the publishedZones option configured for each instance of the IT Infrastructure OMAS).- Specified by:
publishHostin interfaceHostManagerInterface- Parameters:
userId- calling userhostGUID- unique identifier of the metadata element to publish- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
withdrawHost
public void withdrawHost(String userId, String hostGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the zones for the host asset so that it is no longer visible to consumers. (The zones are set to the list of zones in the defaultZones option configured for each instance of the IT Infrastructure OMAS. This is the setting when the host is first created).- Specified by:
withdrawHostin interfaceHostManagerInterface- Parameters:
userId- calling userhostGUID- unique identifier of the metadata element to withdraw- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
removeHost
public void removeHost(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String hostGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the metadata element representing a host.- Specified by:
removeHostin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerhostGUID- unique identifier of the metadata element to remove- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
findHosts
public List<HostElement> findHosts(String userId, String searchString, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of host metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findHostsin interfaceHostManagerInterface- Parameters:
userId- calling usersearchString- string to find in the propertieseffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getHostsByName
public List<HostElement> getHostsByName(String userId, String name, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of host metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getHostsByNamein interfaceHostManagerInterface- Parameters:
userId- calling username- name to search foreffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getHostsForInfrastructureManager
public List<HostElement> getHostsForInfrastructureManager(String userId, String infrastructureManagerGUID, String infrastructureManagerName, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of hosts created by this caller.- Specified by:
getHostsForInfrastructureManagerin interfaceHostManagerInterface- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managereffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getHostByGUID
public HostElement getHostByGUID(String userId, String guid) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the host metadata element with the supplied unique identifier.- Specified by:
getHostByGUIDin interfaceHostManagerInterface- Parameters:
userId- calling userguid- unique identifier of the requested metadata element- Returns:
- matching metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getHostedHosts
public List<HostElement> getHostedHosts(String userId, String supportingHostGUID, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return the list of hosts hosted by another host.- Specified by:
getHostedHostsin interfaceHostManagerInterface- Parameters:
userId- calling usersupportingHostGUID- unique identifier of the host to queryeffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getClusterMembersForHost
public List<HostElement> getClusterMembersForHost(String userId, String hostGUID, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return the list of cluster members associated with a host.- Specified by:
getClusterMembersForHostin interfaceHostManagerInterface- Parameters:
userId- calling userhostGUID- unique identifier of the host to queryeffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
-