Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5FC118B17 for ; Wed, 6 May 2015 11:21:23 +0000 (UTC) Received: (qmail 88437 invoked by uid 500); 6 May 2015 11:20:49 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 88378 invoked by uid 500); 6 May 2015 11:20:48 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 86378 invoked by uid 99); 6 May 2015 11:20:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2015 11:20:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 473E6E359E; Wed, 6 May 2015 11:20:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bhaisaab@apache.org To: commits@cloudstack.apache.org Date: Wed, 06 May 2015 11:21:35 -0000 Message-Id: In-Reply-To: <1923f65f103343f2a9d8170fa6d9d37b@git.apache.org> References: <1923f65f103343f2a9d8170fa6d9d37b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [50/53] [abbrv] [partial] git commit: updated refs/heads/nuke-awsapi to 43cfc45 http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/cloudbridge_multipart.sql ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/cloudbridge_multipart.sql b/awsapi-setup/db/mysql/cloudbridge_multipart.sql deleted file mode 100644 index e30c0ce..0000000 --- a/awsapi-setup/db/mysql/cloudbridge_multipart.sql +++ /dev/null @@ -1,77 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. - -USE cloudbridge; - --- This file can be applied to an existing cloudbridge database. It is used --- to keep track of in progress multipart file uploads. --- -SET foreign_key_checks = 0; - -DROP TABLE IF EXISTS multipart_uploads; -DROP TABLE IF EXISTS multipart_meta; -DROP TABLE IF EXISTS multipart_parts; - --- We need to keep track of the multipart uploads and all the parts of each upload until they --- are completed or aborted. --- The AccessKey is where we store the AWS account id --- -CREATE TABLE multipart_uploads ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - AccessKey VARCHAR(150) NOT NULL, -- this is the initiator of the request - BucketName VARCHAR(64) NOT NULL, - NameKey VARCHAR(255) NOT NULL, - x_amz_acl VARCHAR(64) NULL, - - CreateTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- We need to store all the meta data for an object being mutlipart uploaded --- UploadID is a foreign key to an entry in the mutipart_uploads table --- -CREATE TABLE multipart_meta ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - UploadID BIGINT NOT NULL, - Name VARCHAR(64) NOT NULL, - Value VARCHAR(256), - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- Each part of a multipart upload gets a row in this table --- UploadId is a foreign key to an entry in the mutipart_uploads table --- -CREATE TABLE multipart_parts ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - UploadID BIGINT NOT NULL, - partNumber INT NOT NULL, - MD5 VARCHAR(128), - StoredPath VARCHAR(256), -- relative to mount point of the root - StoredSize BIGINT NOT NULL DEFAULT 0, - - CreateTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -SET foreign_key_checks = 1; - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql b/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql deleted file mode 100644 index 2614aaf..0000000 --- a/awsapi-setup/db/mysql/cloudbridge_multipart_alter.sql +++ /dev/null @@ -1,23 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. - - -USE cloudbridge; - -ALTER TABLE multipart_meta ADD CONSTRAINT FOREIGN KEY meta_uploads_id(UploadID) REFERENCES multipart_uploads(ID) ON DELETE CASCADE; -ALTER TABLE multipart_parts ADD CONSTRAINT FOREIGN KEY part_uploads_id(UploadID) REFERENCES multipart_uploads(ID) ON DELETE CASCADE; -ALTER TABLE multipart_parts ADD UNIQUE part_uploads_number(UploadId, partNumber); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/cloudbridge_offering.sql ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/cloudbridge_offering.sql b/awsapi-setup/db/mysql/cloudbridge_offering.sql deleted file mode 100644 index f21af5a..0000000 --- a/awsapi-setup/db/mysql/cloudbridge_offering.sql +++ /dev/null @@ -1,40 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. - - -USE cloudbridge; - --- This file (and cloudbridge_offering_alter.sql) can be applied to an existing cloudbridge --- database. It is used to manage the mappings from the Amazon EC2 offering strings to --- cloudstack service offering identifers. --- -SET foreign_key_checks = 0; - -DROP TABLE IF EXISTS offering_bundle; - --- AmazonEC2Offering - string name of an EC2 AMI capability (e.g. "m1.small") --- CloudStackOffering - string name of the cloud stack service offering identifer (e.g. "1" ) --- -CREATE TABLE offering_bundle ( - ID INTEGER NOT NULL AUTO_INCREMENT, - AmazonEC2Offering VARCHAR(100) NOT NULL, - CloudStackOffering VARCHAR(20) NOT NULL, - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -SET foreign_key_checks = 1; - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql b/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql deleted file mode 100644 index bffb34d..0000000 --- a/awsapi-setup/db/mysql/cloudbridge_offering_alter.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. - - -USE cloudbridge; - -ALTER TABLE offering_bundle ADD UNIQUE one_offering (AmazonEC2Offering); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql b/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql deleted file mode 100644 index 53ab40b..0000000 --- a/awsapi-setup/db/mysql/cloudbridge_policy_alter.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. - - -USE cloudbridge; - -ALTER TABLE bucket_policies ADD UNIQUE one_policy_per_bucket(BucketName); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/cloudbridge_schema.sql ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/cloudbridge_schema.sql b/awsapi-setup/db/mysql/cloudbridge_schema.sql deleted file mode 100644 index de22f11..0000000 --- a/awsapi-setup/db/mysql/cloudbridge_schema.sql +++ /dev/null @@ -1,162 +0,0 @@ --- Licensed to the Apache Software Foundation (ASF) under one --- or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information --- regarding copyright ownership. The ASF licenses this file --- to you under the Apache License, Version 2.0 (the --- "License"); you may not use this file except in compliance --- with the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, --- software distributed under the License is distributed on an --- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --- KIND, either express or implied. See the License for the --- specific language governing permissions and limitations --- under the License. - - -USE cloudbridge; - -SET foreign_key_checks = 0; - -DROP TABLE IF EXISTS shost; -DROP TABLE IF EXISTS mhost; -DROP TABLE IF EXISTS mhost_mount; -DROP TABLE IF EXISTS sbucket; -DROP TABLE IF EXISTS sobject; -DROP TABLE IF EXISTS sobject_item; -DROP TABLE IF EXISTS meta; -DROP TABLE IF EXISTS acl; -DROP TABLE IF EXISTS usercredentials; - --- storage host -CREATE TABLE shost ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Host VARCHAR(128) NOT NULL, - HostType INT NOT NULL DEFAULT 0, -- 0 : local, 1 : nfs - ExportRoot VARCHAR(128) NOT NULL, - - MHostID BIGINT, -- when host type is local, MHostID points to its owner management host - - UserOnHost VARCHAR(64), - UserPassword VARCHAR(128), - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- management host -CREATE TABLE mhost ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - MHostKey VARCHAR(128) NOT NULL, -- host key could be derived from MAC address or named configuration value - Host VARCHAR(128), -- public host address for redirecting request from/to - - Version VARCHAR(64), - LastHeartbeatTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE mhost_mount ( - ID BIGINT NOT NULL AUTO_INCREMENT, - MHostID BIGINT NOT NULL, - SHostID BIGINT NOT NULL, - - MountPath VARCHAR(256), -- local mount path - LastMountTime DATETIME, -- null : unmounted, otherwise the mount location - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sbucket ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Name VARCHAR(64) NOT NULL, - OwnerCanonicalID VARCHAR(150) NOT NULL, - - SHostID BIGINT, - - CreateTime DATETIME, - - VersioningStatus INT NOT NULL DEFAULT 0, -- 0 : initial not set, 1 : enabled, 2 : suspended - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sobject ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - SBucketID BIGINT NOT NULL, - NameKey VARCHAR(255) NOT NULL, - - OwnerCanonicalID VARCHAR(150) NOT NULL, - NextSequence INT NOT NULL DEFAULT 1, - DeletionMark VARCHAR (150), - - CreateTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE sobject_item ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - SObjectID BIGINT NOT NULL, - Version VARCHAR(64), - - MD5 VARCHAR(128), - StoredPath VARCHAR(256), -- relative to mount point of the root - StoredSize BIGINT NOT NULL DEFAULT 0, - - CreateTime DATETIME, - LastModifiedTime DATETIME, - LastAccessTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE meta ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Target VARCHAR(64) NOT NULL, - TargetID BIGINT NOT NULL, - - Name VARCHAR(64) NOT NULL, - Value VARCHAR(256), - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE acl ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - Target VARCHAR(64) NOT NULL, - TargetID BIGINT NOT NULL, - - GranteeType INT NOT NULL DEFAULT 0, -- 0 : Cloud service user, 1 : Cloud user community, 2: Public user community - GranteeCanonicalID VARCHAR(150), -- make it big enought to hold a Cloud API access key - - Permission INT NOT NULL DEFAULT 0, -- 0 : no permission, 1 : read, 2 : write, 4 : read_acl, 8 : write_acl - GrantOrder INT NOT NULL DEFAULT 0, - - CreateTime DATETIME, - LastModifiedTime DATETIME, - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- each account has to have a separate --- each account has to have a separate mappings -CREATE TABLE usercredentials ( - ID BIGINT NOT NULL AUTO_INCREMENT, - - AccessKey VARCHAR(150) NOT NULL, - SecretKey VARCHAR(150) NOT NULL, - CertUniqueId VARCHAR(200), - - PRIMARY KEY(ID) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -SET foreign_key_checks = 1; - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/deploy-db-bridge.sh ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/deploy-db-bridge.sh b/awsapi-setup/db/mysql/deploy-db-bridge.sh deleted file mode 100644 index 2e8ceee..0000000 --- a/awsapi-setup/db/mysql/deploy-db-bridge.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -if [ ! -f cloudbridge_db.sql ]; then - printf "Error: Unable to find cloudbridge_db.sql\n" - exit 4 -fi - -if [ ! -f cloudbridge_schema.sql ]; then - printf "Error: Unable to find cloudbridge_schema.sql\n" - exit 5 -fi - -if [ ! -f cloudbridge_index.sql ]; then - printf "Error: Unable to find cloudbridge_index.sql\n" - exit 6; -fi - -echo "Recreating Database." -mysql --user=root --password=$1 < cloudbridge_db.sql > /dev/null 2>/dev/null -mysqlout=$? -if [ $mysqlout -eq 1 ]; then - printf "Please enter root password for MySQL.\n" - mysql --user=root --password < cloudbridge_db.sql - if [ $? -ne 0 ]; then - printf "Error: Cannot execute cloudbridge_db.sql\n" - exit 10 - fi -elif [ $mysqlout -ne 0 ]; then - printf "Error: Cannot execute cloudbridge_db.sql\n" - exit 11 -fi - -mysql --user=cloud --password=cloud < cloudbridge_schema.sql -if [ $? -ne 0 ]; then - printf "Error: Cannot execute cloudbridge_schema.sql\n" - exit 11 -fi - -mysql --user=cloud --password=cloud < cloudbridge_multipart.sql -if [ $? -ne 0 ] -then - exit 1 -fi - -echo "Creating Indice and Foreign Keys" -mysql --user=cloud --password=cloud < cloudbridge_index.sql -if [ $? -ne 0 ]; then - printf "Error: Cannot execute cloudbridge_index.sql\n" - exit 13 -fi - -mysql --user=cloud --password=cloud < cloudbridge_multipart_alter.sql -mysql --user=cloud --password=cloud < cloudbridge_bucketpolicy.sql -mysql --user=cloud --password=cloud < cloudbridge_policy_alter.sql -mysql --user=cloud --password=cloud < cloudbridge_offering.sql -mysql --user=cloud --password=cloud < cloudbridge_offering_alter.sql http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/db/mysql/init_db.bat ---------------------------------------------------------------------- diff --git a/awsapi-setup/db/mysql/init_db.bat b/awsapi-setup/db/mysql/init_db.bat deleted file mode 100644 index 6854ff3..0000000 --- a/awsapi-setup/db/mysql/init_db.bat +++ /dev/null @@ -1,26 +0,0 @@ -rem Licensed to the Apache Software Foundation (ASF) under one -rem or more contributor license agreements. See the NOTICE file -rem distributed with this work for additional information -rem regarding copyright ownership. The ASF licenses this file -rem to you under the Apache License, Version 2.0 (the -rem "License"); you may not use this file except in compliance -rem with the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, -rem software distributed under the License is distributed on an -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -rem KIND, either express or implied. See the License for the -rem specific language governing permissions and limitations -rem under the License. - -mysql --user=root --password < cloudbridge_db.sql -mysql --user=root --password < cloudbridge_schema.sql -mysql --user=root --password < cloudbridge_multipart.sql -mysql --user=root --password < cloudbridge_index.sql -mysql --user=root --password < cloudbridge_multipart_alter.sql -mysql --user=root --password < cloudbridge_bucketpolicy.sql -mysql --user=root --password < cloudbridge_policy_alter.sql -mysql --user=root --password < cloudbridge_offering.sql -mysql --user=root --password < cloudbridge_offering_alter.sql http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/init/debian/cloud-bridge ---------------------------------------------------------------------- diff --git a/awsapi-setup/init/debian/cloud-bridge b/awsapi-setup/init/debian/cloud-bridge deleted file mode 100644 index c1bf90b..0000000 --- a/awsapi-setup/init/debian/cloud-bridge +++ /dev/null @@ -1,244 +0,0 @@ -#!/bin/sh -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine -# -# Written by Miquel van Smoorenburg . -# Modified for Debian GNU/Linux by Ian Murdock . -# Modified for Tomcat by Stefan Gybas . -# Modified for Tomcat6 by Thierry Carrez . -# Modified for VMOps by Manuel Amador (Rudd-O) -# -### BEGIN INIT INFO -# Provides: tomcat-vmops -# Required-Start: $local_fs $remote_fs $network -# Required-Stop: $local_fs $remote_fs $network -# Should-Start: $named -# Should-Stop: $named -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start Tomcat (CloudStack). -# Description: Start the Tomcat servlet engine that runs the CloudStack Management Server. -### END INIT INFO - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -NAME=cloud-bridge -DESC="CloudStack-specific Tomcat servlet engine" -DAEMON=/usr/bin/jsvc -CATALINA_BASE=/usr/share/cloud/bridge -CATALINA_HOME=/usr/share/tomcat6 -DEFAULT=$CATALINA_BASE/conf/tomcat6.conf -JVM_TMP=/tmp/$NAME-temp - -if [ `id -u` -ne 0 ]; then - echo "You need root privileges to run this script" - exit 1 -fi - -# Make sure tomcat is started with system locale -if [ -r /etc/default/locale ]; then - . /etc/default/locale - export LANG -fi - -. /lib/lsb/init-functions -. /etc/default/rcS - - -# The following variables can be overwritten in $DEFAULT - -# Run Tomcat 6 as this user ID -TOMCAT6_USER=tomcat6 - -# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not -# defined in $DEFAULT) -JDK_DIRS="/usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm" - -# Look for the right JVM to use -for jdir in $JDK_DIRS; do - if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then - JAVA_HOME="$jdir" - fi -done -export JAVA_HOME - - -# Use the Java security manager? (yes/no) -TOMCAT6_SECURITY=no - -# Default Java options -# Set java.awt.headless=true if JAVA_OPTS is not set so the -# Xalan XSL transformer can work without X11 display on JDK 1.4+ -# It also looks like the default heap size of 64M is not enough for most cases -# so the maximum heap size is set to 128M -if [ -z "$JAVA_OPTS" ]; then - JAVA_OPTS="-Djava.awt.headless=true -Xmx128M" -fi - -# End of variables that can be overwritten in $DEFAULT - -# overwrite settings from default file -if [ -f "$DEFAULT" ]; then - . "$DEFAULT" -fi - -if [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then - log_failure_msg "$NAME is not installed" - exit 1 -fi - -[ -f "$DAEMON" ] || exit 0 - -POLICY_CACHE="$CATALINA_BASE/work/catalina.policy" - -JAVA_OPTS="$JAVA_OPTS -Djava.endorsed.dirs=$CATALINA_HOME/endorsed -Dcatalina.base=$CATALINA_BASE -Dcatalina.home=$CATALINA_HOME -Djava.io.tmpdir=$JVM_TMP" - -# Set the JSP compiler if set in the tomcat6.default file -if [ -n "$JSP_COMPILER" ]; then - JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=$JSP_COMPILER" -fi - -if [ "$TOMCAT6_SECURITY" = "yes" ]; then - JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$POLICY_CACHE" -fi - -# Set juli LogManager if logging.properties is provided -if [ -r "$CATALINA_BASE"/conf/logging.properties ]; then - JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager" "-Djava.util.logging.config.file="$CATALINA_BASE/conf/logging.properties" -fi - -# Define other required variables -CATALINA_PID="/var/run/$NAME.pid" -BOOTSTRAP_CLASS=org.apache.catalina.startup.Bootstrap -JSVC_CLASSPATH="/usr/share/java/commons-daemon.jar:$CATALINA_HOME/bin/bootstrap.jar" -JSVC_CLASSPATH=$CLASSPATH:$JSVC_CLASSPATH - -# Look for Java Secure Sockets Extension (JSSE) JARs -if [ -z "${JSSE_HOME}" -a -r "${JAVA_HOME}/jre/lib/jsse.jar" ]; then - JSSE_HOME="${JAVA_HOME}/jre/" -fi -export JSSE_HOME - -case "$1" in - start) - if [ -z "$JAVA_HOME" ]; then - log_failure_msg "no JDK found - please set JAVA_HOME" - exit 1 - fi - - if [ ! -d "$CATALINA_BASE/conf" ]; then - log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE" - exit 1 - fi - - log_daemon_msg "Starting $DESC" "$NAME" - if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ - --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ - >/dev/null; then - - # Regenerate POLICY_CACHE file - umask 022 - echo "// AUTO-GENERATED FILE from /etc/tomcat6/policy.d/" \ - > "$POLICY_CACHE" - echo "" >> "$POLICY_CACHE" - if ls $CATALINA_BASE/conf/policy.d/*.policy > /dev/null 2>&1 ; then - cat $CATALINA_BASE/conf/policy.d/*.policy \ - >> "$POLICY_CACHE" - fi - - # Remove / recreate JVM_TMP directory - rm -rf "$JVM_TMP" - mkdir "$JVM_TMP" || { - log_failure_msg "could not create JVM temporary directory" - exit 1 - } - chown $TOMCAT6_USER "$JVM_TMP" - cd "$JVM_TMP" - - - # fix storage issues on nfs mounts - umask 000 - $DAEMON -user "$TOMCAT6_USER" -cp "$JSVC_CLASSPATH" \ - -outfile SYSLOG -errfile SYSLOG \ - -pidfile "$CATALINA_PID" $JAVA_OPTS "$BOOTSTRAP_CLASS" - - sleep 5 - if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ - --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ - >/dev/null; then - log_end_msg 1 - else - log_end_msg 0 - fi - else - log_progress_msg "(already running)" - log_end_msg 0 - fi - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ - --user "$TOMCAT6_USER" --startas "$JAVA_HOME/bin/java" \ - >/dev/null; then - log_progress_msg "(not running)" - else - $DAEMON -cp "$JSVC_CLASSPATH" -pidfile "$CATALINA_PID" \ - -stop "$BOOTSTRAP_CLASS" - fi - rm -rf "$JVM_TMP" - log_end_msg 0 - ;; - status) - if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ - --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ - >/dev/null; then - - if [ -f "$CATALINA_PID" ]; then - log_success_msg "$DESC is not running, but pid file exists." - exit 1 - else - log_success_msg "$DESC is not running." - exit 3 - fi - else - log_success_msg "$DESC is running with pid `cat $CATALINA_PID`" - fi - ;; - restart|force-reload) - if start-stop-daemon --test --stop --pidfile "$CATALINA_PID" \ - --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ - >/dev/null; then - $0 stop - sleep 1 - fi - $0 start - ;; - try-restart) - if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \ - --user $TOMCAT6_USER --startas "$JAVA_HOME/bin/java" \ - >/dev/null; then - $0 start - fi - ;; - *) - log_success_msg "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" - exit 1 - ;; -esac - -exit 0 http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/init/rpm/cloud-bridge ---------------------------------------------------------------------- diff --git a/awsapi-setup/init/rpm/cloud-bridge b/awsapi-setup/init/rpm/cloud-bridge deleted file mode 100644 index 444b771..0000000 --- a/awsapi-setup/init/rpm/cloud-bridge +++ /dev/null @@ -1,300 +0,0 @@ -#!/bin/bash -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# tomcat6 This shell script takes care of starting and stopping Tomcat -# -# chkconfig: - 80 20 -# -### BEGIN INIT INFO -# Provides: tomcat6 -# Required-Start: $network $syslog -# Required-Stop: $network $syslog -# Default-Start: -# Default-Stop: -# Description: Release implementation for Servlet 2.5 and JSP 2.1 -# Short-Description: start and stop tomcat -### END INIT INFO -# -# - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot -# - heavily rewritten by Deepak Bhole and Jason Corley -# - -## Source function library. -#. /etc/rc.d/init.d/functions -# Source LSB function library. -export NAME=cloud-bridge -DESC="CloudStack-specific Tomcat servlet engine" -export CATALINA_BASE=/usr/share/cloud/bridge -DEFAULT=$CATALINA_BASE/conf/tomcat6.conf -TOMCAT_USER="cloud" -export TOMCAT_LOG="${TOMCAT_LOG:-/var/log/tomcat6/catalina.out}" -export TOMCAT_CFG=$DEFAULT -if [ -r "$TOMCAT_CFG" ]; then - . $TOMCAT_CFG -fi - -if [ -r /lib/lsb/init-functions ]; then - . /lib/lsb/init-functions -else - exit 1 -fi - -DISTRIB_ID=`lsb_release -i -s 2>/dev/null` - -# For SELinux we need to use 'runuser' not 'su' -if [ -x "/sbin/runuser" ]; then - SU="/sbin/runuser -m" -else - SU="/bin/su -m" -fi - - -# Get instance specific config file -if [ -r "/etc/sysconfig/${NAME}" ]; then - . /etc/sysconfig/${NAME} -fi - - -# Path to the tomcat launch script -TOMCAT_SCRIPT="/usr/sbin/tomcat6" - -# Tomcat program name -TOMCAT_PROG="${NAME}" - - -RETVAL="0" - -# Look for open ports, as the function name might imply -function findFreePorts() { - local isSet1="false" - local isSet2="false" - local isSet3="false" - local lower="8000" - randomPort1="0" - randomPort2="0" - randomPort3="0" - local -a listeners="( $( - netstat -ntl | \ - awk '/^tcp/ {gsub("(.)*:", "", $4); print $4}' - ) )" - while [ "$isSet1" = "false" ] || \ - [ "$isSet2" = "false" ] || \ - [ "$isSet3" = "false" ]; do - let port="${lower}+${RANDOM:0:4}" - if [ -z `expr " ${listeners[*]} " : ".*\( $port \).*"` ]; then - if [ "$isSet1" = "false" ]; then - export randomPort1="$port" - isSet1="true" - elif [ "$isSet2" = "false" ]; then - export randomPort2="$port" - isSet2="true" - elif [ "$isSet3" = "false" ]; then - export randomPort3="$port" - isSet3="true" - fi - fi - done -} - -function makeHomeDir() { - if [ ! -d "$CATALINA_HOME" ]; then - echo "$CATALINA_HOME does not exist, creating" - if [ ! -d "/usr/share/${NAME}" ]; then - mkdir /usr/share/${NAME} - cp -pLR /usr/share/tomcat6/* /usr/share/${NAME} - fi - mkdir -p /var/log/${NAME} \ - /var/cache/${NAME} \ - /var/tmp/${NAME} - ln -fs /var/cache/${NAME} ${CATALINA_HOME}/work - ln -fs /var/tmp/${NAME} ${CATALINA_HOME}/temp - cp -pLR /usr/share/${NAME}/bin $CATALINA_HOME - cp -pLR /usr/share/${NAME}/conf $CATALINA_HOME - ln -fs /usr/share/java/tomcat6 ${CATALINA_HOME}/lib - ln -fs /usr/share/tomcat6/webapps ${CATALINA_HOME}/webapps - chown ${TOMCAT_USER}:${TOMCAT_USER} /var/log/${NAME} - fi -} - -function parseOptions() { - options="" - options="$options $( - awk '!/^#/ && !/^$/ { ORS=" "; print "export ", $0, ";" }' \ - $TOMCAT_CFG - )" - if [ -r "/etc/sysconfig/${NAME}" ]; then - options="$options $( - awk '!/^#/ && !/^$/ { ORS=" "; - print "export ", $0, ";" }' \ - /etc/sysconfig/${NAME} - )" - fi - TOMCAT_SCRIPT="$options ${TOMCAT_SCRIPT}" -} - -# See how we were called. -function start() { - echo -n "Starting ${TOMCAT_PROG}: " - if [ -f "/var/lock/subsys/${NAME}" ] ; then - if [ -f "/var/run/${NAME}.pid" ]; then - read kpid < /var/run/${NAME}.pid -# if checkpid $kpid 2>&1; then - if [ -d "/proc/${kpid}" ]; then - log_success_msg - if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then - echo - fi - return 0 - fi - fi - fi - # fix permissions on the log and pid files - export CATALINA_PID="/var/run/${NAME}.pid" - touch $CATALINA_PID - chown ${TOMCAT_USER}:${TOMCAT_USER} $CATALINA_PID - touch $TOMCAT_LOG - chown ${TOMCAT_USER}:${TOMCAT_USER} $TOMCAT_LOG - if [ "$CATALINA_HOME" != "/usr/share/tomcat6" ]; then - # Create a tomcat directory if it doesn't exist - makeHomeDir - # If CATALINA_HOME doesn't exist modify port number so that - # multiple instances don't interfere with each other - findFreePorts - sed -i -e "s/8005/${randomPort1}/g" -e "s/8080/${CONNECTOR_PORT}/g" \ - -e "s/8009/${randomPort2}/g" -e "s/8443/${randomPort3}/g" \ - ${CATALINA_HOME}/conf/server.xml - fi - parseOptions - if [ "$SECURITY_MANAGER" = "true" ]; then - $SU $TOMCAT_USER -c "${TOMCAT_SCRIPT} start-security" \ - >> $TOMCAT_LOG 2>&1 - else - $SU $TOMCAT_USER -c "${TOMCAT_SCRIPT} start" >> $TOMCAT_LOG 2>&1 - fi - RETVAL="$?" - if [ "$RETVAL" -eq 0 ]; then - log_success_msg - touch /var/lock/subsys/${NAME} - else - log_failure_msg - fi - if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then - echo - fi - return $RETVAL -} - -function stop() { - RETVAL="0" - echo -n "Stopping ${TOMCAT_PROG}: " - if [ -f "/var/lock/subsys/${NAME}" ]; then - parseOptions - $SU $TOMCAT_USER -c "${TOMCAT_SCRIPT} stop" >> $TOMCAT_LOG 2>&1 - RETVAL="$?" - if [ "$RETVAL" -eq "0" ]; then - count="0" - if [ -f "/var/run/${NAME}.pid" ]; then - read kpid < /var/run/${NAME}.pid - until [ "$(ps --pid $kpid | grep -c $kpid)" -eq "0" ] || \ - [ "$count" -gt "$SHUTDOWN_WAIT" ]; do - if [ "$SHUTDOWN_VERBOSE" = "true" ]; then - echo "waiting for processes $kpid to exit" - fi - sleep 1 - let count="${count}+1" - done - if [ "$count" -gt "$SHUTDOWN_WAIT" ]; then - if [ "$SHUTDOWN_VERBOSE" = "true" ]; then - echo "killing processes which didn't stop after $SHUTDOWN_WAIT seconds" - fi - kill -9 $kpid - fi - log_success_msg - fi - rm -f /var/lock/subsys/${NAME} /var/run/${NAME}.pid - else - log_failure_msg - fi - else - log_success_msg - fi - if [ "$DISTRIB_ID" = "MandrivaLinux" ]; then - echo - fi - return $RETVAL -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - condrestart|try-restart) - if [ -f "/var/run/${NAME}.pid" ]; then - stop - start - fi - ;; - reload) - RETVAL="3" - ;; - force-reload) - if [ -f "/var/run/${NAME}.pid" ]; then - stop - start - fi - ;; - status) - if [ -f "/var/run/${NAME}.pid" ]; then -# status ${NAME} -# RETVAL="$?" - read kpid < /var/run/${NAME}.pid - if [ -d "/proc/${kpid}" ]; then - echo "${NAME} (pid ${kpid}) is running..." - RETVAL="0" - fi - else - pid="$(/usr/bin/pgrep -d , -u ${TOMCAT_USER} -G ${TOMCAT_USER} java)" - if [ -z "$pid" ]; then -# status ${NAME} -# RETVAL="$?" - echo "${NAME} is stopped" - RETVAL="3" - else - echo "${NAME} (pid $pid) is running..." - RETVAL="0" - fi - fi - ;; - version) - ${TOMCAT_SCRIPT} version - ;; - *) - echo "Usage: $0 {start|stop|restart|condrestart|try-restart|reload|force-reload|status|version}" - RETVAL="2" -esac - -exit $RETVAL http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/setup/cloud-setup-bridge ---------------------------------------------------------------------- diff --git a/awsapi-setup/setup/cloud-setup-bridge b/awsapi-setup/setup/cloud-setup-bridge deleted file mode 100644 index d456387..0000000 --- a/awsapi-setup/setup/cloud-setup-bridge +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# Cloud.com Bridge setup script. -# - -settingsFile="/etc/cloudstack/management/ec2-service.properties" - -function readCurrentSettings () { - readVar managementServer - readVar cloudAPIPort - readVar cloudstackVersion - readVar WSDLVersion - readVar keystore - readVar keystorePass - readVar m1.small.serviceId - readVar m1.large.serviceId - readVar m1.xlarge.serviceId - readVar c1.medium.serviceId - readVar c1.xlarge.serviceId - readVar m2.xlarge.serviceId - readVar m2.2xlarge.serviceId - readVar m2.4xlarge.serviceId - readVar cc1.4xlarge.serviceId - readVar dbHost - readVar dbName - readVar dbUser - readVar dbPassword -} - -function readVar () { - local _pointer=$(sub "$1") - local _tmp="`cat $settingsFile|grep \"$1=\"|awk -F= '{print $2}'|tr -d '\r'`" - eval $_pointer="$_tmp" -} - -function readValue () { - local _value - local _tmp - local _pointer=$(sub "$2") - eval _value="\$$_pointer" - printf "%s [%s]: " "$1" "$_value" - read -e _tmp - - if [ "$_tmp" != "" ] - then - eval $_pointer="$_tmp" - fi -} - -function getNewValues () { - readValue "Management server hostname or IP" managementServer - readValue "Management server port" cloudAPIPort - - readValue "Service offering ID for m1.small" m1.small.serviceId - readValue "Service offering ID for m1.large" m1.large.serviceId - readValue "Service offering ID for m1.xlarge" m1.xlarge.serviceId - - readValue "Service offering ID for c1.medium" c1.medium.serviceId - readValue "Service offering ID for c1.xlarge" c1.xlarge.serviceId - - readValue "Service offering ID for m2.xlarge" m2.xlarge.serviceId - readValue "Service offering ID for m2.2xlarge" m2.2xlarge.serviceId - readValue "Service offering ID for m2.4xlarge" m2.4xlarge.serviceId - readValue "Service offering ID for cc1.4xlarge" cc1.4xlarge.serviceId -} - -function sub () { - echo "$1" | awk '{gsub(/\./, "_", $0); print $0}' -} - -function saveValue () { - local _pointer=$(sub "$1") - local _value - eval _value="\$$_pointer" - echo "$1=$_value" >> $settingsFile -} - -function saveValues () { - cat /dev/null > $settingsFile - saveValue managementServer - saveValue cloudAPIPort - saveValue cloudstackVersion - saveValue WSDLVersion - saveValue keystore - saveValue keystorePass - saveValue m1.small.serviceId - saveValue m1.large.serviceId - saveValue m1.xlarge.serviceId - saveValue c1.medium.serviceId - saveValue c1.xlarge.serviceId - saveValue m2.xlarge.serviceId - saveValue m2.2xlarge.serviceId - saveValue m2.4xlarge.serviceId - saveValue cc1.4xlarge.serviceId - saveValue dbHost - saveValue dbName - saveValue dbUser - saveValue dbPassword -} - -echo "Welcome to the CloudBridge setup." - - -if [ ! -e $settingsFile ] -then - settingsFile=$1 - if [ ! -e $settingsFile ] - then - echo "Error: Settings file not found." - exit 1 - fi -fi -if [ ! -w $settingsFile ] -then - echo "Error: Insufficient permissions. Run as super-user." - exit 1 -fi - -readCurrentSettings - -printf "Enter suitable values or press enter for default. \n\n" - -getNewValues -saveValues - -printf "\nValues saved. Restart the cloud-bridge service for the changes to become active.\n\n" http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi-setup/setup/cloudstack-aws-api-register ---------------------------------------------------------------------- diff --git a/awsapi-setup/setup/cloudstack-aws-api-register b/awsapi-setup/setup/cloudstack-aws-api-register deleted file mode 100644 index 07eacf1..0000000 --- a/awsapi-setup/setup/cloudstack-aws-api-register +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/python -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -import base64 -import hmac -import os -import sys -import urllib2 -import urllib -import httplib -from datetime import datetime -from optparse import OptionParser -from urlparse import urlparse - -try: - from hashlib import sha1 as sha -except ImportError: - import sha - -def get_signature(key, url, query): - netloc, path = urlparse(url)[1:3] - return urllib.quote_plus(base64.b64encode( - hmac.new(key, '\n'.join(['GET', netloc, path, query]), sha).digest())) - -def get_url(url, api_key, secret_key, action, query): - amzn_string = 'AWSAccessKeyId=' + api_key + '&Action=' + action + '&SignatureMethod=HmacSHA1' - amzn_string += '&SignatureVersion=2&Timestamp='+ datetime.now().isoformat()[:19] +'Z&Version=2012-08-15' - query = amzn_string + '&' + query - url = url + '?' + query + '&Signature=' + get_signature(secret_key, url, query) - try: - urllib2.urlopen(url) - if action == 'SetCertificate': - print 'User registration is successful!' - return True - except urllib2.HTTPError, e: - print 'User registration failed with http error code:' , e.code - return False - except urllib2.URLError, e: - print 'User registration failed with error: ' , e.reason - return False - - -def register(url, api_key, secret_key, cert): - # Register API keys - query = 'accesskey=' + api_key + '&secretkey=' + secret_key - result = get_url(url, api_key, secret_key, 'SetUserKeys', query) - - if result == True: - # Tie Certifcate to API keys - query = 'cert=' + urllib.quote_plus(cert) - get_url(url, api_key, secret_key, 'SetCertificate', query) - - -def get_opts(): - parser = OptionParser() - parser.add_option('-a', '--apikey') - parser.add_option('-s', '--secretkey') - parser.add_option('-c', '--cert', help='Name of a file containing an X.509 certificate') - parser.add_option('-u', '--url', help='CloudStack AWSAPI URL, eg. http://cloudstack.host:8080/awsapi') - (options, args) = parser.parse_args() - if None in [options.apikey, options.secretkey, options.cert, options.url]: - print 'Error: Missing argument\n' - parser.print_help() - sys.exit(1) - return options - -def validate_opts(options): - if not os.path.isfile(options.cert): - print 'Error reading file: ' + options.cert - sys.exit(1) - f = open(options.cert) - options.cert = f.read() - return options - -if __name__ == '__main__': - opts = validate_opts(get_opts()) - register(opts.url, opts.apikey, opts.secretkey, opts.cert) http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi/.pydevproject ---------------------------------------------------------------------- diff --git a/awsapi/.pydevproject b/awsapi/.pydevproject deleted file mode 100644 index d4a984a..0000000 --- a/awsapi/.pydevproject +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -Default -python 2.7 - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi/conf/applicationContext.xml.in ---------------------------------------------------------------------- diff --git a/awsapi/conf/applicationContext.xml.in b/awsapi/conf/applicationContext.xml.in deleted file mode 100644 index fd9c871..0000000 --- a/awsapi/conf/applicationContext.xml.in +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi/conf/cloud-bridge.properties.in ---------------------------------------------------------------------- diff --git a/awsapi/conf/cloud-bridge.properties.in b/awsapi/conf/cloud-bridge.properties.in deleted file mode 100644 index d0820e8..0000000 --- a/awsapi/conf/cloud-bridge.properties.in +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -host=http://localhost:7080/awsapi -storage.root=/Users/john1/S3-Mount -storage.multipartDir=__multipart__uploads__ -bucket.dns=false -serviceEndpoint=localhost:7080 - - - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi/conf/ec2-service.properties.in ---------------------------------------------------------------------- diff --git a/awsapi/conf/ec2-service.properties.in b/awsapi/conf/ec2-service.properties.in deleted file mode 100644 index 82f5ad8..0000000 --- a/awsapi/conf/ec2-service.properties.in +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -managementServer=127.0.0.1 -cloudAPIPort=8080 -cloudstackVersion=2.2.0 -WSDLVersion=2012-08-15 -keystore=xes.keystore -keystorePass=apache - - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi/pom.xml ---------------------------------------------------------------------- diff --git a/awsapi/pom.xml b/awsapi/pom.xml deleted file mode 100644 index 1ace8df..0000000 --- a/awsapi/pom.xml +++ /dev/null @@ -1,441 +0,0 @@ - - - 4.0.0 - cloud-awsapi - Apache CloudStack AWS API Bridge - war - - org.apache.cloudstack - cloudstack - 4.6.0-SNAPSHOT - - - - org.apache.cloudstack - cloud-utils - ${project.version} - - - org.springframework - spring-web - - - org.apache.axis2 - axis2 - ${cs.axis2.version} - - - org.apache.axis2 - axis2-adb - ${cs.axis2.version} - - - org.apache.axis2 - axis2-webapp - war - ${cs.axis2.version} - - - xerces - xercesImpl - - - - - org.apache.ws.commons.axiom - axiom-api - ${cs.axiom.version} - - - org.apache.ws.commons.axiom - axiom-impl - ${cs.axiom.version} - - - log4j - log4j - - - org.apache.cloudstack - cloud-plugin-syslog-alerts - ${project.version} - - - org.apache.cloudstack - cloud-plugin-snmp-alerts - ${project.version} - - - org.apache.neethi - neethi - ${cs.neethi.version} - - - org.apache.ws.commons.axiom - axiom-api - - - org.apache.ws.commons.axiom - axiom-impl - - - - - com.google.code.gson - gson - - - commons-codec - commons-codec - - - javax.servlet - servlet-api - provided - - - com.googlecode.json-simple - json-simple - 1.1 - - - org.jasypt - jasypt - - - com.caringo.client - CAStorSDK - 1.3.1-CS40 - - - org.slf4j - slf4j-jdk14 - 1.6.1 - runtime - - - org.slf4j - slf4j-api - runtime - - - org.apache.ws.security - wss4j - 1.6.1 - runtime - - - joda-time - joda-time - 1.5.2 - runtime - - - org.opensaml - xmltooling - 1.3.1 - runtime - - - org.opensaml - openws - 1.4.1 - runtime - - - velocity - velocity - 1.5 - runtime - - - org.opensaml - opensaml - 2.5.1-1 - runtime - - - org.apache.santuario - xmlsec - 1.4.2 - runtime - - - org.bouncycastle - bcprov-jdk16 - runtime - - - org.antlr - antlr-runtime - 3.4 - - - dom4j - dom4j - 1.6.1 - - - javassist - javassist - 3.9.0.GA - - - org.apache.cloudstack - cloud-framework-db - ${project.version} - - - - - - src - - **/*.java - - - - ../utils/conf/ - - - ${basedir}/resource/AmazonEC2 - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - cloudstack-checkstyle - none - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - com/cloud/gate/util/UtilTestCase.java - com/cloud/gate/service/ServiceTestCase.java - com/cloud/gate/util/CloudStackClientTestCase.java - - - - - org.apache.maven.plugins - maven-war-plugin - 2.3 - - ./web/web.xml - ./target/generated-webapp - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.26 - - - - 7080 - 60000 - - - /awsapi - ${basedir}/web/web.xml - ${project.build.directory}/${project.build.finalName} - - - - maven-antrun-plugin - - - generate-resource - generate-resources - - run - - - - - - - - - - - - - - - - - - - - - org.apache.axis2 - axis2-aar-maven-plugin - 1.6.2 - true - - false - cloud-ec2 - ${project.build.directory}/WEB-INF/services - - - resource/AmazonEC2 - META-INF - - services.xml - - - - - - - - aar - - - - - - - - - downloadec2wsdl - - - downloadec2wsdl - - - - - - maven-antrun-plugin - 1.7 - - - generate-resources - - run - - - - - - - - - - - - - - - - - gencodefromwsdl - - - gencodefromwsdl - - - - - - org.apache.axis2 - axis2-wsdl2code-maven-plugin - 1.5.6 - - - generate-sources - - wsdl2code - - - ${basedir}/wsdl/2012-08-15.ec2.wsdl - com.amazon.ec2 - true - true - true - http://ec2.amazonaws.com/doc/2012-08-15/=com.amazon.ec2 - ${basedir} - - - - generate-aws-ec2-source-client - generate-sources - - wsdl2code - - - ${basedir}/wsdl/2012-08-15.ec2.wsdl - com.amazon.ec2.client - http://ec2.amazonaws.com/doc/2012-08-15/=com.amazon.ec2.client - ${basedir} - - - - - - - - - removewsdl - - - removewsdl - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - clean - - exec - - - rm - - -rf - ${basedir}/wsdl/ - ${basedir}/resources/AmazonEC2.wsdl - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12168b58/awsapi/resource/AmazonEC2/crypto.properties ---------------------------------------------------------------------- diff --git a/awsapi/resource/AmazonEC2/crypto.properties b/awsapi/resource/AmazonEC2/crypto.properties deleted file mode 100644 index 77a9eed..0000000 --- a/awsapi/resource/AmazonEC2/crypto.properties +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - - -org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin -org.apache.ws.security.crypto.merlin.keystore.type=jks -org.apache.ws.security.crypto.merlin.keystore.password=apache -org.apache.ws.security.crypto.merlin.keystore.alias=xeskey -org.apache.ws.security.crypto.merlin.alias.password=apache -org.apache.ws.security.crypto.merlin.file=xes.keystore