Create an Application Widget

This API creates an Application widget and configures objects.

Before you begin

Before attempting to create an application widget with this API, users must ensure ACF permission is available:
  • ADC > Dashboard Application widget > Add /Delete
This can be checked under Accounts > Role > Authorized Functions.

Request Structure

Endpoint: /dashboard-widget-applicationview
Type: POST
Sample URL: https://<IP/HostName/TenantName>:<GWPORT>/avxapi/dashboard-widget-applicationview?gwsource=external

To understand the elements of the sample URL, click here.

Headers:
Content-Type: application/json
Table 1. Input Parameter
Name Description
sessionId

Header

(Mandatory) Specifies the session ID of the user session received after login.

Type: String

Constraints: The session ID is used when username and password are not provided.

username

Header

(Mandatory) Specifies the login username used to access the AppViewX.

Type: String

Constraints: The username, along with the password, is used when the session ID is not provided.

password

Header

(Mandatory) Specifies the login password used to access the AppViewX.

Type: String

Constraints: The password, along with the username, is used when the session ID is not provided.

Content-Type

Header

(Mandatory) Specifies the format of the data in the payload.

Type: String

Constraints: The value of this param must be ‘application/json’.

gwsource

Query

(Mandatory) Specifies the source from which the request is triggered. The options are:
  • web
  • external
Type: String
dashboardName

Query

(Mandatory) Name of the dashboard in which a widget is to be created. If the given dashboard is not available a new dashboard will be created in the given name.

Constraints: Accepts only '_', '-', ':', '.', '|'(Should not be empty and not start with special characters).

Type: String

payload

Body

(Mandatory) Contains all the params to be sent in the request body for the post request. See Payload section for more details.

The input supports up to three hierarchical levels of groups. group, subGroup1, subGroup2, subGroup3 are static keys.

Payload

Name Description
name

String

(Mandatory) Name of the widget.

Constraints: Accepts only '_', '-', ':', '.', '|'(Should not be empty and not start with special characters).

group

Key value pair[]

(Optional) Contains attributes denoting the group to be created. For more details, see Group.
Widget Group
Name Description
name

String

(Mandatory) Name of the group.

Constraints: Accepts only '_', '-', ':', '.', '|'(Should not be empty and not start with special characters).

action

Key value pair[]

(Optional) Contains a list of attributes denoting the actions to be added in the group. For more details, see Action.
objects

Key value pair[]

(Optional) Contains a list of attributes related to the object to be added in the group such as hierarchy, vendor, objectType. For more details, see ObjectInfo.
subGroup1

Key value pair[]

(Optional) Subgroups to be added within this group. Only three levels of groups are possible. Groups can be mentioned with static keys group, subGroup1, subGroup2 within one another. For more details, see Group.
ObjectInfo
Name Description
vendor

String

(Optional) Device vendor.
objectType

String

(Optional) Object Type as mentioned in AppViewX.
hierarchy

String

(Optional) Hierarchy to display.
selectedList

Key value pair[]

(Optional) List of objects along with actions to be associated with the object. For more details, see Object.
Object
Name Description
resourceId

String

(Optional) Resource id of the object to be added in the widget group.

Note: Use the search API to search/get the resource ID.
actions

String[]

(Optional) List of actions to be associated with this object. Action name should be the custom action name defined under ‘action.name’ property of the group.
Action
Name Description
name

String

(Optional) Name to be given for the particular action in this group.
type

String

(Optional) Type of action. Limited to the actions that are supported in AppViewX.

Response Structure

  • Status Code: 200 OK
  • Message: Successful
  • Headers:
    • Content-Type: application/json
Name Description
response

String

Success message or failure description in case of error.
message

String

Success message or failure description in case of error.
appStatusCode

String

Application specific status code for the response. Will be non-null for failure response.
tags

String

More info in case of failure response.

Status Codes

HTTP Status Code appStatusCode Message Possible remediation
200 OK - -
400 Bad Request DASH_WID_APPVIEW_0001 Mandatory field 'dashboardName' is missing Check and ensure if a non-null/non-empty value is given in query param field - ‘dashboardName’
400 Bad Request ADC_DASH_0511 Exception : Invalid Widget name Check and ensure if a valid value for widget name is given in payload field - ‘name’. Field accepts only '_', '-', ':', '.', '|'(Should not be empty and not start with special characters).
400 Bad Request ADC_DASH_0517 Exception : Invalid Action Check the action name given in the group field - ‘action.type’. Limited to actions supported in AppViewX
400 Bad Request ADC_DASH_0518 Exception : Invalid hierarchy Check the value given under the object field - ‘hierarchy’ is supported. Valid hierarchies for requested vendor and objectType can be found in tags field of response also
400 Bad Request ADC_DASH_0014 Invalid dashboard name.

Change the value given in the query param field - ‘dashboardName’ and retry.

dashboardName field accepts only '_', '-', ':', '.', '|'(Should not be empty and not start with special characters).

400 Bad Request ADC_DASH_0516 Exception : Duplicate Action Check if any of the action is already configured in the group or parentGroup. Group name in which duplicate is found will be available in tags field of response
403 Forbidden ADC_DASH_0005 Permission not available for dashboard. Check if the logged in user has access to the requested dashboard
409 Conflict ADC_DASH_0010 Widget name already exists. Change the widget name in the request and retry
404 Not Found DASH_WID_APPVIEW_0003 Object not found

Check if requested objects are available in AppViewX.

Missing objects resourceIds will be available under tags field of response.

500 Internal Server Error ADC_DASH_0507 Exception occured while adding Application widget
  • Check if given value under object field ‘vendor’ is support by AppViewX

  • Check if given value under object field ‘objectType’ is support by AppViewX

409 Conflict ADC_DASH_0607 Object Count of the Widget exceeds threshold limit {thresholdLimit}. Currently added Object count : {CurrentCountInRequest} Remove input objects so the input count should be within allowed threshold limit(1000)

Sample Request/Response

Use Case
  • Create an application widget with a name appwidget and with a group group_1.

  • group_1 to have two actions configured – enable and disable.

  • group_1 to have two virtual servers – ‘vs:@5f4e2ffafcbb9809756c6b4d:@ACLTest:@Common’ and ‘vs:@5f4e2ffafcbb9809756c6b4d:@ACLTest1:@Common’ configured in it.

  • Both the virtual servers to display all the hierarchical children in the group (hierarchy: all) ‘vs:@5f4e2ffafcbb9809756c6b4d:@ACLTest:@Common’ and ‘vs:@5f4e2ffafcbb9809756c6b4d:@ACLTest1:@Common’ to have actions - enable(en) and disable(dis) configured. group_1 to have child group ‘grp_sub1’ inside it .

  • ‘grp_sub1’ to have two wide IP inside – ‘gw:@5f4e3423fcbb9809756c6b82:@test.com:@Common:@a’ and ‘gw:@5f4e3423fcbb9809756c6b82:@AppViewXSyslog.com:@Common:@a’.

  • Both the wide IPs to display all the hierarchal children in the group (hierarchy: all)

  • Both the wide IPs to be configured with actions enable persistence(enPer) and disable persistence(disPer).

  • ‘grp_sub1’ to be configured with actions enable persistence(enPer) and disable persistence(disPer).

Request URL

https://<IP/HostName/TenantName>:<GWPORT>/avxapi/dashboard-widget-applicationview

Sample Request
{
  "payload": {
    "name": "appwidget",
    "group": [
      {
        "name": "group_1",
        "action": [
          {
            "name": "en",
            "type": "Enable"
          },
          {
            "name": "dis",
            "type": "Disable"
          }
        ],
        "objects": [
          {
            "vendor": "F5",
            "objectType": "VirtualServer",
            "hierarchy": "All",
            "selectedList": [
              {
                "resourceId": "vs:@5f4e2ffafcbb9809756c6b4d:@ACLTest:@Common",
                "actions": [
                  "en",
                  "dis"
                ]
              },
              {
                "resourceId": "vs:@5f4e2ffafcbb9809756c6b4d:@ACLTest1:@Common",
                "actions": [
                  "en",
                  "dis"
                ]
              }
            ]
          }
        ],
        "subGroup1": [
          {
            "name": "grp_sub1",
            "action": [
              {
                "name": "enPer",
                "type": "EnablePersistence"
              },
              {
                "name": "disPer",
                "type": "DisablePersistence"
              }
            ],
            "objects": [
              {
                "vendor": "F5",
                "objectType": "wideIp",
                "hierarchy": "All",
                "selectedList": [
                  {
                    "resourceId": "gw:@5f4e3423fcbb9809756c6b82:@gowthamTest.com:@Common:@a",
                    "actions": [
                      "enPer",
                      "disPer"
                    ]
                  },
                  {
                    "resourceId": "gw:@5f4e3423fcbb9809756c6b82:@AppViewXSyslog.com:@Common:@a",
                    "actions": [
                      "enPer",
                      "disPer"
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}
Sample Response
{
  "response": "Application widget is created under the given dashboard.",
  "message": "Application widget is created under the given dashboard.",
  "appStatusCode": null,
  "tags": null,
  "headers": null
}

Reference

Understanding the sample URL:
  • IP/HostName/TenantName: Replace with the actual IP address, hostname, or tenant name based on the specific configuration in AppViewX.
    • IP: A unique identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication

      The IP address will be included in the endpoint URL for an on-prem deployment.

    • HostName: A human-readable label assigned to a device (host) on a network

      The hostname will be included in the endpoint URL for an on-prem deployment.

    • TenantName: An identifier label for a tenant given to indicate which tenant's data the API request will access/modify

      The tenant name will be included in the endpoint URL for a SaaS deployment.

  • GWPORT: AppViewX gateway port

    A gateway port refers to a network port through which data is sent and received to communicate with a gateway in an on-prem deployment.

    Example: 31443

  • avxapi: Path parameter value (static) that is part of the endpoint's URL
  • Endpoint: Endpoint of the API, for example: execute-hook
  • gwsource: Source or origin of a gateway, for example: external.

What's Next