Package com.abiquo.apiclient
Class RestClient
- java.lang.Object
-
- com.abiquo.apiclient.RestClient
-
public class RestClient extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(com.abiquo.model.transport.SingleResourceTransportDto dto)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tdelete(com.abiquo.model.transport.SingleResourceTransportDto dto, String accept, Class<T> returnClass)voiddelete(String uri)voiddelete(String uri, Map<String,Object> queryParams)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tedit(T dto)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tget(com.abiquo.model.rest.RESTLink link, Class<T> clazz)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tget(String uri, String accept, com.google.common.reflect.TypeToken<T> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tget(String uri, String accept, Class<T> returnClass)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tget(String uri, String accept, Class<T> returnClass, Map<String,String> headers)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tget(String uri, Map<String,Object> queryParams, String accept, com.google.common.reflect.TypeToken<T> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tget(String uri, Map<String,Object> queryParams, String accept, Class<T> returnClass)StringgetAsString(String uri, String accept)Jsonjson()Returns theJsoninstance used to serialize and deserialize the request and response bodies.<T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>>
Stream<T>list(com.abiquo.model.rest.RESTLink link, Class<W> clazz)<T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>>
Stream<T>list(String uri, String accept, com.google.common.reflect.TypeToken<W> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>>
Stream<T>list(String uri, String accept, Class<W> returnClass)<T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>>
Stream<T>list(String uri, String accept, Class<W> returnClass, Map<String,String> headers)<T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>>
Stream<T>list(String uri, Map<String,Object> queryParams, String accept, com.google.common.reflect.TypeToken<W> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>>
Stream<T>list(String uri, Map<String,Object> queryParams, String accept, Class<W> returnClass)com.squareup.okhttp.ResponsemultipartPost(String url, String bodyName, String body, String fileName, File file)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, String accept, com.google.common.reflect.TypeToken<T> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, String accept, Class<T> returnClass)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, com.google.common.reflect.TypeToken<T> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass, Map<String,String> headers)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, String accept, String contentType, String body, Class<T> returnClass)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, Map<String,Object> queryParams, String accept, com.google.common.reflect.TypeToken<T> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tpost(String uri, Map<String,Object> queryParams, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tput(String uri, String accept, com.google.common.reflect.TypeToken<T> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tput(String uri, String accept, Class<T> returnClass)voidput(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tput(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, com.google.common.reflect.TypeToken<T> returnType)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tput(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Tput(String uri, Map<String,Object> queryParams, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)voidputAction(String uri, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body)com.squareup.okhttp.OkHttpClientrawClient()Changes made to the returned client will affect all the subsequent requests.<T extends com.abiquo.model.transport.SingleResourceTransportDto>
Trefresh(T dto)com.abiquo.server.core.asynctask.AsyncTaskDtowaitForAsyncTaskFinalization(com.abiquo.server.core.asynctask.AsyncTaskDto taskDto, long pollInterval, long maxWait, TimeUnit timeUnit)Waits for task finalizationcom.abiquo.server.core.task.TaskDtowaitForTask(com.abiquo.model.transport.AcceptedRequestDto<?> acceptedRequest, int pollInterval, int maxWait, TimeUnit timeUnit)com.abiquo.server.core.task.TaskDtowaitForTask(com.abiquo.server.core.task.TaskDto taskDto, int pollInterval, int maxWait, TimeUnit timeUnit)com.abiquo.server.core.cloud.VirtualApplianceDtowaitUntilUnlocked(com.abiquo.server.core.cloud.VirtualApplianceDto vapp, int pollInterval, int maxWait, TimeUnit timeUnit)com.abiquo.server.core.cloud.VirtualMachineDtowaitUntilUnlocked(com.abiquo.server.core.cloud.VirtualMachineDto vm, int pollInterval, int maxWait, TimeUnit timeUnit)
-
-
-
Method Detail
-
rawClient
public com.squareup.okhttp.OkHttpClient rawClient()
Changes made to the returned client will affect all the subsequent requests.If you want to create a new client without affecting the existing one, use the
OkHttpClient.clone()method on the returned client.
-
json
public Json json()
Returns theJsoninstance used to serialize and deserialize the request and response bodies.
-
edit
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T edit(T dto)
-
delete
public void delete(com.abiquo.model.transport.SingleResourceTransportDto dto)
-
refresh
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T refresh(T dto)
-
list
public <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> Stream<T> list(com.abiquo.model.rest.RESTLink link, Class<W> clazz)
-
list
public <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> Stream<T> list(String uri, String accept, Class<W> returnClass)
-
list
public <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> Stream<T> list(String uri, String accept, com.google.common.reflect.TypeToken<W> returnType)
-
list
public <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> Stream<T> list(String uri, Map<String,Object> queryParams, String accept, Class<W> returnClass)
-
list
public <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> Stream<T> list(String uri, String accept, Class<W> returnClass, Map<String,String> headers)
-
list
public <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> Stream<T> list(String uri, Map<String,Object> queryParams, String accept, com.google.common.reflect.TypeToken<W> returnType)
-
get
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T get(com.abiquo.model.rest.RESTLink link, Class<T> clazz)
-
get
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T get(String uri, String accept, Class<T> returnClass)
-
get
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T get(String uri, String accept, com.google.common.reflect.TypeToken<T> returnType)
-
get
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T get(String uri, String accept, Class<T> returnClass, Map<String,String> headers)
-
get
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T get(String uri, Map<String,Object> queryParams, String accept, Class<T> returnClass)
-
get
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T get(String uri, Map<String,Object> queryParams, String accept, com.google.common.reflect.TypeToken<T> returnType)
-
delete
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T delete(com.abiquo.model.transport.SingleResourceTransportDto dto, String accept, Class<T> returnClass)
-
delete
public void delete(String uri)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, Map<String,Object> queryParams, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass, Map<String,String> headers)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, com.google.common.reflect.TypeToken<T> returnType)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, String accept, Class<T> returnClass)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, String accept, String contentType, String body, Class<T> returnClass)
-
multipartPost
public com.squareup.okhttp.Response multipartPost(String url, String bodyName, String body, String fileName, File file)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, String accept, com.google.common.reflect.TypeToken<T> returnType)
-
post
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T post(String uri, Map<String,Object> queryParams, String accept, com.google.common.reflect.TypeToken<T> returnType)
-
put
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T put(String uri, Map<String,Object> queryParams, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)
-
put
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T put(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, Class<T> returnClass)
-
putAction
public void putAction(String uri, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body)
-
put
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T put(String uri, String accept, Class<T> returnClass)
-
put
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T put(String uri, String accept, com.google.common.reflect.TypeToken<T> returnType)
-
put
public <T extends com.abiquo.model.transport.SingleResourceTransportDto> T put(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body, com.google.common.reflect.TypeToken<T> returnType)
-
put
public void put(String uri, String accept, String contentType, com.abiquo.model.transport.SingleResourceTransportDto body)
-
waitForTask
public com.abiquo.server.core.task.TaskDto waitForTask(com.abiquo.model.transport.AcceptedRequestDto<?> acceptedRequest, int pollInterval, int maxWait, TimeUnit timeUnit)
-
waitForTask
public com.abiquo.server.core.task.TaskDto waitForTask(com.abiquo.server.core.task.TaskDto taskDto, int pollInterval, int maxWait, TimeUnit timeUnit)
-
waitUntilUnlocked
public com.abiquo.server.core.cloud.VirtualMachineDto waitUntilUnlocked(com.abiquo.server.core.cloud.VirtualMachineDto vm, int pollInterval, int maxWait, TimeUnit timeUnit)
-
waitUntilUnlocked
public com.abiquo.server.core.cloud.VirtualApplianceDto waitUntilUnlocked(com.abiquo.server.core.cloud.VirtualApplianceDto vapp, int pollInterval, int maxWait, TimeUnit timeUnit)
-
waitForAsyncTaskFinalization
public com.abiquo.server.core.asynctask.AsyncTaskDto waitForAsyncTaskFinalization(com.abiquo.server.core.asynctask.AsyncTaskDto taskDto, long pollInterval, long maxWait, TimeUnit timeUnit) throws TimeoutExceptionWaits for task finalization- Parameters:
taskDto- task to wait forpollInterval- amount of time to sleep between task retrieve attemptsmaxWait- maximum amount of time to wait for task finalizationtimeUnit- time unit in which pollInterval and maxWait are expressed- Returns:
- the finished task
- Throws:
TimeoutException- if the specified maxWait time has been reached and task remains in progress
-
-