Groovy Documentation

com.adaptc.mws.plugins
[Java] Interface IMoabRestService


public interface IMoabRestService

The Moab REST service gives easy access to all supported REST resources in Moab Web Services. The isAPIVersionSupported(int) method may also be used to determine which API versions may be used for the current running instance of MWS.

Methods are provided to perform each HTTP method: GET, POST, PUT, and DELETE. Several variations are given of each method in order to utilize simpler or more complicated requests. Each operation is performed internally. In other words, no external network connection is utilized to perform these calls.

The methods for each HTTP method may be called as follows (using the post method as an example):

 // String url
 moabRestService.post("/rest/jobs")
 // Map options, String url
 moabRestService.post("/rest/jobs", hooks:true)
 // String url, Closure data
 moabRestService.post("/rest/jobs") {
     [data:"here"]
 }
 // Map options, String url, Closure data
 moabRestService.post("/rest/jobs", hooks:true) {
     [data:"here"]
 }
 

For more information on how to use this service, see the MWS Quick Reference page on Moab Rest Service.

Authors:
bsaville


Method Summary
MoabRestResponse delete(String url)

Shortcut for calling delete(Map, String, Closure) with no options or data.

MoabRestResponse delete(Map options, String url)

Shortcut for calling delete(Map, String, Closure) with no data.

MoabRestResponse delete(String url, Closure data)

Shortcut for calling delete(Map, String, Closure) with no options.

MoabRestResponse delete(Map options, String url, Closure data)

Performs an internal HTTP DELETE operation for the requested URL with optional options and/or data.

MoabRestResponse get(String url)

Shortcut for calling get(Map, String, Closure) with no options or data.

MoabRestResponse get(Map options, String url)

Shortcut for calling get(Map, String, Closure) with no data.

MoabRestResponse get(String url, Closure data)

Shortcut for calling get(Map, String, Closure) with no options.

MoabRestResponse get(Map options, String url, Closure data)

Performs an internal HTTP GET operation for the requested URL with optional options and/or data.

boolean isAPIVersionSupported(int apiVersion)

Returns whether or not the specified API version is supported by this version of Moab Web Services.

MoabRestResponse post(String url)

Shortcut for calling post(Map, String, Closure) with no options or data.

MoabRestResponse post(Map options, String url)

Shortcut for calling post(Map, String, Closure) with no data.

MoabRestResponse post(String url, Closure data)

Shortcut for calling post(Map, String, Closure) with no options.

MoabRestResponse post(Map options, String url, Closure data)

Performs an internal HTTP POST operation for the requested URL with optional options and/or data.

MoabRestResponse put(String url)

Shortcut for calling put(Map, String, Closure) with no options or data.

MoabRestResponse put(Map options, String url)

Shortcut for calling put(Map, String, Closure) with no data.

MoabRestResponse put(String url, Closure data)

Shortcut for calling put(Map, String, Closure) with no options.

MoabRestResponse put(Map options, String url, Closure data)

Performs an internal HTTP PUT operation for the requested URL with optional options and/or data.

 

Method Detail

delete

public MoabRestResponse delete(String url)
Shortcut for calling delete(Map, String, Closure) with no options or data.
Parameters:
url - The URL to call
Returns:
The response result


delete

public MoabRestResponse delete(Map options, String url)
Shortcut for calling delete(Map, String, Closure) with no data.
Parameters:
url - The URL to call
Returns:
The response result


delete

public MoabRestResponse delete(String url, Closure data)
Shortcut for calling delete(Map, String, Closure) with no options.
Parameters:
url - The URL to call
Returns:
The response result


delete

public MoabRestResponse delete(Map options, String url, Closure data)
Performs an internal HTTP DELETE operation for the requested URL with optional options and/or data. Valid options and data types are documented in IMoabRestService.
Parameters:
options - Map of options to use for the request
url - The URL to call
data - A closure which returns a valid request body
Returns:
The response result


get

public MoabRestResponse get(String url)
Shortcut for calling get(Map, String, Closure) with no options or data.
Parameters:
url - The URL to call
Returns:
The response result


get

public MoabRestResponse get(Map options, String url)
Shortcut for calling get(Map, String, Closure) with no data.
Parameters:
url - The URL to call
Returns:
The response result


get

public MoabRestResponse get(String url, Closure data)
Shortcut for calling get(Map, String, Closure) with no options.
Parameters:
url - The URL to call
Returns:
The response result


get

public MoabRestResponse get(Map options, String url, Closure data)
Performs an internal HTTP GET operation for the requested URL with optional options and/or data. Valid options and data types are documented in IMoabRestService.
Parameters:
options - Map of options to use for the request
url - The URL to call RESTfully
data - A closure which returns a valid request body
Returns:
The response result


isAPIVersionSupported

public boolean isAPIVersionSupported(int apiVersion)
Returns whether or not the specified API version is supported by this version of Moab Web Services.
Parameters:
apiVersion - The API version as an integer (i.e. 1, 2, etc)
Returns:
True if the API version is supported, false if configuration or MWS version prevents the API version from being used


post

public MoabRestResponse post(String url)
Shortcut for calling post(Map, String, Closure) with no options or data.
Parameters:
url - The URL to call
Returns:
The response result


post

public MoabRestResponse post(Map options, String url)
Shortcut for calling post(Map, String, Closure) with no data.
Parameters:
url - The URL to call
Returns:
The response result


post

public MoabRestResponse post(String url, Closure data)
Shortcut for calling post(Map, String, Closure) with no options.
Parameters:
url - The URL to call
Returns:
The response result


post

public MoabRestResponse post(Map options, String url, Closure data)
Performs an internal HTTP POST operation for the requested URL with optional options and/or data. Valid options and data types are documented in IMoabRestService.
Parameters:
options - Map of options to use for the request
url - The URL to call
data - A closure which returns a valid request body
Returns:
The response result


put

public MoabRestResponse put(String url)
Shortcut for calling put(Map, String, Closure) with no options or data.
Parameters:
url - The URL to call
Returns:
The response result


put

public MoabRestResponse put(Map options, String url)
Shortcut for calling put(Map, String, Closure) with no data.
Parameters:
url - The URL to call
Returns:
The response result


put

public MoabRestResponse put(String url, Closure data)
Shortcut for calling put(Map, String, Closure) with no options.
Parameters:
url - The URL to call
Returns:
The response result


put

public MoabRestResponse put(Map options, String url, Closure data)
Performs an internal HTTP PUT operation for the requested URL with optional options and/or data. Valid options and data types are documented in IMoabRestService.
Parameters:
options - Map of options to use for the request
url - The URL to call
data - A closure which returns a valid request body
Returns:
The response result


 

Groovy Documentation