DashboardRestClient class
Base class that should be used (derived from) to make requests to VSS REST apis
- Extends
Constructors
Dashboard |
Properties
RESOURCE_AREA_ID |
Methods
create |
Create the supplied dashboard. |
create |
Create a widget on the specified dashboard. |
delete |
Delete a dashboard given its ID. This also deletes the widgets associated with this dashboard. |
delete |
Delete the specified widget. |
get |
Get a dashboard by its ID. |
get |
Get a list of dashboards under a project. |
get |
Get the current state of the specified widget. |
get |
Get the widget metadata satisfying the specified contribution ID. |
get |
Get all available widget metadata in alphabetical order, including widgets marked with isVisibleFromCatalog == false. |
replace |
Replace configuration for the specified dashboard. Replaces Widget list on Dashboard, only if property is supplied. |
replace |
Update the name and position of dashboards in the supplied group, and remove omitted dashboards. Does not modify dashboard content. |
replace |
Override the state of the specified widget. |
update |
Perform a partial update of the specified widget. |
Constructor Details
DashboardRestClient(IVssRestClientOptions)
Property Details
RESOURCE_AREA_ID
static RESOURCE_AREA_ID: string
Property Value
string
Method Details
createDashboard(Dashboard, TeamContext)
Create the supplied dashboard.
function createDashboard(dashboard: Dashboard, teamContext: TeamContext): Promise<Dashboard>
Parameters
- dashboard
- Dashboard
The initial state of the dashboard
- teamContext
- TeamContext
The team context for the operation
Returns
Promise<Dashboard>
createWidget(Widget, TeamContext, string)
Create a widget on the specified dashboard.
function createWidget(widget: Widget, teamContext: TeamContext, dashboardId: string): Promise<Widget>
Parameters
- widget
- Widget
State of the widget to add
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
ID of dashboard the widget will be added to.
Returns
Promise<Widget>
deleteDashboard(TeamContext, string)
Delete a dashboard given its ID. This also deletes the widgets associated with this dashboard.
function deleteDashboard(teamContext: TeamContext, dashboardId: string): Promise<void>
Parameters
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
ID of the dashboard to delete.
Returns
Promise<void>
deleteWidget(TeamContext, string, string)
Delete the specified widget.
function deleteWidget(teamContext: TeamContext, dashboardId: string, widgetId: string): Promise<Dashboard>
Parameters
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
ID of the dashboard containing the widget.
- widgetId
-
string
ID of the widget to update.
Returns
Promise<Dashboard>
getDashboard(TeamContext, string)
Get a dashboard by its ID.
function getDashboard(teamContext: TeamContext, dashboardId: string): Promise<Dashboard>
Parameters
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
Returns
Promise<Dashboard>
getDashboardsByProject(TeamContext)
Get a list of dashboards under a project.
function getDashboardsByProject(teamContext: TeamContext): Promise<Dashboard[]>
Parameters
- teamContext
- TeamContext
The team context for the operation
Returns
Promise<Dashboard[]>
getWidget(TeamContext, string, string)
Get the current state of the specified widget.
function getWidget(teamContext: TeamContext, dashboardId: string, widgetId: string): Promise<Widget>
Parameters
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
ID of the dashboard containing the widget.
- widgetId
-
string
ID of the widget to read.
Returns
Promise<Widget>
getWidgetMetadata(string, string)
Get the widget metadata satisfying the specified contribution ID.
function getWidgetMetadata(contributionId: string, project?: string): Promise<WidgetMetadataResponse>
Parameters
- contributionId
-
string
The ID of Contribution for the Widget
- project
-
string
Project ID or project name
Returns
Promise<WidgetMetadataResponse>
getWidgetTypes(WidgetScope, string)
Get all available widget metadata in alphabetical order, including widgets marked with isVisibleFromCatalog == false.
function getWidgetTypes(scope: WidgetScope, project?: string): Promise<WidgetTypesResponse>
Parameters
- scope
- WidgetScope
- project
-
string
Project ID or project name
Returns
Promise<WidgetTypesResponse>
replaceDashboard(Dashboard, TeamContext, string)
Replace configuration for the specified dashboard. Replaces Widget list on Dashboard, only if property is supplied.
function replaceDashboard(dashboard: Dashboard, teamContext: TeamContext, dashboardId: string): Promise<Dashboard>
Parameters
- dashboard
- Dashboard
The Configuration of the dashboard to replace.
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
ID of the dashboard to replace.
Returns
Promise<Dashboard>
replaceDashboards(DashboardGroup, TeamContext)
Update the name and position of dashboards in the supplied group, and remove omitted dashboards. Does not modify dashboard content.
function replaceDashboards(group: DashboardGroup, teamContext: TeamContext): Promise<DashboardGroup>
Parameters
- group
- DashboardGroup
- teamContext
- TeamContext
The team context for the operation
Returns
Promise<DashboardGroup>
replaceWidget(Widget, TeamContext, string, string)
Override the state of the specified widget.
function replaceWidget(widget: Widget, teamContext: TeamContext, dashboardId: string, widgetId: string): Promise<Widget>
Parameters
- widget
- Widget
State to be written for the widget.
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
ID of the dashboard containing the widget.
- widgetId
-
string
ID of the widget to update.
Returns
Promise<Widget>
updateWidget(Widget, TeamContext, string, string)
Perform a partial update of the specified widget.
function updateWidget(widget: Widget, teamContext: TeamContext, dashboardId: string, widgetId: string): Promise<Widget>
Parameters
- widget
- Widget
Description of the widget changes to apply. All non-null fields will be replaced.
- teamContext
- TeamContext
The team context for the operation
- dashboardId
-
string
ID of the dashboard containing the widget.
- widgetId
-
string
ID of the widget to update.
Returns
Promise<Widget>