Skip to content
Snippets Groups Projects
Commit 3c387ee0 authored by Yas Naoi's avatar Yas Naoi
Browse files

Release ver.0.92.

Change-Id: Ic55bcc0303ff1370bf6b1156dea4a8685c5a787a
parent 93faf46c
No related branches found
No related tags found
No related merge requests found
// $Id:
Clanavi ver.0.92 2011/06/02
CHANGE HISTORY
==============
2011/06/02 ver.0.92 released as dev-6.x-1.x of drupal.org
- Addition / Improvements
* Bundle Image for AWS
2011/04/05 ver.0.91 released to reviewing process of drupal.org
- Bug Fixes
* Fixed pagination (Listing AWS EBS Volumes)
- Addition / Improvements
* XCP NIC Assignment by bonding consideration
2011/03/24 ver.0.9 released to reviewing process of drupal.org
- Bug Fixes
* Improved to "enable / disable" buttons
* Fixing Image Listing
* Filters Feature
* Permissions about AWS API compatible IaaS Families
- Addition / Improvements
* Cosmetic Improvements
* 'Reboot' function for Amazon EC2 (AWS family)
* 'Snapshot' Deletion
* 'Security Group' Management
* 'Lock' Functionality for EC2 and XCP
* Configurable SSH username
* OpenStack nova Support
2011/01/29 ver.0.82 released to reviewing process of drupal.org
- Bug Fixes
* Fixing Cluster functionality
* Fixing other bugs and issues
- Addition / Improvements
* Auto-refresh on instance listing view
* OpenStack nova Support
2010/12/26 ver.0.81 released to reviewing process of drupal.org
2010/12/15 ver.0.8 released to reviewing process of drupal.org
- Addition / Improvements
* Added Cluster, Scripting, Alerts, Inputs modules
2010/11/09 ver.0.7 released to reviewing process of drupal.org
\ No newline at end of file
File added
//$Id$
/**
* @file
* An SSH private key transfer applet (from server to client)
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
package com.clanavi ;
import java.applet.Applet;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import javax.swing.JOptionPane;
public class CloudSSHKeyManager extends Applet {
private static final long serialVersionUID = 1L;
public void init() {
String file_url = getParameter("file_url" ) ;
String fileName = getParameter("private-key") ;
System.out.println("File=" + file_url );
System.out.println("KEY=" + fileName );
String s2 = System.getProperty("java.version");
String s3 = System.getProperty("user.home" );
if (s2.startsWith("1.0")
|| s2.startsWith("1.1")
|| s2.startsWith("1.2")
|| s2.startsWith("1.3")
|| s2.startsWith("1.4"))
JOptionPane.showMessageDialog(this, ( new StringBuilder()).append("Please download latest version of Java ").toString());
String tgtFileName = (new StringBuilder()).append(s3).append("/mindterm/").append(fileName).toString();
String tgtDir = (new StringBuilder()).append(s3).append("/mindterm" ).toString();
File file_dir = new File(tgtDir);
file_dir.mkdirs();
String key = "" ;
try {
URL url;
URLConnection urlConn;
DataInputStream dis;
url = new URL(file_url);
urlConn = url.openConnection();
urlConn.setDoInput(true);
urlConn.setUseCaches(false);
dis = new DataInputStream(urlConn.getInputStream());
String line;
StringBuilder stringBuilder = new StringBuilder();
BufferedReader buffReader = new BufferedReader(new InputStreamReader( urlConn.getInputStream() ) ) ;
while ((line = buffReader.readLine() ) != null) {
stringBuilder.append( line );
stringBuilder.append( "\n" );
}
dis.close();
key = stringBuilder.toString() ;
} catch(MalformedURLException mue) {
mue.printStackTrace();
} catch(IOException ioe) {
ioe.printStackTrace();
}
try {
FileWriter fp = new FileWriter(tgtFileName);
fp.write(key);
fp.flush();
fp.close();
} catch(Exception ex) {
ex.printStackTrace();
return;
}
tgtFileName = (new StringBuilder()).append(s3).append("/.mindterm/").append(fileName).toString();
tgtDir = (new StringBuilder()).append(s3).append("/.mindterm" ).toString();
file_dir = new File(tgtDir);
file_dir.mkdirs();
try {
FileWriter fp = new FileWriter(tgtFileName);
fp.write(key);
fp.write("\n");
fp.flush();
fp.close();
System.out.println("Completed writing . file.. ");
} catch(Exception ex) {
ex.printStackTrace();
return;
}
System.out.println("Completed copying of File.");
}
}
BASIC INFO
==========
- Provides common functionalites for cloud management.
- Cloud module is a heart of cloud package. This requires at least one
"cloud support module" such as Amazon EC2 module, OpenStack XCP or
and so on.
- Once you install the 'Cloud' module be sure to grant the 'access dashboard' permission.
Users with above permission can view all the running instances for the enabled sub-clouds.
- Be sure to only grant 'administer cloud' permission to the cloud administrator.
e.g. (For an administrator)
- Turn on
'administer cloud' and
'access dashboard' permissions
(For a generic users)
- Turn on
'access dashboard' permission only
* After ver.0.83, the database schema has changed. If you already install
Clanavi 0.82 or less (before 01/29/2011), please uninstall and install modules.
SYSTEM REQUIREMENTS
===================
- PHP 5.2 or Higher
- MySQL 5.1 or Higher
- Drupal 6.x
- 512MB Memory: If you use Amazon EC2 module, the running host of this
system requires more than 512MB memory to download a list of images
(because it's huge amount of data for listing).
DIRECTORY STRUCTURE
===================
cloud
+-modules (depends on Cloud module)(Cloud is a core module for Cloud package)
+-cloud_activity_audit
+-cloud_alerts
x-cloud_auto_scaling
+-cloud_billing
+-cloud_cluster
x-cloud_failover
+-cloud_inputs
+-cloud_pricing
+-cloud_resource_allocator
x-cloud_scaling_manager
+-cloud_scripting
+-cloud_server_templates
x... Not released yet.
hook_* FOR SUBSIDIARY MODULES
=============================
- hook_cloud_set_info()
- hook_server_template()
- hook_get_all_instances()
* Example for Sub Cloud Family
e.g. Amazon EC2, XCP, OpenStack nova and so on...
function hook_cloud_set_info() {
return array(
'cloud_name' => 'generic_cloud_context', // Used for cloud ID
'cloud_display_name' => 'Generic Cloud' , // Uuser for display name in menu, etc.
'instance_types' => array(
)
);
}
function hook_server_template($op, $params = array())
$form = array( // make some form);
return $form;
}
CHANGE HISTORY
==============
2011/06/02 ver.0.92 released 6.x-1.x-dev
2011/04/05 ver.0.91 released to reviewing process of drupal.org
2011/03/24 ver.0.9 released to reviewing process of drupal.org
2011/01/29 ver.0.82 released to reviewing process of drupal.org
2010/12/26 ver.0.81 released to reviewing process of drupal.org
2010/12/15 ver.0.8 released to reviewing process of drupal.org
2010/11/09 ver.0.7 released to reviewing process of drupal.org
Copyright
=========
Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
End of README.txt
\ No newline at end of file
This diff is collapsed.
cloud.inc 0 → 100644
This diff is collapsed.
name = Cloud
description = Allows users to manage Clouds.
;dependencies[] = n/a
version = 6.x-1.x-dev
core = 6.x
package = Cloud
; UI Scripts
scripts[] = js/cloud.js
\ No newline at end of file
<?php
/**
* @file
* Install for cloud.module
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
module_load_include('inc', 'cloud', 'cloud_constants');
/**
* Implementation of hook_install().
*/
function cloud_install() {
// Create tables.
drupal_install_schema('cloud');
}
/**
* Implementation of hook_uninstall().
*/
function cloud_uninstall() {
// Remove tables.
drupal_uninstall_schema('cloud');
// clean up variables
// variable_del('cloud_resource_allocator'); for example
}
/**
* Implementation of hook_schema().
*/
function cloud_schema() {
$schema = array();
$schema[CLOUD_CLOUDS_TABLE] = array(
'description' => t('Master Cloud Information Table'),
'fields' => array(
'cloud_name' => array('type' => 'varchar' , 'length' => 64),
'cloud_id' => array('type' => 'int' , 'length' => 3),
'start_duration' => array('type' => 'int' , 'length' => 3),
'scaling_server_url' => array('type' => 'varchar' , 'length' => 100),
'last_update_time' => array('type' => 'datetime', 'length' => 64),
'host_entries_refresh_time' => array('type' => 'int' , 'length' => 3),
'cloud_display_name' => array('type' => 'varchar' , 'length' => 64),
),
'primary key' => array('cloud_name'),
);
$schema[CLOUD_TEMP_TABLE] = array(
'description' => t('Temporary Information Table'),
'fields' => array(
'LAST_TIME' => array('type' => 'varchar', 'length' => 100),
'VALUE' => array('type' => 'text' ),
'FIELD' => array('type' => 'varchar', 'length' => 100),
)
);
return $schema;
}
<?php
/**
* @file
* Enables users to access the Privately managed clouds.
* Provides common functionalites for cloud management.
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
module_load_include('inc', 'cloud', 'cloud_constants');
module_load_include('inc', 'cloud', 'cloud_db');
module_load_include('inc', 'cloud');
/**
* Implementation of hook_init().
*/
function cloud_init() {
drupal_add_link(array(
'type' => 'text/css',
'rel' => 'stylesheet',
'media' => 'all',
'href' => base_path()
. drupal_get_path('module', 'cloud')
. CLOUD_PATH_SEPARATOR
. 'css/cloud.css')
);
}
/**
* Implementation of hook_help().
*/
function cloud_help($section) {
switch ($section) {
case 'admin/help#':
$output = '<p>' . t('The cloud module creates a user interface for users to manage clouds. Users can Create Instances, Describe Instances etc..') . '</p>';
return $output;
case 'admin/content/comment':
case 'admin/content/comment/create':
return '<p>' . t("Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information , 'edit' to modify the text, and 'delete' to remove their submission.") . '</p>';
case 'admin/content/comment/approval':
return '<p>' . t("Below is a list of the comments posted to your site that need approval. To approve a comment, click on 'edit' and then change its 'moderation status' to Approved. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") . '</p>';
case 'admin/content/comment/settings':
return '<p>' . t("Comments can be attached to any node, and their settings are below. The display comes in two types: a 'flat list' where everything is flush to the left side, and comments come in chronological order, and a 'threaded list' where replies to other comments are placed immediately below and slightly indented, forming an outline. They also come in two styles: 'expanded', where you see both the title and the contents, and 'collapsed' where you only see the title. Preview comment forces a user to look at their comment by clicking on a 'Preview' button before they can actually add the comment.") . '</p>';
}
}
/**
* Implementation of hook_menu()
*/
function cloud_menu() {
$items = array();
$access = user_access('access dashboard');
$items['clouds'] = array(
//'path' => 'design',
'title' => 'Clouds',
'description' => 'Multiple Clouds',
//'type' => MENU_SUGGESTED_ITEM,
'page callback' => '_cloud_all_instances',
'access arguments' => array('access dashboard'),
'weight' => -10,
'file' => ''
);
$items['clouds/getdata'] = array(
'title' => 'Clouds get data',
'description' => 'Get data of sub clouds.',
'page callback' => '_cloud_fetch_data',
'access arguments' => array('access dashboard'),
'weight' => -10,
'file' => '' ,
'type' => MENU_CALLBACK,
);
$items['clouds/callback_get_all_instances_list'] = array(
'page callback' => '_cloud_callback_get_all_instances_list',
'type' => MENU_CALLBACK,
'access arguments' => array('access dashboard'),
);
return $items;
}
/**
* Implementation of hook_perm().
*/
function cloud_perm() {
return array(
'access dashboard' ,
'administer cloud' ,
);
}
/**
* Returns a form to get list of instances
* under all the cloud together
*
* @return return a dashboard form
*/
function _cloud_all_instances() {
return drupal_get_form('cloud_display_dashboard') ;
}
/**
* Implementation of hook_theme().
*/
function cloud_theme() {
return array(
'cloud_display_dashboard' => array(
'arguments' => array('form' => NULL),
),
);
}
/**
* Modules notify Cloud module when uninstalled, disabled, etc.
*
* @param string $op
* the module operation: uninstall, install, enable, disable
* @param string $module
* the name of the affected module.
*/
function cloud_notify($op, $module ) {
switch ($op) {
case 'install' :
case 'uninstall':
case 'enable' :
case 'disable' :
// for cloud sub system
_cloud_set_info ($op, $module) ;
// for resource allocator
break;
}
}
/**
* To fetch the data of sub_clouds info
* @return return a sub-cloud data and redirect to cloud dashboard page
*/
function _cloud_fetch_data() {
cloud_update_all_cloud_data() ;
// Return to the Common Clouds Page
drupal_goto( 'clouds' ) ;
}
function cloud_update_all_cloud_data() {
// TODO: Make CONSTANT (by Jamir)
set_time_limit(1000) ;
$cloud_list = cloud_get_all_clouds();
$cloud_display_list = cloud_get_all_clouds_display_name() ;
foreach ($cloud_list as $cloud_context) {
$is_cloud_enabled = cloud_is_settings_done($cloud_context) ;
if ($is_cloud_enabled === FALSE ) {
// Skip this Cloud since it is not configured
if (user_access($cloud_context . ' administer cloud')) {
$admin_url = filter_xss( l( t('@cloud_name Settings', array('@cloud_name' => $cloud_display_list[$cloud_context])), "admin/settings/$cloud_context" ) );
}
else {
$admin_url = $cloud_display_list[$cloud_context] ;
}
drupal_set_message(check_plain(t('The variables are not correctly configured: ')) . $admin_url, 'error');
continue ;
}
module_invoke($cloud_context, 'cloud_update_data') ;
}
}
/**
* Cloud Module Action
* This function is used to perform action on the sub-cloud
* @param string $templateid
* Server template id : The template on whcih the action is to be performed
* @param string $op
* the operation: launch, terminate to be executed
* @param string $cloud_context
* The sub-cloud on which the operation is to be executed
* @param string $params
* The parameters to be passed
*
*/
function cloud_perform_action($templateid = '', $op, $cloud_context = '' , $params = array(), $all = '' ) {
$params['templateid'] = $templateid ;
$params['all' ] = $all;
$cloud_list = cloud_get_all_clouds();
$cloud_display_list = cloud_get_all_clouds_display_name() ;
// Check if Cloud is enabled
$is_cloud_enabled = cloud_is_settings_done($cloud_context) ;
if ($is_cloud_enabled === FALSE ) {
// Skip this Cloud since it is not configured
if (user_access($cloud_context . ' administer cloud')) {
$admin_url = filter_xss( l( t('@cloud_name Settings', array('@cloud_name' => $cloud_display_list[$cloud_context])), "admin/settings/$cloud_context" ) );
}
else {
$admin_url = $cloud_display_list[$cloud_context] ;
}
drupal_set_message(check_plain(t('The variables are not correctly configured: ')) . $admin_url, 'error');
return ;
}
return module_invoke( $cloud_context, 'cloud_action', $op, $params ) ;
}
<?php
/**
* @file
* This is the base class of all Cloud module family.
* Basically this test case does nothing.
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
module_load_include('test', 'amazon_ec2') ;
class CloudTestCase extends DrupalWebTestCase {
protected $privileged_user;
public static function getInfo() {
return array(
'name' => 'Cloud' ,
'description' => 'Cloud Test Cases',
'group' => 'Cloud' ,
);
}
public function setUp() {
// Enable any modules required for the test.
parent::setUp(
'cloud' ,
'cloud_server_templates',
'cloud_scripting' ,
'cloud_pricing' ,
'cloud_alerts' ,
'cloud_activity_audit' ,
'cloud_cluster' ,
'aws_ec2_api' ,
'aws_ec2_lib' ,
'aws' ,
'amazon_ec2' ,
'openstack_nova'
);
// Create and log in our privileged user.
$this->privileged_user = $this->drupalCreateUser(array(
// system module
'access administration pages' ,
'administer site configuration' ,
// Cloud module
'administer cloud' ,
'access dashboard' ,
// amazon_ec2 module
'amazon_ec2 administer cloud' ,
'amazon_ec2 list instances' ,
'amazon_ec2 launch instance' ,
'amazon_ec2 terminate all instances',
'amazon_ec2 terminate own instance' ,
'amazon_ec2 access all console' ,
'amazon_ec2 access own console' ,
'amazon_ec2 list images' ,
'amazon_ec2 register image' ,
'amazon_ec2 delete image' ,
'amazon_ec2 list key fingerprints' ,
'amazon_ec2 list key names' ,
'amazon_ec2 register key' ,
'amazon_ec2 update key' ,
'amazon_ec2 delete key' ,
'amazon_ec2 list IPs' ,
'amazon_ec2 add IP' ,
'amazon_ec2 delete IP' ,
'amazon_ec2 assign IP' ,
'amazon_ec2 update instance details',
'amazon_ec2 list security group' ,
'amazon_ec2 register security group',
'amazon_ec2 setup security group' ,
'amazon_ec2 delete security group' ,
'amazon_ec2 list volume' ,
'amazon_ec2 create volume' ,
'amazon_ec2 delete volume' ,
'amazon_ec2 attach volume' ,
'amazon_ec2 detach volume' ,
'amazon_ec2 list snapshot' ,
'amazon_ec2 create snapshot' ,
'amazon_ec2 delete snapshot' ,
'amazon_ec2 display cpu load' ,
'amazon_ec2 display traffic amount' ,
'amazon_ec2 display storage space' ,
'amazon_ec2 list template' ,
'amazon_ec2 create template' ,
'amazon_ec2 update template' ,
'amazon_ec2 update own template' ,
'amazon_ec2 delete template' ,
'amazon_ec2 delete own template' ,
'amazon_ec2 copy template' ,
'amazon_ec2 access report' ,
// openstack_nova module
'openstack_nova administer cloud' ,
'openstack_nova list instances' ,
'openstack_nova launch instance' ,
'openstack_nova terminate all instances',
'openstack_nova terminate own instance' ,
'openstack_nova access all console' ,
'openstack_nova access own console' ,
'openstack_nova list images' ,
'openstack_nova register image' ,
'openstack_nova delete image' ,
'openstack_nova list key fingerprints' ,
'openstack_nova list key names' ,
'openstack_nova register key' ,
'openstack_nova update key' ,
'openstack_nova delete key' ,
'openstack_nova list IPs' ,
'openstack_nova add IP' ,
'openstack_nova delete IP' ,
'openstack_nova assign IP' ,
'openstack_nova update instance details',
'openstack_nova list security group' ,
'openstack_nova register security group',
'openstack_nova setup security group' ,
'openstack_nova delete security group' ,
'openstack_nova list volume' ,
'openstack_nova create volume' ,
'openstack_nova delete volume' ,
'openstack_nova attach volume' ,
'openstack_nova detach volume' ,
'openstack_nova list snapshot' ,
'openstack_nova create snapshot' ,
'openstack_nova delete snapshot' ,
'openstack_nova display cpu load' ,
'openstack_nova display traffic amount' ,
'openstack_nova display storage space' ,
'openstack_nova list template' ,
'openstack_nova create template' ,
'openstack_nova update template' ,
'openstack_nova update own template' ,
'openstack_nova delete template' ,
'openstack_nova delete own template' ,
'openstack_nova copy template' ,
'openstack_nova access report' ,
// Activity Audit module
'access audit report' ,
// Server Template module
'copy server template' ,
'create server template' ,
'delete server template' ,
'edit server template' ,
'launch server template' ,
'list server templates' ,
'set scripts and alerts' ,
'view server template' ,
// Alerts module
'list alerts' ,
'create alert' ,
'view alerts' ,
'edit alert' ,
'delete alert' ,
// Cluster
'create cluster',
'delete cluster',
'list clusters' ,
'update cluster',
// Scripting module
'create script' ,
'list scripts' ,
'edit script' ,
'delete script' ,
// Pricing module
'create pricing',
'list pricing' ,
'edit pricing' ,
'delete pricing',
));
$this->drupalLogin($this->privileged_user);
AmazonEC2TestCase::configure();
OpenStackNovaTestCase::configure();
}
public function tearDown() {
//Delete the temporary SSH Keys created.
$key_name = $this->privileged_user->name ;
AmazonEC2TestCase::release($key_name);
OpenStackNovaTestCase::release($key_name);
parent::tearDown() ;
}
}
\ No newline at end of file
<?php
/**
* @file
* This is a supplemental file for launching a SSH console.
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
<?php
/**
* @file
* Defines constants for cloud.module
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
/**
* @file
* Provides common functionalites for cloud management.
*/
// TODO: Make CONSTANT (by Jamir)
set_time_limit(5000);
//project name as a prefix to all project specific tables
define('CLOUD_PREFIX' , 'cloud_' ) ;
define('CLOUD_NONE' , '- none -' ) ;
define('CLOUD_CLOUDS_TABLE' , CLOUD_PREFIX . 'clouds' ) ;
define('CLOUD_TEMP_TABLE' , CLOUD_PREFIX . 'temp_table' ) ;
define('CLOUD_INSTANCE_TYPE_TABLE' , CLOUD_PREFIX . 'instance_types' ) ;
define('CLOUD_PAGER_LIMIT' , 50 ) ;
define('CLOUD_SSH_USER_NAME' , 'root' ) ;
define('CLOUD_RRD_FILE' , 'rrd.php' ) ;
define('CLOUD_REMOTE_SNMP_MANAGER' , 'cloud_snmp_manager.php' ) ;
// This Module Name list will be mainly used to check whether the Module is enabled or no.
//for linux
define('CLOUD_PATH_SEPARATOR' , '/' ) ;
define('CLOUD_PHP_PATH' , 'php' ) ;
define('CLOUD_SSH_PATH' , 'ssh' ) ;
define('CLOUD_SCP_PATH' , 'scp' ) ;
define('CLOUD_HOST_ENTRIES_REFRESH_TIME', 5 ) ;
define('CLOUD_INPUTS_PARAMETER_VALUES_TABLE', CLOUD_PREFIX . 'inputs_parameter_values' ) ;
define('CLOUD_INSTANCE_STATUS_BOOTING' , 'booting' ) ;
define('CLOUD_INSTANCE_STATUS_OPERATIONAL' , 'operational' ) ;
/**
* DIGIT [0-9] only without decimal point. int value only
*/
define('CLOUD_VALID_DIGIT', '/^[0-9]+$/');
<?php
/**
* @file
* Test Cases for Cloud Module.
* This test case is the base class of all Cloud module family.
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
module_load_include('test', 'amazon_ec2' ) ;
module_load_include('test', 'cloud_activity_audit') ;
class CloudCronTestCase extends AmazonEC2TestCase {
public static function getInfo() {
return array(
'name' => 'Cron' ,
'description' => 'Cloud cron Test Case' ,
'group' => 'Cloud' ,
);
}
public function testCron() {
$this->cronRun();
// List Activity Audit
$this->drupalGet('reports/activity_audit/report');
$this->assertResponse(200, t('HTTP 200: Report | Activity Audit'));
$this->assertText(t('Updated: Instances'),
t('Confirm Message: ') . t('Updated: Instances'));
$this->assertText(t('Updated: SSH Key(s)'),
t('Confirm Message: ') . t('Updated: SSH Key(s)'));
$this->assertText(t('Updated: User Key(s)'),
t('Confirm Message: ') . t('Updated: User Key(s)'));
$this->assertText(t('Updated: Security Group(s)'),
t('Confirm Message: ') . t('Updated: Security Group(s)'));
$this->assertText(t('Updated: Availability Zone(s)'),
t('Confirm Message: ') . t('Updated: Availability Zone(s)'));
$this->assertText(t('Updated: Snapshot(s)'),
t('Confirm Message: ') . t('Updated: Snapshot(s)'));
$this->assertText(t('Updated: Elastic IP(s)'),
t('Confirm Message: ') . t('Updated: Elastic IP(s)'));
// http://localhost/clouds
$this->drupalGet('clouds');
$this->assertText(t('Running'), t('Found: Running'));
// http://localhost/clouds/amazon_ec2/instances/clouds
$this->drupalGet('clouds/amazon_ec2/instances');
$this->assertText(t('Running'), t('Found: Running'));
// http://localhost/clouds/amazon_ec2/security_groups
$this->drupalGet('clouds/amazon_ec2/security_groups');
$this->assertText(t('default'), t('Found: default'));
// http://localhost/clouds/amazon_ec2/ssh_keys
$this->drupalGet('clouds/amazon_ec2/ssh_keys');
$this->assertText(t('default'), t('Found: default'));
// http://localhost/clouds/amazon_ec2/elastic_ips
$this->drupalGet('clouds/amazon_ec2/elastic_ips');
$this->assertText(t('.'), t('Found: IP'));
// http://localhost/clouds/amazon_ec2/ebs_volumes
$this->drupalGet('clouds/amazon_ec2/ebs_volumes');
$this->assertText(t('vol-'), t('Found: vol-'));
// http://localhost/clouds/amazon_ec2/ebs_snapshots
$this->drupalGet('clouds/amazon_ec2/ebs_snapshots');
$this->assertText(t('snap-'), t('Found: snap-'));
}
}
<?php
/**
* @file
* Provides common database-related functionalites for cloud management.
*
* Copyright (c) 2010-2011 DOCOMO Communications Laboratories USA, Inc.
*
*/
/**
* update cloud table with latest timestamp
* @return unknown_type
*/
function cloud_update_host_entries_last_update_time($cloud_context) {
db_query( 'update {' . CLOUD_CLOUDS_TABLE . "} set last_update_time = CURRENT_TIMESTAMP where cloud_name = '" . $cloud_context . "' ");
// User Activity Log
cloud_audit_user_activity( array(
'type' => 'user_activity',
'message' => t('Cloud has been modified: @cloud_context', array('@cloud_context' => $cloud_context)),
'link' => '', //'design/alerts/create&id=' . $alert_id
)
);
return;
}
function cloud_get_all_scripts($type) {
$query = _cloud_scripting_get_scripts() ;
//$query .= tablesort_sql( array(array('field' => 'name', 'sort' => 'asc')) ) ;
$script_options = array();
$query_args[] = 'type' ;
$query_args[] = $type ;
$result = db_query( $query, $query_args );
while ($script = db_fetch_object($result)) {
$script_options[$script->id] = $script->name ;
}
//asort($script_options);
return $script_options ;
}
.deleteIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icn_delete.png) no-repeat;
}
.deleteIcon a:hover {
background-position: -50px 0;
}
.stopIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/action_stop.png) no-repeat;
}
.stopIcon a:hover {
background-position: -50px 0px;
}
.playIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icn_play.png) no-repeat;
}
.playIcon a:hover {
background-position: -50px 0px;
}
.launchIcon a {
display: block;float:left;margin:1px;
width: 16px;
height: 16px;
background: transparent url(../images/icon_launch.png) no-repeat;
}
.launchIcon a:hover {
background-position: 0 -16px;
}
.copyIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_copy.png) no-repeat;
}
.copyIcon a:hover {
background-position: -50px 0px;
}
.downIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_failover_down.png) no-repeat;
}
.downIcon a:hover {
background-position: -50px 0px;
}
.servicedownIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_failover_service_down.png) no-repeat;
}
.servicedownIcon a:hover {
background-position: -50px 0px;
}
.failupIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_failover_up.png) no-repeat;
}
.failupIcon a:hover {
background-position: -50px 0px;
}
.editIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_edit.png) no-repeat;
}
.editIcon a:hover {
background-position: -50px 0px;
}
.monitorIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_monitor.png) no-repeat;
}
.monitorIcon a:hover {
background-position: -50px 0px;
}
.icon_monitorGray a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_monitorGray.png) no-repeat;
}
.icon_monitorGray a:hover {
background-position: -50px 0px;
}
.monitorGreenIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_monitorGreen.png) no-repeat;
}
.monitorGreenIcon a:hover {
background-position: -50px 0px;
}
.monitorstopIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_monitor_stop.png) no-repeat;
}
.rebootIcon a:hover {
background-position: -50px 0px;
}
.rebootIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_reboot.png) no-repeat;
}
.monitorstopIcon a:hover {
background-position: -50px 0px;
}
.lockIcon{
margin: 1px 1px 1px 3px!important;
padding: 1px 1px 2px 1px;
width: 18px;
height: 17px;
background: transparent url(../images/icon_padlock.png) no-repeat;
cursor: default;
text-decoration: none;
}
.lockIcon:hover{
text-decoration: none;
background-position: -50px 0px;
}
.lockIcon_h {
margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_padlock.png) no-repeat;
background-position: -50px 0px;
cursor: default;
}
.sshIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_ssh.png) no-repeat;
}
.sshIcon a:hover {
background-position: -50px 0px;
}
.tableIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_table_inputs.png) no-repeat;
}
.tableIcon a:hover {
background-position: -50px 0px;
}
.shutdownIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_hardshutdown.png) no-repeat;
}
.shutdownIcon a:hover {
background-position: -50px 0px;
}
.resumeIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_resume.png) no-repeat;
}
.resumeIcon a:hover {
background-position: -50px 0px;
}
.suspendIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_suspend.png) no-repeat;
}
.suspendIcon a:hover {
background-position: -50px 0px;
}
.hardrebootIcon a {
display: block;float:left;margin:1px;
width: 18px;
height: 18px;
background: transparent url(../images/icon_hardreboot.png) no-repeat;
}
.hardrebootIcon a:hover {
background-position: -50px 0px;
}
table.hide-action-column {}
table.hide-action-column tr {
overflow: visible;
}
table.sticky-header th.action-column {
display: none;
}
table.hide-action-column .action-column {
display: none;
position:absolute;
left: 0px;
width: 100px;
z-index:99;
background-color: #EDF5FA;
border-top: 1px solid #EDF5FA;
border-right: 1px solid #D3E7F4;
border-bottom: 1px solid #D3E7F4;
border-left: 1px solid #D3E7F4;
box-shadow: 0px 1px 1px #bbb;
-moz-box-shadow: 0px 1px 1px #bbb;
-webkit-box-shadow: 0px 1px 1px #bbb;
}
table.hide-action-column tr.even .action-column {
border-top: 1px solid #fff;
background-color: #fff;
}
table.hide-action-column .nickname-column a {
display:block;
white-space:nowrap;
float: left;
}
.action_toggle_icon {
background: transparent url('../images/btn_action_toggle_arrow_sprite.png') -50px 0 no-repeat;
float: left;
display: block;
height: 16px;
width: 16px;
margin: 2px 5px 0 0;
overflow: hidden;
}
.action_toggle_icon_on {
background-position: 0px 0px;
}
\ No newline at end of file
; Clanavi makefile
; ----------------
; This make file will pull all the clanavi related modules from Drupal.org
core = 6.x
api = 2
projects[] = drupal
projects[] = aws
projects[] = drupal_queue
projects[] = rest_client
projects[cloud][type] = module
projects[cloud][download][type] = git
projects[cloud][download][url] = http://git.drupal.org/sandbox/yas/1075708.git
projects[] = iaas
projects[] = simpletest
images/action_stop.png

2.06 KiB

images/btn_action_toggle_arrow_sprite.png

1.9 KiB

images/graph_error.png

20.2 KiB

images/icn_delete.png

2.36 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment