public abstract class RestRequest
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
baseUrl |
protected com.google.gson.Gson |
mapper |
| Constructor and Description |
|---|
RestRequest(java.lang.String username,
java.lang.String password,
java.lang.String projectId,
boolean sslEnabled,
java.lang.String nfvoIp,
java.lang.String nfvoPort,
java.lang.String path,
java.lang.String version)
Create a request with a given url path
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getProjectId() |
void |
requestDelete(java.lang.String id)
Executes a http delete with to a given id
|
java.lang.Object |
requestGet(java.lang.String id,
java.lang.Class type)
Executes a http get with to a given id
|
protected java.lang.Object |
requestGetAll(java.lang.String url,
java.lang.Class type) |
java.lang.Object |
requestGetWithStatusAccepted(java.lang.String url,
java.lang.Class type)
Executes a http get with to a given url, in contrast to the normal get it uses an http (accept)
status check of the response
|
java.io.Serializable |
requestPost(java.io.Serializable object)
Executes a http post with to a given url, while serializing the object content as json and
returning the response
|
java.lang.String |
requestPost(java.lang.String id)
Does the POST Request
|
java.io.Serializable |
requestPost(java.lang.String id,
java.io.Serializable object) |
java.io.Serializable |
requestPost(java.lang.String id,
java.io.Serializable object,
java.lang.reflect.Type type)
Executes a http post with to a given url, while serializing the object content as json.
|
org.openbaton.catalogue.nfvo.VNFPackage |
requestPostPackage(java.io.File f)
Used to upload tar files to the NFVO for creating VNFPackages.
|
java.io.Serializable |
requestPut(java.lang.String id,
java.io.Serializable object)
Executes a http put with to a given id, while serializing the object content as json and
returning the response
|
void |
setProjectId(java.lang.String projectId) |
protected final java.lang.String baseUrl
protected com.google.gson.Gson mapper
public RestRequest(java.lang.String username,
java.lang.String password,
java.lang.String projectId,
boolean sslEnabled,
java.lang.String nfvoIp,
java.lang.String nfvoPort,
java.lang.String path,
java.lang.String version)
public java.lang.String getProjectId()
public void setProjectId(java.lang.String projectId)
public java.lang.String requestPost(java.lang.String id)
throws SDKException
id - SDKExceptionpublic java.io.Serializable requestPost(java.io.Serializable object)
throws SDKException
object - the object content to be serialized as jsonSDKExceptionpublic java.io.Serializable requestPost(java.lang.String id,
java.io.Serializable object)
throws SDKException
SDKExceptionpublic java.io.Serializable requestPost(java.lang.String id,
java.io.Serializable object,
java.lang.reflect.Type type)
throws SDKException
object - the object content to be serialized as jsontype - the object type to which the response should be mappedSDKExceptionpublic org.openbaton.catalogue.nfvo.VNFPackage requestPostPackage(java.io.File f)
throws SDKException
f - the tar file containing the VNFPackageSDKExceptionpublic void requestDelete(java.lang.String id)
throws SDKException
id - the id path used for the api requestSDKExceptionpublic java.lang.Object requestGet(java.lang.String id,
java.lang.Class type)
throws SDKException
id - the id path used for the api requestSDKExceptionprotected java.lang.Object requestGetAll(java.lang.String url,
java.lang.Class type)
throws SDKException
SDKExceptionpublic java.lang.Object requestGetWithStatusAccepted(java.lang.String url,
java.lang.Class type)
throws SDKException
url - the url path used for the api requestSDKExceptionpublic java.io.Serializable requestPut(java.lang.String id,
java.io.Serializable object)
throws SDKException
id - the id path used for the api requestobject - the object content to be serialized as jsonSDKException