Index: trunk/extensions/OpenStackManager/OpenStackManager.i18n.php |
— | — | @@ -340,6 +340,7 @@ |
341 | 341 | 'openstackmanager-member' => '{{Identical|Member}}', |
342 | 342 | 'openstackmanager-projectlist' => 'Page title', |
343 | 343 | 'openstackmanager-deleteproject' => 'Page title', |
| 344 | + 'openstackmanager-deletedinstance-faileddns' => 'Tells the user an instance was deleted, but the DNS entry was not. $1 is the specific dns name.' |
344 | 345 | ); |
345 | 346 | |
346 | 347 | /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца)) |
Index: trunk/extensions/OpenStackManager/OpenStackNovaInstance.php |
— | — | @@ -136,6 +136,16 @@ |
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
| 140 | + * Return the host this instance is running on |
| 141 | + * |
| 142 | + * @return string |
| 143 | + */ |
| 144 | + function getInstanceHost() { |
| 145 | + $info = explode( ' ', (string)$this->instance->instancesSet->item->keyName ); |
| 146 | + return str_replace( array(',',')'), '', $info[2] ); |
| 147 | + } |
| 148 | + |
| 149 | + /** |
140 | 150 | * Return the availability zone this instance is associated with |
141 | 151 | * @return string |
142 | 152 | */ |
— | — | @@ -181,6 +191,7 @@ |
182 | 192 | */ |
183 | 193 | function editArticle() { |
184 | 194 | global $wgOpenStackManagerCreateResourcePages; |
| 195 | + global $wgOpenStackManagerNovaAdminKeys; |
185 | 196 | |
186 | 197 | if ( ! $wgOpenStackManagerCreateResourcePages ) { |
187 | 198 | return; |
— | — | @@ -197,7 +208,11 @@ |
198 | 209 | |Private IP=%s |
199 | 210 | |Public IP=%s |
200 | 211 | |Instance State=%s |
| 212 | +|Instance Host=%s |
201 | 213 | |Instance Type=%s |
| 214 | +|RAM Size=%s |
| 215 | +|Number of CPUs=%s |
| 216 | +|Amount of Storage=%s |
202 | 217 | |Image Id=%s |
203 | 218 | |Project=%s |
204 | 219 | |Availability Zone=%s |
— | — | @@ -226,6 +241,8 @@ |
227 | 242 | $puppetvars .= $key . '=' . $val . ','; |
228 | 243 | } |
229 | 244 | } |
| 245 | + $adminNova = new OpenStackNovaController( $wgOpenStackManagerNovaAdminKeys ); |
| 246 | + $instanceType = $adminNova->getInstanceType( $this->getInstanceType() ); |
230 | 247 | $text = sprintf( $format, |
231 | 248 | $this->getInstanceName(), |
232 | 249 | $this->getReservationId(), |
— | — | @@ -233,7 +250,11 @@ |
234 | 251 | $this->getInstancePublicIP(), |
235 | 252 | // Since instance state is somewhat dynamic, is this useful? |
236 | 253 | $this->getInstanceState(), |
| 254 | + $this->getInstanceHost(), |
237 | 255 | $this->getInstanceType(), |
| 256 | + $instanceType->getMemorySize(), |
| 257 | + $instanceType->getNumberOfCPUs(), |
| 258 | + $instanceType->getStorageSize(), |
238 | 259 | $this->getImageId(), |
239 | 260 | $this->getOwner(), |
240 | 261 | $this->getAvailabilityZone(), |
Index: trunk/extensions/OpenStackManager/OpenStackNovaController.php |
— | — | @@ -83,7 +83,20 @@ |
84 | 84 | /** |
85 | 85 | * @return array |
86 | 86 | */ |
87 | | - function getInstanceTypes() { |
| 87 | + function getInstanceType( $instanceType ) { |
| 88 | + $this->getInstanceTypes( false ); |
| 89 | + if ( isset( $this->instanceTypes["$instanceType"] ) ) { |
| 90 | + return $this->instanceTypes["$instanceType"]; |
| 91 | + } else { |
| 92 | + return null; |
| 93 | + } |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * @param $sort |
| 98 | + * @return array |
| 99 | + */ |
| 100 | + function getInstanceTypes( $sort = true ) { |
88 | 101 | global $wgOpenStackManagerNovaResourcePrefix; |
89 | 102 | global $wgOpenStackManagerNovaAdminResourcePrefix; |
90 | 103 | |
— | — | @@ -96,7 +109,9 @@ |
97 | 110 | $this->instanceTypes["$instanceTypeName"] = $instanceType; |
98 | 111 | } |
99 | 112 | $this->novaConnection->set_resource_prefix( $wgOpenStackManagerNovaResourcePrefix ); |
100 | | - OpenStackNovaInstanceType::sort( $this->instanceTypes ); |
| 113 | + if ( $sort ) { |
| 114 | + OpenStackNovaInstanceType::sort( $this->instanceTypes ); |
| 115 | + } |
101 | 116 | return $this->instanceTypes; |
102 | 117 | } |
103 | 118 | |