5.1.2 VPC Management

The VPC Management page has a table for displaying VPCs and reservations, a set of buttons above the table for operating on a row selected in the table, and configurable panels for displaying individual VPCs or reservations in detail. All these components can be configured in vpcs.xml. The format of the related XML is given below.

<vpcs>
  ...
  <vpc-management>
    <controls>
      ...
    </controls>
    <table>
      ...
    </table>
    <vpc-details>
      ...
    </vpc-details>
    <reservation-details>
      ...
    </reservation-details>
  </vpc-management>   
</vpcs>

By default, users can only see their own VPCs (even administrators). To allow users to see all VPCs, they must have the vpc.readall permission.

5.1.2.1 Configuring the Table

The VPC Management table can be configured at the column-level to show different attributes for VPCs and reservations. To do so, modify the <fields> child element of the <table> element. Each child element of <fields> corresponds to a single column and the columns appear in the same order that the child elements are specified. The name of each element corresponds to the type of the column. This type knows how to extract information from a table record to display in the column and also contains sensible defaults for display options of the column. The allowed field types are:

All field types have these attributes:

All field types have this child element:

In addition to the above fields, the <table> element supports a special kind of column named "composite". The composite column allows you to display a value based on the basic fields listed above by using the value decider framework. Each field can be accessed with <component> elements. You must specify a width and a title for the <component> element. The contents of the <value> element constitute the value decider portion that determines the form of the column values. The basic structure of a <composite> element is below:

<composite width="100">
  <title>Column title</title>
  <value>
    ... 
  </value>
</composite>

An example VPC table configuration is given below:

<vpc-management>
  <table>
    <fields>
      <id primary="true" visible="false"/>
      <name width="100"/>
      <type/>
      <start-date/>
      <end-date/>
      <resource-group/>
      <state/>
      <cpu>
        <title>CPUs</title>
      </cpu>
      <memory/>
      <disk-size>
        <title>Size</title>
      </disk-size>
      <variable name="VPCID">
        <title>VPC ID</title>
      </variable>
    </fields>
  </table>
</vpc-management>

5.1.2.2 Primary Keys

In order for many features of the VPC Management page to work properly, you must configure at least one field to be a primary key field. We strongly recommend creating an id field as the sole primary key field. You can make this field invisible if you don't want users to see it.

5.1.2.3 Hiding Reservations

(Since Viewpoint 2.0 only) If any reservation has the "VP_IS_VISIBLE" variable set to "false", Viewpoint will not show this reservation in the VPC management page. This variable can be used to hide reservations that contain supplemental resources to the main virtual machine reservation.

5.1.2.4 Above-Table Buttons

The above-table buttons are configured in the <controls> child element of <server-management>. Supported elements are listed below. Note that some buttons are only valid for a particular record type (VPC or reservation). Buttons disable themselves when their surrounding context is invalid such as if the button requires a selected record but no table record is selected, or if the type of the selected record doesn't apply to the button.

In addition to specifying an action type via the element's name, you can configure the display of the button using any of the following attributes.

You can also specify the permission access for each button with the <permissions> child element. This element can contain a sequence of <permission> elements that specifiy a Viewpoint permission a user needs in order to see and use the button. An example permissions configuration might be:

<manage-users>
  <permissions>
    <permission name="vpc.update"/>
    <permission name="vpc.users"/>
  </permissions>
</manage-users>  

In this example, a user can only use the manage-users button if they have the vpc.update permission and the vpc.users permission.

5.1.2.5 Details Panel

The VPC Management page contains two panels, one for displaying a VPC in detail and the other for displaying a reservation in detail. These sections are configured in the <vpc-details> and <reservation-details> child elements of <vpc-management>. You can configure a title, a set of buttons, and a list of sections that display information in these panels. The title can contain field references that are replaced with the value of the field of the current object being viewed. Allowable fields are those available for the VPC table. Most of these fields are specified by prefixing a field name with a dollar sign ($) and optionally wrapping it in curly brackets({}). Examples include $id, ${name}, and $cpu. Additionally, you can display a variable in the title using the map variable syntax, which suffixes the field name with a key enclosed in square brackets. For example, the reference $variable[VPCID] would be substituted with the value of the variable "VPCID" in the title.

5.1.2.5.1 Buttons

Each details panel contains a buttons section that has the same structure as the above-table buttons. They actually support an arbitrary menu structure, but that structure is more likely to be used in the details panel. That is, in addition to the button elements described above, a submenu can be created with a menu element that itself contains child elements. Arbitrarily nested menus can thus be created. Besides containing child elements, a menu element can also specify a boolean attribute vertical, which defaults to "true", that specifies the menu's layout direction. Furthermore, a menu itself can have permissions just like a button. If a user doesn't have permissions to view a menu, then he or she will not see the menu or any of its sub-elements.

The scope of a details panel button is the panel itself. Because of this, buttons that require a record to be selected in the VPC table, if they were placed above the table, treat the record displayed in the details panel as the selected record. Also, the refresh button refreshes only the details panel.

An example reservation buttons configuration is:

<reservation-details>
  <controls>
    <menu label="Reservation Actions"/>
      <permissions>
        <permission name="reservation.update"/>
      </permissions>
    <clone-reservation/>
      <modify-reservation/>
      <delete>
        <permissions>
          <permission name="reservation.delete"/>
        </permissions>
      </delete>
    </menu>
  </controls>
</reservation-details>
VPC Details Buttons

The VPC details panel supports the generic above-table buttons (Refresh and Delete), as well as the VPC-specific above-table buttons (Add-reservation, Manage-users, Modify-VPC-duration, and Restore-reservation).

Reservation Details Buttons

The reservation details panel supports the generic above-table buttons (Refresh and Delete) as well as the reservation-specific above-table buttons (Modify-reservation, Clone-reservation, and Archive-reservation).

5.1.2.5.2 Sections

Each details panel section specified in XML corresponds to a collapsible section in the details panel. A section itself consists of a title (with no variable interpolation) and a <fields> element that contains a list of fields. These fields have names that correspond directly to the table fields described previously in the fields section.

In addition, the following fields are supported for both panels:

VPC-specific Fields
5.1.2.5.3 Example

You can expand the sample code window below for an example of what a complete VPC details panel might look like:

<vpc-details>
  ...
  <sections>
    <section>
      <title>General</title>
      <fields>
        <name/>
        <owner/>
        <state/>
        <cost/>
      </fields>
    </section>
    <section>
      <title>Time</title>
      <fields>
        <start-date/>
        <end-date editable="true"/>
        <duration/>
      </fields>
    </section>
    <section>
      <title>resources</title>
      <fields>
        <resource-group/>
        <reservations/>
      </fields>
    </section>
  </sections>
</vpc-details>
Editable Fields

Only one field is supported as being editable—the VPC details <end-date> field. The above example shows how to configure the field to be editable. The editable <end-date> field allows a user to select an end date with a date picker at the granularity of days instead of months and provides no means of configuring any logic related to fiscal year end dates.