mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-14 17:42:24 +01:00
Chip Childers patch for fixing license headers - awsapi-setup
https://reviews.apache.org/r/5438/
This commit is contained in:
parent
9687520712
commit
bc1c897901
@ -1,3 +1,21 @@
|
||||
-- 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_policy_alter.sql) can be applied to an existing cloudbridge
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
-- 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.
|
||||
|
||||
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI';
|
||||
|
||||
DROP DATABASE IF EXISTS cloudbridge;
|
||||
|
||||
@ -1,47 +1,64 @@
|
||||
USE cloudbridge;
|
||||
|
||||
ALTER TABLE shost ADD UNIQUE shost_uq_host(Host, HostType, ExportRoot);
|
||||
ALTER TABLE shost ADD CONSTRAINT FOREIGN KEY shost_fk_mhost_id(MHostID) REFERENCES mhost(ID);
|
||||
ALTER TABLE shost ADD INDEX shost_idx_mhost_id(MHostID);
|
||||
|
||||
ALTER TABLE sbucket ADD UNIQUE sbucket_uq_name(Name);
|
||||
ALTER TABLE sbucket ADD CONSTRAINT FOREIGN KEY sbucket_fk_shost_id(SHostID) REFERENCES shost(ID);
|
||||
ALTER TABLE sbucket ADD INDEX sbucket_idx_shost_id(SHostID);
|
||||
ALTER TABLE sbucket ADD INDEX sbucket_idx_owner_cid(OwnerCanonicalID);
|
||||
ALTER TABLE sbucket ADD INDEX sbucket_idx_create_time(CreateTime);
|
||||
|
||||
ALTER TABLE sobject ADD CONSTRAINT FOREIGN KEY sobject_fk_sbuckt_id(SBucketID) REFERENCES sbucket(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE sobject ADD INDEX sobject_idx_bucket_id(SBucketID);
|
||||
ALTER TABLE sobject ADD INDEX sobject_idx_owner_cid(OwnerCanonicalID);
|
||||
ALTER TABLE sobject ADD UNIQUE sobject_uq_sbucket_id_name_key(SBucketID, NameKey);
|
||||
ALTER TABLE sobject ADD INDEX sobject_idx_create_time(CreateTime);
|
||||
|
||||
ALTER TABLE sobject_item ADD CONSTRAINT FOREIGN KEY sobject_item_fk_object_id(SObjectID) REFERENCES sobject(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_object_id(SObjectID);
|
||||
ALTER TABLE sobject_item ADD UNIQUE sobject_item_uq_sobject_id_version(SObjectID, Version);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_create_time(CreateTime);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_modify_time(LastModifiedTime);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_access_time(LastAccessTime);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_stored_size(StoredSize);
|
||||
|
||||
ALTER TABLE meta ADD UNIQUE meta_uq_target_name(Target, TargetID, Name);
|
||||
ALTER TABLE meta ADD INDEX meta_idx_target(Target, TargetID);
|
||||
|
||||
ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings1(AccessKey);
|
||||
ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings2(CertUniqueId);
|
||||
ALTER TABLE usercredentials ADD INDEX usercredentials_idx_access(AccessKey);
|
||||
ALTER TABLE usercredentials ADD INDEX usercredentials_idx_cert(CertUniqueId);
|
||||
|
||||
ALTER TABLE acl ADD INDEX acl_idx_target(Target, TargetID);
|
||||
ALTER TABLE acl ADD INDEX acl_idx_modify_time(LastModifiedTime);
|
||||
|
||||
ALTER TABLE mhost ADD UNIQUE mhost_uq_host(Host);
|
||||
ALTER TABLE mhost ADD INDEX mhost_idx_mhost_key(MHostKey);
|
||||
ALTER TABLE mhost ADD INDEX mhost_idx_heartbeat_time(LastHeartbeatTime);
|
||||
|
||||
ALTER TABLE mhost_mount ADD UNIQUE mhost_mnt_uq_mhost_shost(MHostID, SHostID);
|
||||
ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_mhost_id(MHostID) REFERENCES mhost(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_shost_id(SHostID) REFERENCES shost(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mhost_id(MHostID);
|
||||
ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_shost_id(SHostID);
|
||||
ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mount_time(LastMountTime);
|
||||
-- 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 shost ADD UNIQUE shost_uq_host(Host, HostType, ExportRoot);
|
||||
ALTER TABLE shost ADD CONSTRAINT FOREIGN KEY shost_fk_mhost_id(MHostID) REFERENCES mhost(ID);
|
||||
ALTER TABLE shost ADD INDEX shost_idx_mhost_id(MHostID);
|
||||
|
||||
ALTER TABLE sbucket ADD UNIQUE sbucket_uq_name(Name);
|
||||
ALTER TABLE sbucket ADD CONSTRAINT FOREIGN KEY sbucket_fk_shost_id(SHostID) REFERENCES shost(ID);
|
||||
ALTER TABLE sbucket ADD INDEX sbucket_idx_shost_id(SHostID);
|
||||
ALTER TABLE sbucket ADD INDEX sbucket_idx_owner_cid(OwnerCanonicalID);
|
||||
ALTER TABLE sbucket ADD INDEX sbucket_idx_create_time(CreateTime);
|
||||
|
||||
ALTER TABLE sobject ADD CONSTRAINT FOREIGN KEY sobject_fk_sbuckt_id(SBucketID) REFERENCES sbucket(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE sobject ADD INDEX sobject_idx_bucket_id(SBucketID);
|
||||
ALTER TABLE sobject ADD INDEX sobject_idx_owner_cid(OwnerCanonicalID);
|
||||
ALTER TABLE sobject ADD UNIQUE sobject_uq_sbucket_id_name_key(SBucketID, NameKey);
|
||||
ALTER TABLE sobject ADD INDEX sobject_idx_create_time(CreateTime);
|
||||
|
||||
ALTER TABLE sobject_item ADD CONSTRAINT FOREIGN KEY sobject_item_fk_object_id(SObjectID) REFERENCES sobject(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_object_id(SObjectID);
|
||||
ALTER TABLE sobject_item ADD UNIQUE sobject_item_uq_sobject_id_version(SObjectID, Version);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_create_time(CreateTime);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_modify_time(LastModifiedTime);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_access_time(LastAccessTime);
|
||||
ALTER TABLE sobject_item ADD INDEX sobject_item_idx_stored_size(StoredSize);
|
||||
|
||||
ALTER TABLE meta ADD UNIQUE meta_uq_target_name(Target, TargetID, Name);
|
||||
ALTER TABLE meta ADD INDEX meta_idx_target(Target, TargetID);
|
||||
|
||||
ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings1(AccessKey);
|
||||
ALTER TABLE usercredentials ADD UNIQUE usercredentials_mappings2(CertUniqueId);
|
||||
ALTER TABLE usercredentials ADD INDEX usercredentials_idx_access(AccessKey);
|
||||
ALTER TABLE usercredentials ADD INDEX usercredentials_idx_cert(CertUniqueId);
|
||||
|
||||
ALTER TABLE acl ADD INDEX acl_idx_target(Target, TargetID);
|
||||
ALTER TABLE acl ADD INDEX acl_idx_modify_time(LastModifiedTime);
|
||||
|
||||
ALTER TABLE mhost ADD UNIQUE mhost_uq_host(Host);
|
||||
ALTER TABLE mhost ADD INDEX mhost_idx_mhost_key(MHostKey);
|
||||
ALTER TABLE mhost ADD INDEX mhost_idx_heartbeat_time(LastHeartbeatTime);
|
||||
|
||||
ALTER TABLE mhost_mount ADD UNIQUE mhost_mnt_uq_mhost_shost(MHostID, SHostID);
|
||||
ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_mhost_id(MHostID) REFERENCES mhost(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE mhost_mount ADD CONSTRAINT FOREIGN KEY mhost_mnt_fk_shost_id(SHostID) REFERENCES shost(ID) ON DELETE CASCADE;
|
||||
ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mhost_id(MHostID);
|
||||
ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_shost_id(SHostID);
|
||||
ALTER TABLE mhost_mount ADD INDEX mhost_mnt_idx_mount_time(LastMountTime);
|
||||
|
||||
@ -1,3 +1,20 @@
|
||||
-- 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
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
-- 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;
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
-- 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
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
-- 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);
|
||||
|
||||
@ -1,3 +1,21 @@
|
||||
-- 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);
|
||||
|
||||
@ -1,144 +1,162 @@
|
||||
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 <AccessKey,SecretKey>
|
||||
-- each account has to have a separate <CertUniqueID,AccessKey> 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;
|
||||
|
||||
-- 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 <AccessKey,SecretKey>
|
||||
-- each account has to have a separate <CertUniqueID,AccessKey> 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;
|
||||
|
||||
|
||||
@ -1,7 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# deploy-db-bridge.sh -- deploys the cloudbridge database configuration.
|
||||
#
|
||||
# set -x
|
||||
# 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"
|
||||
|
||||
@ -1,4 +1,20 @@
|
||||
#!/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
|
||||
#
|
||||
|
||||
@ -1,5 +1,22 @@
|
||||
#!/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
|
||||
|
||||
@ -1,5 +1,22 @@
|
||||
#!/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.
|
||||
#
|
||||
|
||||
|
||||
@ -1,4 +1,21 @@
|
||||
#!/cygdrive/c/python26/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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user