Commit 1f46f33f authored by Yas Naoi's avatar Yas Naoi
Browse files

Clean up master.

parent 9cc9f728
CHANGE HISTORY
==============
2011/12/21 6.x-1.2 (ver.1.2)
2011/12/21 6.x-1.x-dev (ver.1.2)
- Addition / Improvements
* Added the following modules:
- Dashboard
- Failover
- Metering
- Monitoring
2011/07/02 6.x-1.1 (ver.1.1 Release)
- Addition / Improvements
* Added 'All' tab for listing all templates in
server template module.
- Bug Fixes
* Fixing to prevent database concurrency collision
by adding cron semaphore check to the Refresh page
links.
2011/06/29 6.x-1.x-dev (ver.1.1 RC2)
- Bug Fixes
* Fixed a bug of SSH Key injection
2011/06/25 6.x-1.x-dev (ver.1.1 RC1)
- Addition / Improvements
* Improved SSH Key injection to Java Applet console
* Improved 'soft delete' handling for items in database.
2011/06/23 6.x-1.x-dev (ver.1.1 Beta)
- Addition / Improvements
* Supported AWS multi-region
2011/06/13 6.x-1.01 (ver.1.01 Release)
- Addition / Improvements
* Included IaaS modules
2011/06/10 6.x-1.0 (ver.1.0 Release)
- Addition / Improvements
* Changed the directory structure of IaaS modules
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
Copyright
=========
Copyright (c) 2010-2011 DOCOMO Innovations, Inc.
End of CHANGELOG.txt
\ No newline at end of file
//$Id$
/**
* @file
* An SSH private key transfer applet (from server to client)
*
* Copyright (c) 2010-2011 DOCOMO Innovations, 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
==========
2011/06/23 THIS ARCHIVE IS EMPTY. PLEASE DOWNLOAD AND USE Cloud 6.x-x.x
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 AWS module, XCP 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
* Please see also cloud/modules/iaas/modules/aws_cloud/README.txt for AWS compatible cloud.
* After ver.1.1, the database schema has changed. If you already install
Clanavi 1.01 or less (before 06/10/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
+-cloud_dashboard
+-cloud_failover
+-cloud_inputs
+-cloud_metering
+-cloud_monitoring
+-cloud_pricing
+-cloud_resource_allocator
x-cloud_scaling_manager
+-cloud_scripting
+-cloud_server_templates
x... Not released yet.
hook_* FOR SUBSIDIARY MODULES
=============================
* See also cloud/cloud.api.php
* Example for Sub Cloud Family
e.g. Amazon EC2, XCP 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/12/21 ver.1.2 released 6.x-1.2
2011/07/02 ver.1.1 released 6.x-1.1
2011/06/13 ver.1.01 released 6.x-1.01
2011/06/10 ver.1.0 released 6.x-1.0
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 Innovations, Inc.
End of README.txt
\ No newline at end of file
<?php
/**
* @file
* Hooks provided by Cloud.
* This is a documentation file
*
* Copyright (c) 2010-2011 DOCOMO Innovations, Inc.
*
*/
/**
* This hook lets subclouds implement cloud actions.
* @param string $op
* The operation to be executed: launch, launch_using params,
* terminate, check_key_sg_data, check_key_data, check_sg_data, get_images_count,
* backup, detach_volume, check_snapshot_completion, check_volume_attached_status, check_instance_terminated
* get_instance_lock_status
* NOTE: for get_instance_lock_status, the params array should contain the instance/vm id against the instance_id key, for all clouds
* @param array $params
* An array contain all the required information. The cloud_context is passed
* as one of the array elements.
*/
function hook_cloud_action($op, $params = array()) {
switch ($op) {
case 'launch':
break;
case 'launch_using_params':
break;
case 'terminate':
break;
case 'check_key_sg_data':
break;
case 'check_key_data':
break;
case 'check_sg_data':
break;
case 'get_images_count':
break;
case 'backup':
break;
case 'detach_volume':
break;
case 'check_snapshot_completion':
break;
case 'check_volume_attached_status':
break;
case 'check_instance_terminated':
break;
case 'get_instance_lock_status':
break;
}
}
/**
* This hook returns the list of instances presented in an enabled
* sub-cloud.
* @param string $cloud_context
* The sub-cloud to return information from
* @param array $filter
* An array of filters passed from the UI
*/
function hook_cloud_get_all_instances($cloud_context, $filter = array()) {
//return your instance information from the database
}
/**
* This hook returns data about a particular sub-cloud
* @param string $cloud_context
* The sub-cloud to query and return data
* @param array $filter
* An array of filters passed from the UI
*/
function hook_cloud_get_instance($cloud_context, $filter = array()) {
//return your sub-cloud information
}
/**
* This hook returns the ssh key for a particular user
* @param array $params
* The param array contains the key_name, cloud_context
*/
function hook_cloud_get_ssh_key($params) {
//return your ssh key information from the database
}
/**
* This hook is called when data about a particular sub-cloud
* needs to be downloaded.
* @param string $cloud_context
* The sub-cloud for which the information is to be retrieved
*/
function hook_cloud_update_data($cloud_context) {
//download your cloud data here
}
/**
* This hook sets some initialization information about a
* particular sub-cloud. This hook isn't really utilized
* with the new cloud administration ui. Sub-clouds that
* have not been moved to the new ui still uses this hook
* @param string $cloud_context
* Cloud context is passed if your module implements
* more than one variant of your cloud. For example: the
* OpenStack, Eucalyptus and Amazon EC2 implementations are
* handled by one module. cloud_context is used to distingush
* the different sub-clouds.
*/
function hook_cloud_set_info($cloud_context = '') {
return array(
'cloud_display_name' => DISPLAY_NAME,
'cloud_name' => CONTEXT,
'module' => 'xcp',
'base_cloud' => 'xcp',
'instance_types' => array(
XCP_DEFAULT_INSTANCE_TYPE => XCP_DEFAULT_INSTANCE_TYPE,
),
'cloud_pricing_data' => array(
XCP_DEFAULT_INSTANCE_TYPE => array(
'instance_type' => XCP_DEFAULT_INSTANCE_TYPE,
'description' => t('Default'),
'linux_or_unix_cost' => '0.085',
'windows_cost' => '0.089',
),
),
);
}
/***** New hooks added to cloud module******/
/**
* This hook is called when a sub-cloud row is saved
* into the table cloud_clouds. This allows sub-cloud modules to
* take the data and store it in different places or
* do something else with it. The cloud_pricing and cloud_server_template
* modules have implemented this hook
* @param string $op
* The op can be 'create' or 'edit'
* @param object $cloud
*/
function hook_cloud_save($op, $cloud) {
//do something with the data
}
/**
* This hook is called when a sub-cloud row is
* deleted from the table cloud_clouds. The cloud_pricing
* and cloud_server_template modules have implemented this hook.
* @param unknown_type $cloud_name
*/
function hook_cloud_delete($cloud_name) {
//do something to the sub-cloud
}
/**
* Thsi hook is called to return a specific piece
* of information about a sub-cloud. For example, the
* cloud module will need to retrieve the host_uri, or
* user/password. the aws_cloud module implements this hook.
* @param string $cloud_name
* @param string $key
*/
function hook_cloud_get_info($cloud_name, $key) {
//return any name/value pairs
}
This diff is collapsed.
This diff is collapsed.
name = Cloud
description = Allows users to manage Clouds.
;dependencies[] = n/a
package = Cloud
; UI Scripts
scripts[] = js/cloud.js
core = 6.x
\ No newline at end of file
<?php
/**
* @file
* Install for cloud.module
*
* Copyright (c) 2010-2011 DOCOMO Innovations, 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),
'module' => array('type' => 'varchar' , 'length' => 64),
'base_cloud' => array('type' => 'varchar' , 'length' => 64),
'monitoring_server_url' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 200),
'monitoring_server_user_id' => array('type' => 'varchar', 'not null' => FALSE, 'length' => 64),
'monitoring_server_password' => array('type' => 'varchar', 'not null' => FALSE, '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;
}
/*
* Implementation of hook_update
*/
function cloud_update_6001() {
$ret = array();
db_add_field($ret, CLOUD_CLOUDS_TABLE, 'monitoring_server_url' , array('type' => 'varchar', 'not null' => FALSE, 'length' => 200));
db_add_field($ret, CLOUD_CLOUDS_TABLE, 'monitoring_server_user_id' , array('type' => 'varchar', 'not null' => FALSE, 'length' => 64));
db_add_field($ret, CLOUD_CLOUDS_TABLE, 'monitoring_server_password', array('type' => 'varchar', 'not null' => FALSE, 'length' => 64));
return $ret;
}
; 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[] = cloud
projects[] = drupal_queue
projects[] = rest_client
<?php
/**
* @file
* Enables users to access the Privately managed clouds.
* Provides common functionalites for cloud management.
*
* Copyright (c) 2010-2011 DOCOMO Innovations, Inc.
*
*/
module_load_include('inc', 'cloud', 'cloud_constants');
module_load_include('inc', 'cloud', 'cloud_db');
module_load_include('inc', 'cloud');