| 148 | |
| 149 | Now, finally we need a wires table entry: |
| 150 | |
| 151 | {{{ |
| 152 | insert into wires set node_id1='apc23', card1=0, port1=1, |
| 153 | node_id2='hp1', card2=0, port2=4, |
| 154 | type='Control'; |
| 155 | }}} |
| 156 | |
| 157 | === Telling the database about the power controller ports === |
| 158 | |
| 159 | This is jumping the gun since we have not gotten to the point of adding PC type nodes to the testbed yet, but when we do, they will go in the '''outlets''' table. |
| 160 | |
| 161 | {{{ |
| 162 | mysql> describe outlets; |
| 163 | +------------+---------------------+------+-----+-------------------+-------+ |
| 164 | | Field | Type | Null | Key | Default | Extra | |
| 165 | +------------+---------------------+------+-----+-------------------+-------+ |
| 166 | | node_id | varchar(32) | NO | PRI | | | |
| 167 | | power_id | varchar(32) | NO | | | | |
| 168 | | outlet | tinyint(1) unsigned | NO | | 0 | | |
| 169 | | last_power | timestamp | NO | | CURRENT_TIMESTAMP | | |
| 170 | +------------+---------------------+------+-----+-------------------+-------+ |
| 171 | 4 rows in set (0.00 sec) |
| 172 | }}} |
| 173 | |
| 174 | So to add, say pc001 which is on apc23 port 1, we would do: |
| 175 | |
| 176 | {{{ |
| 177 | insert into outlets set node_id='pc001', power_id='apc23', outlet=1; |
| 178 | }}} |
| 179 | |
| 180 | You can add in a dummy entry and test if you like. |