Package com.carfey.ops.api.embedded
Class HostManager
- java.lang.Object
-
- com.carfey.ops.api.embedded.AbstractAPIManager
-
- com.carfey.ops.api.embedded.HostManager
-
public class HostManager extends AbstractAPIManager
Class to manage hosts (i.e. nodes) using the Obsidian public embedded API. SeeAbstractAPIManagerfor details on how transactions are managed within all requests.Example:
HostDetail host = new HostManager().getHost("obsidianHost"); System.out.println("Host status: " + host);- Since:
- 2.3
- See Also:
- Embedded API Wiki, REST API Wiki, Carfey Date
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
AbstractAPIManager.ActionCallable
-
-
Constructor Summary
Constructors Constructor Description HostManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HostDetailgetHealth(long hostId)Loads the health for a known scheduling host.HostDetailgetHealth(java.lang.String hostName)Loads the health for a known scheduling host.HostDetailgetHost(long hostId)Loads a known scheduling host.HostDetailgetHost(java.lang.String hostName)Loads a known scheduling host.HostDetailgetLicenceHealth(long hostId)Loads the licence health for a known scheduling host.HostDetailgetLicenceHealth(java.lang.String hostName)Loads the licence health for a known scheduling host.EventHookListinglistEventHooksByHost()EventHookListinglistEventHooksByHost(long hostId)EventHookListinglistEventHooksByHost(java.lang.String hostName)HostListinglistHosts()Lists all known scheduling hosts.EventHookListingupdateEventHook(UpdateEventHookRequest request, java.lang.String auditUser)HostDetailupdateHost(long hostId, HostUpdateRequest request, java.lang.String auditUser)Updates a known scheduling host's enabled status.HostDetailupdateHost(java.lang.String hostName, HostUpdateRequest request, java.lang.String auditUser)Updates a known scheduling host's enabled status.-
Methods inherited from class com.carfey.ops.api.embedded.AbstractAPIManager
addParameter, runApiTarget, validateRequired, withTransaction
-
-
-
-
Method Detail
-
listEventHooksByHost
public EventHookListing listEventHooksByHost() throws java.lang.Exception
- Returns:
- the
EventHookListingfor all event hooks on all hosts and their status - Throws:
java.lang.Exception- any type of unexpected exception.- Since:
- 5.4.0
-
listEventHooksByHost
public EventHookListing listEventHooksByHost(long hostId) throws java.lang.Exception
- Returns:
- the
EventHookListingfor the event hooks on the specified host - Throws:
MissingEntityException- If the host with the requested id does not exist.java.lang.Exception- Since:
- 5.4.0
-
listEventHooksByHost
public EventHookListing listEventHooksByHost(java.lang.String hostName) throws java.lang.Exception
- Returns:
- the
EventHookListingfor the event hooks on the specified host - Throws:
MissingEntityException- If the host with the requested name does not exist.java.lang.Exception- Since:
- 5.4.0
-
updateEventHook
public EventHookListing updateEventHook(UpdateEventHookRequest request, java.lang.String auditUser) throws java.lang.Exception
- Parameters:
request- Request details for event hook changes- Returns:
- the
EventHookListingfor the event hooks on the specified host - Throws:
MissingEntityException- If the specified host or event hook doesn't exist.java.lang.Exception- Since:
- 5.5.0
-
listHosts
public HostListing listHosts() throws java.lang.Exception
Lists all known scheduling hosts.- Returns:
- the
HostListingof all configured hosts (never null) - Throws:
java.lang.Exception- any type of unexpected exception.
-
getHost
public HostDetail getHost(long hostId) throws MissingEntityException, java.lang.Exception
Loads a known scheduling host.- Parameters:
hostId- Id of the host to load- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested id does not exist.java.lang.Exception- Any other type of unexpected exception.
-
getHost
public HostDetail getHost(java.lang.String hostName) throws MissingEntityException, java.lang.Exception
Loads a known scheduling host.- Parameters:
hostName- Name of the host to load (not null)- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested name does not exist.java.lang.Exception- Any other type of unexpected exception.
-
getLicenceHealth
public HostDetail getLicenceHealth(long hostId) throws MissingEntityException, java.lang.Exception
Loads the licence health for a known scheduling host.- Parameters:
hostId- Id of the host to load- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested id does not exist.java.lang.Exception- Any other type of unexpected exception.- Since:
- 4.3.0
-
getHealth
public HostDetail getHealth(java.lang.String hostName) throws MissingEntityException, java.lang.Exception
Loads the health for a known scheduling host.- Parameters:
hostName- Name of the host to load (not null)- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested name does not exist.java.lang.Exception- Any other type of unexpected exception.- Since:
- 6.3.0
-
getHealth
public HostDetail getHealth(long hostId) throws MissingEntityException, java.lang.Exception
Loads the health for a known scheduling host.- Parameters:
hostId- Id of the host to load- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested id does not exist.java.lang.Exception- Any other type of unexpected exception.- Since:
- 6.3.0
-
getLicenceHealth
public HostDetail getLicenceHealth(java.lang.String hostName) throws MissingEntityException, java.lang.Exception
Loads the licence health for a known scheduling host.- Parameters:
hostName- Name of the host to load (not null)- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested name does not exist.java.lang.Exception- Any other type of unexpected exception.- Since:
- 4.3.0
-
updateHost
public HostDetail updateHost(long hostId, HostUpdateRequest request, java.lang.String auditUser) throws MissingEntityException, ValidationException, java.lang.Exception
Updates a known scheduling host's enabled status.- Parameters:
hostId- Id of theHostto updaterequest- Details of the request (not null)auditUser- Optional user that is marked in audit columns. Defaults to "embeddedAPI".- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested id does not exist.ValidationException- A validation error which prevents the action from succeeding.java.lang.Exception- Any other type of unexpected exception.
-
updateHost
public HostDetail updateHost(java.lang.String hostName, HostUpdateRequest request, java.lang.String auditUser) throws MissingEntityException, ValidationException, java.lang.Exception
Updates a known scheduling host's enabled status.- Parameters:
hostName- Name of the host to update (not null)request- Details of the request (not null)auditUser- Optional user that is marked in audit columns. Defaults to "embeddedAPI".- Returns:
- the
HostDetail(never null) - Throws:
MissingEntityException- If the host with the requested name does not exist.ValidationException- A validation error which prevents the action from succeeding.java.lang.Exception- Any other type of unexpected exception.
-
-