Index: trunk/extensions/OpenStackManager/OpenStackNovaInstance.php |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | |Resource Type=instance |
203 | 203 | |Instance Name=%s |
204 | 204 | |Reservation Id=%s |
205 | | -|Instance Id={{PAGENAME}} |
| 205 | +|Instance Id=%s |
206 | 206 | |Private IP=%s |
207 | 207 | |Public IP=%s |
208 | 208 | |Instance State=%s |
— | — | @@ -243,6 +243,7 @@ |
244 | 244 | $text = sprintf( $format, |
245 | 245 | $this->getInstanceName(), |
246 | 246 | $this->getReservationId(), |
| 247 | + $this->getInstanceId(), |
247 | 248 | $this->getInstancePrivateIP(), |
248 | 249 | $this->getInstancePublicIP(), |
249 | 250 | // Since instance state is somewhat dynamic, is this useful? |
Index: trunk/extensions/OpenStackManager/OpenStackNovaProject.php |
— | — | @@ -362,4 +362,31 @@ |
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
| 366 | + function editArticle() { |
| 367 | + if ( ! OpenStackNovaArticle::canCreatePages() ) { |
| 368 | + return; |
| 369 | + } |
| 370 | + |
| 371 | + $format = <<<RESOURCEINFO |
| 372 | +{{Nova Resource |
| 373 | +|Resource Type=project |
| 374 | +|Project Name=%s |
| 375 | +|Members=%s}} |
| 376 | +RESOURCEINFO; |
| 377 | + $rawmembers = $this->getMembers(); |
| 378 | + $members = array(); |
| 379 | + foreach ( $rawmembers as $member ) { |
| 380 | + array_push( $members, 'User:' . $member ); |
| 381 | + } |
| 382 | + $text = sprintf( $format, |
| 383 | + $this->getProjectName(), |
| 384 | + implode( ',', $members ) |
| 385 | + ); |
| 386 | + OpenStackNovaArticle::editArticle( $this->getProjectName(), $text ); |
| 387 | + } |
| 388 | + |
| 389 | + function deleteArticle() { |
| 390 | + OpenStackNovaArticle::deleteArticle( $this->getProjectName() ); |
| 391 | + } |
| 392 | + |
366 | 393 | } |