Package com.xensource.xenapi
Class RateLimit
java.lang.Object
com.xensource.xenapi.XenAPIObject
com.xensource.xenapi.RateLimit
A rate limiter associated with one or more callers
First published in .
- Author:
- Cloud Software Group, Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents all the fields in a RateLimit -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCaller(Connection c, Caller caller) Attach the given caller to this rate limiter.addCallerAsync(Connection c, Caller caller) Attach the given caller to this rate limiter.static RateLimitcreate(Connection c, RateLimit.Record record) Create a new Rate_limit instance, and return its handle.static TaskcreateAsync(Connection c, RateLimit.Record record) Create a new Rate_limit instance, and return its handle.voidDestroy the specified Rate_limit instance.Destroy the specified Rate_limit instance.booleanIf obj is a RateLimit, compares XenAPI references for equality.getAll(Connection c) Return a list of all the Rate_limits known to the system.static Map<RateLimit,RateLimit.Record> Return a map of Rate_limit references to Rate_limit records for all Rate_limits known to the system.Get the burst_size field of the given Rate_limit.getByNameLabel(Connection c, String label) Get all the Rate_limit instances with the given label.static RateLimitgetByUuid(Connection c, String uuid) Get a reference to the Rate_limit instance with the specified UUID.Get the callers field of the given Rate_limit.Get the fill_rate field of the given Rate_limit.Get the name/description field of the given Rate_limit.Get the name/label field of the given Rate_limit.Get a record containing the current state of the given Rate_limit.Get the uuid field of the given Rate_limit.inthashCode()voidremoveCaller(Connection c, Caller caller) Detach the given caller from this rate limiter Minimum allowed role: pool-admin Experimental.removeCallerAsync(Connection c, Caller caller) Detach the given caller from this rate limiter Minimum allowed role: pool-admin Experimental.voidsetBurstSize(Connection c, Double value) Set the burst size of the rate limiter Minimum allowed role: pool-admin Experimental.setBurstSizeAsync(Connection c, Double value) Set the burst size of the rate limiter Minimum allowed role: pool-admin Experimental.voidsetFillRate(Connection c, Double value) Set the fill rate of the rate limiter Minimum allowed role: pool-admin Experimental.setFillRateAsync(Connection c, Double value) Set the fill rate of the rate limiter Minimum allowed role: pool-admin Experimental.voidsetNameDescription(Connection c, String description) Set the name/description field of the given Rate_limit.voidsetNameLabel(Connection c, String label) Set the name/label field of the given Rate_limit.Methods inherited from class com.xensource.xenapi.XenAPIObject
isNull
-
Field Details
-
ref
The XenAPI reference (OpaqueRef) to this object.
-
-
Constructor Details
-
RateLimit
Creates an object from a given XenAPI reference (OpaqueRef)- Parameters:
ref- The OpaqueRef from which to create the object.
-
-
Method Details
-
toWireString
- Specified by:
toWireStringin classXenAPIObject- Returns:
- The XenAPI reference (OpaqueRef) to this object.
-
equals
If obj is a RateLimit, compares XenAPI references for equality. -
hashCode
public int hashCode() -
getRecord
public RateLimit.Record getRecord(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get a record containing the current state of the given Rate_limit. Minimum allowed role: read-only Experimental. First published in 26.17.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 RateLimit getByUuid(Connection c, String uuid) throws Types.BadServerResponse, Types.XenAPIException, IOException Get a reference to the Rate_limit instance with the specified UUID. Minimum allowed role: read-only Experimental. First published in 26.17.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 RateLimit create(Connection c, RateLimit.Record record) throws Types.BadServerResponse, Types.XenAPIException, IOException Create a new Rate_limit instance, and return its handle. Minimum allowed role: pool-admin Experimental. First published in 26.17.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, RateLimit.Record record) throws Types.BadServerResponse, Types.XenAPIException, IOException Create a new Rate_limit instance, and return its handle. Minimum allowed role: pool-admin Experimental. First published in 26.17.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 Rate_limit instance. Minimum allowed role: pool-admin Experimental. First published in 26.17.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 Rate_limit instance. Minimum allowed role: pool-admin Experimental. First published in 26.17.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<RateLimit> getByNameLabel(Connection c, String label) throws Types.BadServerResponse, Types.XenAPIException, IOException Get all the Rate_limit instances with the given label. Minimum allowed role: read-only Experimental. First published in 26.17.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 Rate_limit. Minimum allowed role: read-only Experimental. First published in 26.17.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 Rate_limit. Minimum allowed role: read-only Experimental. First published in 26.17.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 Rate_limit. Minimum allowed role: read-only Experimental. First published in 26.17.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.
-
getCallers
public Set<Caller> getCallers(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the callers field of the given Rate_limit. Minimum allowed role: read-only Experimental. First published in 26.17.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.
-
getBurstSize
public Double getBurstSize(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the burst_size field of the given Rate_limit. Minimum allowed role: read-only Experimental. First published in 26.17.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.
-
getFillRate
public Double getFillRate(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Get the fill_rate field of the given Rate_limit. Minimum allowed role: read-only Experimental. First published in 26.17.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 Rate_limit. Minimum allowed role: pool-admin Experimental. First published in 26.17.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 Rate_limit. Minimum allowed role: pool-admin Experimental. First published in 26.17.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.
-
addCaller
public void addCaller(Connection c, Caller caller) throws Types.BadServerResponse, Types.XenAPIException, IOException Attach the given caller to this rate limiter. Replaces any rate limiter previously attached to the caller. Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made oncaller- The caller to attach- 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.
-
addCallerAsync
public Task addCallerAsync(Connection c, Caller caller) throws Types.BadServerResponse, Types.XenAPIException, IOException Attach the given caller to this rate limiter. Replaces any rate limiter previously attached to the caller. Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made oncaller- The caller to attach- 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.
-
removeCaller
public void removeCaller(Connection c, Caller caller) throws Types.BadServerResponse, Types.XenAPIException, IOException Detach the given caller from this rate limiter Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made oncaller- The caller to detach- 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.
-
removeCallerAsync
public Task removeCallerAsync(Connection c, Caller caller) throws Types.BadServerResponse, Types.XenAPIException, IOException Detach the given caller from this rate limiter Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made oncaller- The caller to detach- 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.
-
setBurstSize
public void setBurstSize(Connection c, Double value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the burst size of the rate limiter Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made onvalue- The new burst size, must be positive- 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.
-
setBurstSizeAsync
public Task setBurstSizeAsync(Connection c, Double value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the burst size of the rate limiter Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made onvalue- The new burst size, must be positive- 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.
-
setFillRate
public void setFillRate(Connection c, Double value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the fill rate of the rate limiter Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made onvalue- The new fill rate (tokens/second), must be positive- 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.
-
setFillRateAsync
public Task setFillRateAsync(Connection c, Double value) throws Types.BadServerResponse, Types.XenAPIException, IOException Set the fill rate of the rate limiter Minimum allowed role: pool-admin Experimental. First published in 26.17.0.- Parameters:
c- The connection the call is made onvalue- The new fill rate (tokens/second), must be positive- 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<RateLimit> getAll(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Return a list of all the Rate_limits known to the system. Minimum allowed role: read-only Experimental. First published in 26.17.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<RateLimit,RateLimit.Record> getAllRecords(Connection c) throws Types.BadServerResponse, Types.XenAPIException, IOException Return a map of Rate_limit references to Rate_limit records for all Rate_limits known to the system. Minimum allowed role: read-only Experimental. First published in 26.17.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.
-