public class WidgetRestApi extends Object implements org.wso2.msf4j.Microservice
| Modifier and Type | Field and Description |
|---|---|
static String |
API_CONTEXT_PATH |
| Constructor and Description |
|---|
WidgetRestApi(org.wso2.carbon.dashboards.core.WidgetMetadataProvider widgetMetadataProvider)
Creates a new widget REST API.
|
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
create(org.wso2.carbon.dashboards.core.bean.widget.GeneratedWidgetConfigs generatedWidgetConfigs)
Create a generated widget.
|
javax.ws.rs.core.Response |
deleteWidget(String widgetId)
Deletes the widget corresponding to the provided ID.
|
javax.ws.rs.core.Response |
getThumbnail(String widgetId)
This method provides thumbnail of given widget.
|
javax.ws.rs.core.Response |
getWidgetConf(String widgetId)
This method return the configuration of given widget.
|
javax.ws.rs.core.Response |
getWidgetsMetaInfo()
Returns a list of widget configurations.
|
javax.ws.rs.core.Response |
validateWidgetName(String widgetName)
Validate widget name.
|
public static final String API_CONTEXT_PATH
public WidgetRestApi(org.wso2.carbon.dashboards.core.WidgetMetadataProvider widgetMetadataProvider)
widgetMetadataProvider - metadata provider for widgets@GET @Path(value="/") @Produces(value="application/json") public javax.ws.rs.core.Response getWidgetsMetaInfo()
@GET
@Path(value="/{id}")
@Produces(value="application/json")
public javax.ws.rs.core.Response getWidgetConf(@PathParam(value="id")
String widgetId)
widgetId - widget id@GET
@Path(value="/{id}/thumbnail")
public javax.ws.rs.core.Response getThumbnail(@PathParam(value="id")
String widgetId)
widgetId - widget id@POST
@Consumes(value="application/json")
@Produces(value="application/json")
@Path(value="{widgetName}/validate")
public javax.ws.rs.core.Response validateWidgetName(@PathParam(value="widgetName")
String widgetName)
widgetName - data for the validate widget name.@DELETE
@Path(value="/{id}")
public javax.ws.rs.core.Response deleteWidget(@PathParam(value="id")
String widgetId)
widgetId - ID of the dashboard to delete@POST @Consumes(value="application/json") @Produces(value="application/json") @Path(value="/") public javax.ws.rs.core.Response create(org.wso2.carbon.dashboards.core.bean.widget.GeneratedWidgetConfigs generatedWidgetConfigs)
generatedWidgetConfigs - data for the creating widget.Copyright © 2018 WSO2. All rights reserved.