Package com.xensource.xenapi
Class Observer
java.lang.Object
com.xensource.xenapi.XenAPIObject
com.xensource.xenapi.Observer
Describes an observer which will control observability activity in the Toolstack
First published in .
- Author:
- Cloud Software Group, Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents all the fields in a Observer -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Observer
create
(Connection c, Observer.Record record) Create a new Observer instance, and return its handle.static Task
createAsync
(Connection c, Observer.Record record) Create a new Observer instance, and return its handle.void
Destroy the specified Observer instance.Destroy the specified Observer instance.boolean
If obj is a Observer, compares XenAPI references for equality.getAll
(Connection c) Return a list of all the Observers known to the system.static Map<Observer,
Observer.Record> Return a map of Observer references to Observer records for all Observers known to the system.Get the attributes field of the given Observer.getByNameLabel
(Connection c, String label) Get all the Observer instances with the given label.static Observer
getByUuid
(Connection c, String uuid) Get a reference to the Observer instance with the specified UUID.Get the components field of the given Observer.Get the enabled field of the given Observer.Get the endpoints field of the given Observer.Get the hosts field of the given Observer.Get the name/description field of the given Observer.Get the name/label field of the given Observer.Get a record containing the current state of the given Observer.Get the uuid field of the given Observer.int
hashCode()
void
setAttributes
(Connection c, Map<String, String> value) Set the attributes of an observer.setAttributesAsync
(Connection c, Map<String, String> value) Set the attributes of an observer.void
setComponents
(Connection c, Set<String> value) Set the components on which the observer will broadcast to.setComponentsAsync
(Connection c, Set<String> value) Set the components on which the observer will broadcast to.void
setEnabled
(Connection c, Boolean value) Enable / disable this observer which will stop the observer from producing observability information Minimum allowed role: pool-admin Experimental.setEnabledAsync
(Connection c, Boolean value) Enable / disable this observer which will stop the observer from producing observability information Minimum allowed role: pool-admin Experimental.void
setEndpoints
(Connection c, Set<String> value) Set the file/HTTP endpoints the observer sends data to Minimum allowed role: pool-admin Experimental.setEndpointsAsync
(Connection c, Set<String> value) Set the file/HTTP endpoints the observer sends data to Minimum allowed role: pool-admin Experimental.void
setHosts
(Connection c, Set<Host> value) Sets the hosts that the observer is to be registered on Minimum allowed role: pool-admin Experimental.setHostsAsync
(Connection c, Set<Host> value) Sets the hosts that the observer is to be registered on Minimum allowed role: pool-admin Experimental.void
setNameDescription
(Connection c, String description) Set the name/description field of the given Observer.void
setNameLabel
(Connection c, String label) Set the name/label field of the given Observer.Methods inherited from class com.xensource.xenapi.XenAPIObject
isNull
-
Field Details
-
ref
The XenAPI reference (OpaqueRef) to this object.
-
-
Method Details
-
toWireString
- Specified by:
toWireString
in classXenAPIObject
- Returns:
- The XenAPI reference (OpaqueRef) to this object.
-
equals
If obj is a Observer, compares XenAPI references for equality. -
hashCode
public int hashCode() -
getRecord
public Observer.Record getRecord(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get a record containing the current state of the given Observer. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- all fields from the object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getByUuid
public static Observer getByUuid(Connection c, String uuid) throws Types.BadServerResponse, Types.XenAPIException, IOException Get a reference to the Observer instance with the specified UUID. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onuuid
- UUID of object to return- Returns:
- reference to the object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
create
public static Observer create(Connection c, Observer.Record record) throws Types.BadServerResponse, Types.XenAPIException, IOException Create a new Observer instance, and return its handle. Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onrecord
- All constructor arguments- Returns:
- reference to the newly created object
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
createAsync
public static Task createAsync(Connection c, Observer.Record record) throws Types.BadServerResponse, Types.XenAPIException, IOException Create a new Observer instance, and return its handle. Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onrecord
- All constructor arguments- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
destroy
public void destroy(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Destroy the specified Observer instance. Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
destroyAsync
public Task destroyAsync(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Destroy the specified Observer instance. Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getByNameLabel
public static Set<Observer> getByNameLabel(Connection c, String label) throws Types.BadServerResponse, Types.XenAPIException, IOException Get all the Observer instances with the given label. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onlabel
- label of object to return- Returns:
- references to objects with matching names
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getUuid
public String getUuid(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the uuid field of the given Observer. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getNameLabel
public String getNameLabel(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the name/label field of the given Observer. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getNameDescription
public String getNameDescription(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the name/description field of the given Observer. Minimum allowed role: read-only First published in XenServer 4.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getHosts
public Set<Host> getHosts(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the hosts field of the given Observer. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getAttributes
public Map<String,String> getAttributes(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the attributes field of the given Observer. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getEndpoints
public Set<String> getEndpoints(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the endpoints field of the given Observer. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getComponents
public Set<String> getComponents(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the components field of the given Observer. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getEnabled
public Boolean getEnabled(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the enabled field of the given Observer. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- value of the field
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setNameLabel
public void setNameLabel(Connection c, String label) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the name/label field of the given Observer. Minimum allowed role: pool-admin First published in XenServer 4.0.- Parameters:
c
- The connection the call is made onlabel
- New value to set- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setNameDescription
public void setNameDescription(Connection c, String description) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the name/description field of the given Observer. Minimum allowed role: pool-admin First published in XenServer 4.0.- Parameters:
c
- The connection the call is made ondescription
- New value to set- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setHosts
public void setHosts(Connection c, Set<Host> value) throws Types.BadServerResponse, Types.XenAPIException, IOException Sets the hosts that the observer is to be registered on Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- Hosts the observer is registered on- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setHostsAsync
public Task setHostsAsync(Connection c, Set<Host> value) throws Types.BadServerResponse, Types.XenAPIException, IOException Sets the hosts that the observer is to be registered on Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- Hosts the observer is registered on- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setEnabled
public void setEnabled(Connection c, Boolean value) throws Types.BadServerResponse, Types.XenAPIException, IOException Enable / disable this observer which will stop the observer from producing observability information Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- If the observer is to be enabled (true) or disabled (false)- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setEnabledAsync
public Task setEnabledAsync(Connection c, Boolean value) throws Types.BadServerResponse, Types.XenAPIException, IOException Enable / disable this observer which will stop the observer from producing observability information Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- If the observer is to be enabled (true) or disabled (false)- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setAttributes
public void setAttributes(Connection c, Map<String, String> value) throws Types.BadServerResponse, Types.XenAPIException, IOExceptionSet the attributes of an observer. These are used to emit metadata by the observer Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- The attributes that the observer emits as part of the data- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setAttributesAsync
public Task setAttributesAsync(Connection c, Map<String, String> value) throws Types.BadServerResponse, Types.XenAPIException, IOExceptionSet the attributes of an observer. These are used to emit metadata by the observer Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- The attributes that the observer emits as part of the data- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setEndpoints
public void setEndpoints(Connection c, Set<String> value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the file/HTTP endpoints the observer sends data to Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- The endpoints that the observer will export data to. A URL or the string 'bugtool'. This can refer to an enpoint to the local file system- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setEndpointsAsync
public Task setEndpointsAsync(Connection c, Set<String> value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the file/HTTP endpoints the observer sends data to Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- The endpoints that the observer will export data to. A URL or the string 'bugtool'. This can refer to an enpoint to the local file system- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setComponents
public void setComponents(Connection c, Set<String> value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the components on which the observer will broadcast to. i.e. xapi, xenopsd, networkd, etc. Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- The components the observer will broadcast to- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
setComponentsAsync
public Task setComponentsAsync(Connection c, Set<String> value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the components on which the observer will broadcast to. i.e. xapi, xenopsd, networkd, etc. Minimum allowed role: pool-admin Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made onvalue
- The components the observer will broadcast to- Returns:
- Task
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getAll
public static Set<Observer> getAll(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Return a list of all the Observers known to the system. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- references to all objects
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-
getAllRecords
public static Map<Observer,Observer.Record> getAllRecords(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Return a map of Observer references to Observer records for all Observers known to the system. Minimum allowed role: read-only Experimental. First published in 23.14.0.- Parameters:
c
- The connection the call is made on- Returns:
- records of all objects
- Throws:
Types.BadServerResponse
- Thrown if the response from the server contains an invalid status.Types.XenAPIException
- if the call failed.IOException
- if an error occurs during a send or receive. This includes cases where a payload is invalid JSON.
-