Create a view
The format of the <method>
element
for creating a view is:
<method methodName="view.create">
Use this method to create a new view
for use on the AEL, Event
Viewer,
LEL, Table View, and Event Dashboard. The <method>
element
contains one or more <view>
elements, each of
which defines the characteristics of a new view. The <view>
element
can contain up to one of each of the <columns>
, <sorting>
,
and <grouping>
elements.
<view>
The <view>
element
defines a view and has the following attributes:
Attribute name | Required or optional | Description |
---|---|---|
viewName |
Required |
Provides a unique name for a view. |
Value: String |
||
Default value: None |
||
datasource |
Optional |
The name of the data source that provides events for the view. To specify multiple data sources use a comma-separated list. |
Value: String |
||
Default value: |
||
user |
Optional |
For user views, this attribute identifies the users that the view is associated with. The value of the attribute is a comma-separated list of User IDs. |
Value: List of User IDs |
||
Default value: None |
||
type |
Optional |
The type of view. |
Value: |
||
Default value: system |
||
relationshipName |
Optional |
The name of an event relationship to use with the view that is applied to the Event Viewer. An event relationship organizes the Event Viewer by the relationships between them. For example, by their root cause and symptom. |
Value: String |
||
Default value: None |
<columns>
The <columns>
element
is a child the <view>
element and can occur once
or not at all. If present, the element contains any number of <visualEntry>
elements.
<visualEntry>
The<visualEntry>
element
is a child of the <columns>
element that defines
the appearance of fields in the view. The element has the following
attributes:
Attribute name | Required or optional | Description |
---|---|---|
fieldName |
Required |
The name of a field to include in the view. This is analogous to an entry from the Available fields list in the View Builder. |
Value: The name of field from a ObjectServer table. |
||
Default value: None |
||
fieldTitle |
Required |
The name to use for the column title in the view for this field. |
Value: String |
||
Default value: None |
||
dataJustify |
Required |
Specifies how to justify the text in the column. |
Value: |
||
Default value: |
||
titleJustify |
Required |
Specifies how to justify the column title. |
Value: |
||
Default value: |
||
columnWidth |
Rquired |
The width of the column, in pixels. |
Value: Integer |
||
Default value: |
||
columnLocked |
Optional |
Specifies whether the position of a column is locked or whether the user can rearrange the order of the column. |
Value: |
||
Default value: |
||
datasource |
Optional |
The name of the datasource that provides data for the field. |
Value: Name of a data source |
||
Default value: |
<sorting>
The <sorting>
element
is a child of the <view>
element and can occur
once or not at all. If present, the element contains any number of <sortColumn>
elements
that define the sorting order for events in the view.
<sortColumn>
The <sortColumn>
element
defines a field to use when sorting the list events in a view. When
there are multiple <sortColumn>
the entries in
the view are sorted in the order that the <sortColumn>
elements
appear.
The element has the following attributes:
Attribute name | Required or optional | Description |
---|---|---|
fieldName |
Required |
The name of a field in the view. |
Value: The name of a field. |
||
Default value: None. |
||
order |
Required |
The order to sort the column entries. |
Value: |
||
Default value: |
||
datasource |
Optional |
The name of the data source that provides the named field. |
Value: The name of a data source. |
||
Default value: |
<grouping>
The <grouping>
element
is a child of the <view>
element and can occur
once or not at all. If present, the element contains any number of <groupColumn>
elements
that define how events are grouped in the Event
Viewer when
using this view.
<groupColumn
The <groupColumn>
element
defines a field to use when grouping the list events in a view used
by the Event
Viewer.
When there are multiple <groupColumn>
elements,
the entries in the view are grouped in the order that the <groupColumn>
elements
appear.
The element has the following attributes:
Attribute name | Required or optional | Description |
---|---|---|
fieldName |
Required |
The name of a field in the view. This is analogous to an entry from the Available fields list in the View Builder. |
Value: The name of a field. |
||
Default value: None. |
Notes:
- The WAAPI DTD allows any number of
<groupColumn>
elements. However, the maximum number of levels of grouping that you can use is set by the columngrouping.maximum.columns property in the Web GUI initialization file (server.init). By default, the value of that property is 3 but the administrator can set a different value.If you specify more levels than are defined by this property, the server returns an error.
- The columngrouping.allowedcolumns property
in server.init defines the names of the fields
that you can use for grouping. The default value of that property
is:
The administrator can change that value. If you specify a column that is not in the list for that property, the server returns an error.Acknowledged,AlertGroup,Class,Customer,Location,Node,NodeAlias,
NmosCauseType,NmosManagedStatus,Severity,Service
Example user view
The following example creates a user view named SeveritySummary
that
has the following characteristics:
- The view includes the following fields formatted as shown:
Table 5. Create user view example: Fields and their formatting Field Field title Data justify Title justify Column width Severity Sev Center Center 5 Acknowledged Ack Center Center 3 Node Node Left Left 12 AlertGroup Alert Group Left Left 10 Summary Summary Left Left 40 LastOccurrence Last Occurrence Left Left 14 - The columns for the Severity and Acknowledged columns are locked.
- The view uses the default data source.
- The view sorts entries in descending order of Severity.
- The view is available to the ncoadmin and tipadmin users.
- The view groups entries by Node
<methodCall>
<method methodName="createView">
<view viewName="SeveritySummary"
user="ncoadmin,tipadmin"
type="user">
<columns>
<visualEntry fieldName="Severity"
fieldTitle="Sev"
dataJustify="centre"
titleJustify="center"
columnWidth="5"
columnLocked="true" />
<visualEntry fieldname="Acknowledged"
fieldTitle="Ack"
datajustify="centre"
titleJustify="center"
columnWidth="3"
columnLocked="true" />
<visualEntry fieldName="Node"
fieldTitle="Node"
dataJustify="left"
titleJustify="left"
columnWidth="12" />
<visualEntry fieldName="AlertGroup"
fieldTitle="Alert Group"
dataJustify="left"
titleJustify=left"
columnWidth="10" />
<visualEntry fieldName="Summary"
fieldTitle="Summary"
dataJustify="left"
titleJustify="left"
columnWidth="40" />
<visualEntry fieldName="LastOccurrence"
fieldTitle="Last Occurrence"
dataJustify="left"
titleJustify="left"
columnWidth="14" />
</columns>
<sorting>
<sortColumn fieldName="Severity" order="desc" />
</sorting>
<grouping>
<groupColumn fieldName="Node" />
</grouping>
</view>
</method>
</methodCall>