Create Widget Configuration

Create Widget Configuration

Creates a new Widget Configuration and adds it to the specified view. Supported resource_types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration and ContainerConfiguration.

Note: Expressions should be given in a single line. If an expression spans multiple lines, then form the expression in a single line. For label-value pairs, expressions are evaluated as follows: a. First, render configurations are evaluated in their order of appearance in the widget config. The 'field' is evaluated at the end. b. Second, when render configuration is provided then the order of evaluation is 1. If expressions provided in 'condition' and 'display value' are well-formed and free of runtime-errors such as 'null pointers' and evaluates to 'true'; Then remaining render configurations are not evaluated, and the current render configuration's 'display value' is taken as the final value. 2. If expression provided in 'condition' of render configuration is false, then next render configuration is evaluated. 3. Finally, 'field' is evaluated only when every render configuration evaluates to false and no error occurs during steps 1 and 2 above.

If an error occurs during evaluation of render configuration, then an error message is shown. The display value corresponding to that label is not shown and evaluation of the remaining render configurations continues to collect and show all the error messages (marked with the 'Label' for identification) as 'Error_Messages: {}'.

If during evaluation of expressions for any label-value pair an error occurs, then it is marked with error. The errors are shown in the report, along with the label value pairs that are error-free.

Important: For elements that take expressions, strings should be provided by escaping them with a back-slash. These elements are - condition, field, tooltip text and render_configuration's display_value.

Request
URI
POST
https://nsxmanager.your.domain/policy/api/v1/ui-views/{view-id}/widgetconfigurations
COPY
Path Parameters
string
view-id
Required

view-id


Request Body
WidgetConfiguration of type(s) application/json
Optional
This request body class requires all of the following: ManagedResource , InlineWidgetConfiguration1
{
    "_links": [
        {
            "action": "string",
            "href": "string",
            "rel": "string"
        }
    ],
    "_schema": "string",
    "_self": {
        "action": "string",
        "href": "string",
        "rel": "string"
    },
    "_revision": 0,
    "_create_time": 0,
    "_create_user": "string",
    "_last_modified_time": 0,
    "_last_modified_user": "string",
    "_protection": "string",
    "_system_owned": false,
    "description": "string",
    "display_name": "string",
    "id": "string",
    "resource_type": "string",
    "tags": [
        {
            "scope": "string",
            "tag": "string"
        }
    ],
    "datasources": [
        {
            "display_name": "string",
            "urls": [
                {
                    "alias": "string",
                    "query": "string",
                    "url": "string"
                }
            ]
        }
    ],
    "drilldown_id": "string",
    "footer": {
        "actions": [
            {
                "dock_to_container_footer": false,
                "label": {
                    "condition": "string",
                    "hover": false,
                    "icons": [
                        {
                            "placement": "string",
                            "tooltip": [
                                {
                                    "condition": "string",
                                    "heading": false,
                                    "text": "string"
                                }
                            ],
                            "type": "string"
                        }
                    ],
                    "navigation": "string",
                    "text": "string"
                },
                "url": "string"
            }
        ],
        "condition": "string"
    },
    "icons": [
        {
            "placement": "string",
            "tooltip": [
                {
                    "condition": "string",
                    "heading": false,
                    "text": "string"
                }
            ],
            "type": "string"
        }
    ],
    "is_drilldown": false,
    "legend": {
        "alignment": "string",
        "display_count": false,
        "position": "string",
        "type": "string"
    },
    "shared": false,
    "weight": 0
}
Authentication
This operation uses the following authentication methods.
Responses
201

Created

Returns WidgetConfiguration of type(s) application/json
This response body class contains all of the following: ManagedResource , InlineWidgetConfiguration1
{
    "_links": [
        {
            "action": "string",
            "href": "string",
            "rel": "string"
        }
    ],
    "_schema": "string",
    "_self": {
        "action": "string",
        "href": "string",
        "rel": "string"
    },
    "_revision": 0,
    "_create_time": 0,
    "_create_user": "string",
    "_last_modified_time": 0,
    "_last_modified_user": "string",
    "_protection": "string",
    "_system_owned": false,
    "description": "string",
    "display_name": "string",
    "id": "string",
    "resource_type": "string",
    "tags": [
        {
            "scope": "string",
            "tag": "string"
        }
    ],
    "datasources": [
        {
            "display_name": "string",
            "urls": [
                {
                    "alias": "string",
                    "query": "string",
                    "url": "string"
                }
            ]
        }
    ],
    "drilldown_id": "string",
    "footer": {
        "actions": [
            {
                "dock_to_container_footer": false,
                "label": {
                    "condition": "string",
                    "hover": false,
                    "icons": [
                        {
                            "placement": "string",
                            "tooltip": [
                                {
                                    "condition": "string",
                                    "heading": false,
                                    "text": "string"
                                }
                            ],
                            "type": "string"
                        }
                    ],
                    "navigation": "string",
                    "text": "string"
                },
                "url": "string"
            }
        ],
        "condition": "string"
    },
    "icons": [
        {
            "placement": "string",
            "tooltip": [
                {
                    "condition": "string",
                    "heading": false,
                    "text": "string"
                }
            ],
            "type": "string"
        }
    ],
    "is_drilldown": false,
    "legend": {
        "alignment": "string",
        "display_count": false,
        "position": "string",
        "type": "string"
    },
    "shared": false,
    "weight": 0
}

400
Returns BadRequest of type(s) application/json
This response body class contains all of the following: RelatedApiError , InlineApiError1
{
    "details": "string",
    "error_code": 0,
    "error_message": "string",
    "module_name": "string",
    "related_errors": [
        {
            "details": "string",
            "error_code": 0,
            "error_message": "string",
            "module_name": "string"
        }
    ]
}

403
Returns Forbidden of type(s) application/json
This response body class contains all of the following: RelatedApiError , InlineApiError1
{
    "details": "string",
    "error_code": 0,
    "error_message": "string",
    "module_name": "string",
    "related_errors": [
        {
            "details": "string",
            "error_code": 0,
            "error_message": "string",
            "module_name": "string"
        }
    ]
}

404
Returns NotFound of type(s) application/json
This response body class contains all of the following: RelatedApiError , InlineApiError1
{
    "details": "string",
    "error_code": 0,
    "error_message": "string",
    "module_name": "string",
    "related_errors": [
        {
            "details": "string",
            "error_code": 0,
            "error_message": "string",
            "module_name": "string"
        }
    ]
}

412
Returns PreconditionFailed of type(s) application/json
This response body class contains all of the following: RelatedApiError , InlineApiError1
{
    "details": "string",
    "error_code": 0,
    "error_message": "string",
    "module_name": "string",
    "related_errors": [
        {
            "details": "string",
            "error_code": 0,
            "error_message": "string",
            "module_name": "string"
        }
    ]
}

500
Returns InternalServerError of type(s) application/json
This response body class contains all of the following: RelatedApiError , InlineApiError1
{
    "details": "string",
    "error_code": 0,
    "error_message": "string",
    "module_name": "string",
    "related_errors": [
        {
            "details": "string",
            "error_code": 0,
            "error_message": "string",
            "module_name": "string"
        }
    ]
}

503
Returns ServiceUnavailable of type(s) application/json
This response body class contains all of the following: RelatedApiError , InlineApiError1
{
    "details": "string",
    "error_code": 0,
    "error_message": "string",
    "module_name": "string",
    "related_errors": [
        {
            "details": "string",
            "error_code": 0,
            "error_message": "string",
            "module_name": "string"
        }
    ]
}