http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_get.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_get.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_get.json new file mode 100644 index 0000000..c38ae77 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_get.json @@ -0,0 +1,62 @@ +{ + "kind": "compute#instance", + "id": "13051190678907570425", + "description": "desc", + "creationTimestamp": "2012-11-25T23:48:20.758", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-0", + "name": "test-0", + "machineType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "status": "RUNNING", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", + "networkInterfaces": [ + { + "kind": "compute#instanceNetworkInterface", + "name": "nic0", + "networkIP": "10.240.121.115", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default" + } + ], + "disks": [ + { + "kind": "compute#instanceDisk", + "type": "PERSISTENT", + "mode": "READ_WRITE", + "deviceName": "test", + "source": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/test", + "index": 0, + "boot": true + } + ], + "serviceAccounts": [ + { + "kind": "compute#serviceAccount", + "email": "default", + "scopes": [ + "myscope" + ] + } + ], + "metadata": { + "items": [ + { + "key": "aKey", + "value": "aValue" + }, + { + "key": "jclouds-image", + "value": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-12-04-v20121106" + }, + { + "key": "jclouds-delete-boot-disk", + "value": "true" + } + ], + "fingerprint": "efgh" + }, + "tags": { + "items": [ + "aTag" + ], + "fingerprint": "abcd" + } +}
http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert.json new file mode 100644 index 0000000..0ce3c53 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert.json @@ -0,0 +1 @@ +{"name":"test-0","description":"desc","machineType":"https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1","serviceAccounts":[{"email":"default","scopes":["myscope"]}],"networkInterfaces":[{"network":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","accessConfigs":[{"type":"ONE_TO_ONE_NAT"}]}],"disks":[{"mode":"READ_WRITE","source":"https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/test","deleteOnTerminate":true,"boot":false,"type":"PERSISTENT"}],"metadata":{"kind":"compute#metadata","items":[{"key":"aKey","value":"aValue"}]}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert_simple.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert_simple.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert_simple.json new file mode 100644 index 0000000..038e7f8 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_insert_simple.json @@ -0,0 +1 @@ +{"name":"test-1","machineType":"https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1","serviceAccounts":[],"networkInterfaces":[{"network":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","accessConfigs":[]}]} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list.json new file mode 100644 index 0000000..7e9595c --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list.json @@ -0,0 +1,69 @@ +{ + "kind": "compute#instanceList", + "id": "projects/myproject/zones/us-central1-a/instances", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances", + "items": [ + { + "kind": "compute#instance", + "id": "13051190678907570425", + "description": "desc", + "creationTimestamp": "2012-11-25T23:48:20.758", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-0", + "name": "test-0", + "machineType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "status": "RUNNING", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", + "networkInterfaces": [ + { + "kind": "compute#instanceNetworkInterface", + "name": "nic0", + "networkIP": "10.240.121.115", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default" + } + ], + "disks": [ + { + "kind": "compute#instanceDisk", + "type": "PERSISTENT", + "mode": "READ_WRITE", + "deviceName": "test", + "source": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/test", + "index": 0, + "boot": true + } + ], + "serviceAccounts": [ + { + "kind": "compute#serviceAccount", + "email": "default", + "scopes": [ + "myscope" + ] + } + ], + "metadata": { + "items": [ + { + "key": "aKey", + "value": "aValue" + }, + { + "key": "jclouds-image", + "value": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-12-04-v20121106" + }, + { + "key": "jclouds-delete-boot-disk", + "value": "true" + } + ], + "fingerprint": "efgh" + }, + "tags": { + "items": [ + "aTag" + ], + "fingerprint": "abcd" + } + } + ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list_central1b_empty.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list_central1b_empty.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list_central1b_empty.json new file mode 100644 index 0000000..51c8793 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_list_central1b_empty.json @@ -0,0 +1,6 @@ +{ + "kind": "compute#instanceList", + "id": "projects/myproject/zones/us-central1-b/instances", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/instances", + "items": [ ] +} http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_serial_port.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_serial_port.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_serial_port.json new file mode 100644 index 0000000..03280cc --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_serial_port.json @@ -0,0 +1,4 @@ +{ + "kind": "compute#serialPortOutput", + "contents": "console output" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_set_metadata.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_set_metadata.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_set_metadata.json new file mode 100644 index 0000000..b39e983 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/instance_set_metadata.json @@ -0,0 +1,10 @@ +{ + "items": [ + { + "key": "foo", + "value": "bar" + } + ], + "fingerprint": "efgh", + "kind": "compute#metadata" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/logback.xml ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/logback.xml b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/logback.xml new file mode 100644 index 0000000..864a5a5 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/logback.xml @@ -0,0 +1,83 @@ +<?xml version="1.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. + +--> +<configuration scan="false"> + <appender name="FILE" class="ch.qos.logback.core.FileAppender"> + <file>target/test-data/jclouds.log</file> + + <encoder> + <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern> + </encoder> + </appender> + + <appender name="WIREFILE" class="ch.qos.logback.core.FileAppender"> + <file>target/test-data/jclouds-wire.log</file> + + <encoder> + <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern> + </encoder> + </appender> + + <appender name="COMPUTEFILE" class="ch.qos.logback.core.FileAppender"> + <file>target/test-data/jclouds-compute.log</file> + + <encoder> + <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern> + </encoder> + </appender> + + <appender name="SSHFILE" class="ch.qos.logback.core.FileAppender"> + <file>target/test-data/jclouds-ssh.log</file> + + <encoder> + <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern> + </encoder> + </appender> + + <root> + <level value="warn" /> + </root> + + <logger name="org.jclouds"> + <level value="TRACE" /> + <appender-ref ref="FILE" /> + </logger> + + <logger name="jclouds.wire"> + <level value="TRACE" /> + <appender-ref ref="WIREFILE" /> + </logger> + + <logger name="jclouds.headers"> + <level value="TRACE" /> + <appender-ref ref="WIREFILE" /> + </logger> + + <logger name="jclouds.compute"> + <level value="TRACE" /> + <appender-ref ref="COMPUTEFILE" /> + </logger> + + <logger name="jclouds.ssh"> + <level value="TRACE" /> + <appender-ref ref="SSHFILE" /> + </logger> + +</configuration> + http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype.json new file mode 100644 index 0000000..01692b3 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype.json @@ -0,0 +1,22 @@ +{ + "kind": "compute#machineType", + "id": "12907738072351752276", + "creationTimestamp": "2012-06-07T20:48:14.670", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "name": "n1-standard-1", + "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", + "guestCpus": 1, + "memoryMb": 3840, + "imageSpaceGb": 10, + "scratchDisks": [ + { + "diskGb": 1770 + }, + { + "diskGb": 1770 + } + ], + "maximumPersistentDisks": 16, + "maximumPersistentDisksSizeGb": "128", + "zone": "us-central1-a" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list.json new file mode 100644 index 0000000..9acb7e0 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list.json @@ -0,0 +1,57 @@ +{ + "kind": "compute#machineTypeList", + "id": "projects/myproject/machineTypes", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes", + "items": [ + { + "kind": "compute#machineType", + "id": "4618642685664990776", + "creationTimestamp": "2013-04-25T13:32:49.088-07:00", + "name": "f1-micro", + "description": "1 vCPU (shared physical core) and 0.6 GB RAM", + "guestCpus": 1, + "memoryMb": 614, + "imageSpaceGb": 0, + "maximumPersistentDisks": 4, + "maximumPersistentDisksSizeGb": "3072", + "zone": "us-central1-a", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/f1-micro" + }, + { + "kind": "compute#machineType", + "id": "12907738072351752276", + "creationTimestamp": "2012-06-07T20:48:14.670", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "name": "n1-standard-1", + "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", + "guestCpus": 1, + "memoryMb": 3840, + "imageSpaceGb": 10, + "maximumPersistentDisks": 16, + "maximumPersistentDisksSizeGb": "128", + "zone": "us-central1-a" + }, + { + "kind": "compute#machineType", + "id": "12908560709887590691", + "creationTimestamp": "2012-06-07T20:51:19.936", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-8-d", + "name": "n1-standard-8-d", + "description": "8 vCPUs, 30 GB RAM, a 10 GB ephemeral root disk, and 2 extra 1770 GB ephemeral disks", + "guestCpus": 8, + "memoryMb": 30720, + "imageSpaceGb": 10, + "scratchDisks": [ + { + "diskGb": 1770 + }, + { + "diskGb": 1770 + } + ], + "maximumPersistentDisks": 16, + "maximumPersistentDisksSizeGb": "1024", + "zone": "us-central1-a" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b.json new file mode 100644 index 0000000..fe5974a --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b.json @@ -0,0 +1,43 @@ +{ + "kind": "compute#machineTypeList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/abayer-jclouds-test1/zones/us-central1-b/machineTypes", + "id": "projects/abayer-jclouds-test1/zones/us-central1-b/machineTypes", + "items": [ + { + "kind": "compute#machineType", + "id": "12907738072351752276", + "creationTimestamp": "2012-06-07T20:48:14.670", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/machineTypes/n1-standard-0", + "name": "n1-standard-0", + "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", + "guestCpus": 1, + "memoryMb": 3840, + "imageSpaceGb": 10, + "maximumPersistentDisks": 16, + "maximumPersistentDisksSizeGb": "128", + "zone": "us-central1-b" + }, + { + "kind": "compute#machineType", + "id": "12908560709887590691", + "creationTimestamp": "2012-06-07T20:51:19.936", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/machineTypes/n1-standard-8-d", + "name": "n1-standard-8-d", + "description": "8 vCPUs, 30 GB RAM, a 10 GB ephemeral root disk, and 2 extra 1770 GB ephemeral disks", + "guestCpus": 8, + "memoryMb": 30720, + "imageSpaceGb": 10, + "scratchDisks": [ + { + "diskGb": 1770 + }, + { + "diskGb": 1770 + } + ], + "maximumPersistentDisks": 16, + "maximumPersistentDisksSizeGb": "1024", + "zone": "us-central1-b" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b_empty.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b_empty.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b_empty.json new file mode 100644 index 0000000..73fe582 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/machinetype_list_central1b_empty.json @@ -0,0 +1,6 @@ +{ + "kind": "compute#machineTypeList", + "id": "projects/myproject/zones/us-central1-b/machineTypes", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/machineTypes", + "items": [] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/metadata.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/metadata.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/metadata.json new file mode 100644 index 0000000..5014270 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/metadata.json @@ -0,0 +1 @@ +{"kind":"compute#metadata","items":[{"key":"propA","value":"valueA"},{"key":"propB","value":"valueB"}],"fingerprint":"efgh"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_get.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_get.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_get.json new file mode 100644 index 0000000..4a7a9cc --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_get.json @@ -0,0 +1,10 @@ +{ + "kind": "compute#network", + "id": "13024414170909937976", + "creationTimestamp": "2012-10-24T20:13:19.967", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/networks/jclouds-test", + "name": "default", + "description": "Default network for the project", + "IPv4Range": "10.0.0.0/8", + "gatewayIPv4": "10.0.0.1" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_insert.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_insert.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_insert.json new file mode 100644 index 0000000..55e8331 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_insert.json @@ -0,0 +1 @@ +{"name":"test-network","IPv4Range":"10.0.0.0/8"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_list.json new file mode 100644 index 0000000..1d15f6e --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/network_list.json @@ -0,0 +1,18 @@ +{ + "kind": "compute#networkList", + "id": "projects/myproject/networks", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/networks", + "items": [ + { + + "kind": "compute#network", + "id": "13024414170909937976", + "creationTimestamp": "2012-10-24T20:13:19.967", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/networks/jclouds-test", + "name": "default", + "description": "Default network for the project", + "IPv4Range": "10.0.0.0/8", + "gatewayIPv4": "10.0.0.1" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation.json new file mode 100644 index 0000000..7ca83c8 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation.json @@ -0,0 +1,17 @@ +{ + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "endTime": "2012-11-28T06:41:06.142", + "operationType": "insert", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_error.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_error.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_error.json new file mode 100644 index 0000000..157f786 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_error.json @@ -0,0 +1,26 @@ +{ + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "httpErrorStatusCode": 400, + "httpErrorMessage": "BAD REQUEST", + "error": { + "errors": [ + { + "code": "RESOURCE_ALREADY_EXISTS", + "message": "The resource 'projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance' already exists" + } + ] + }, + "operationType": "insert", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_list.json new file mode 100644 index 0000000..c83980d --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/operation_list.json @@ -0,0 +1,24 @@ +{ + "kind": "compute#operationList", + "id": "projects/myproject/operations", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/operations", + "items": [ + { + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "endTime": "2012-11-28T06:41:06.142", + "operationType": "insert", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/project.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/project.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/project.json new file mode 100644 index 0000000..c195062 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/project.json @@ -0,0 +1,69 @@ +{ + "kind": "compute#project", + "id": "13024414184846275913", + "creationTimestamp": "2012-10-24T20:13:16.252", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject", + "name": "myproject", + "description": "", + "commonInstanceMetadata": { + "kind": "compute#metadata", + "items": [ + { + "key": "propA", + "value": "valueA" + }, + { + "key": "propB", + "value": "valueB" + } + ], + "fingerprint": "efgh" + }, + "quotas": [ + { + "metric": "INSTANCES", + "usage": 0, + "limit": 8 + }, + { + "metric": "CPUS", + "usage": 0, + "limit": 8 + }, + { + "metric": "EPHEMERAL_ADDRESSES", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS_TOTAL_GB", + "usage": 0, + "limit": 100 + }, + { + "metric": "SNAPSHOTS", + "usage": 0, + "limit": 1000 + }, + { + "metric": "NETWORKS", + "usage": 1, + "limit": 5 + }, + { + "metric": "FIREWALLS", + "usage": 2, + "limit": 100 + }, + { + "metric": "IMAGES", + "usage": 0, + "limit": 100 + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/quota.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/quota.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/quota.json new file mode 100644 index 0000000..b631ab3 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/quota.json @@ -0,0 +1,5 @@ +{ + "metric": "INSTANCES", + "usage": 0, + "limit": 8 +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_get.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_get.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_get.json new file mode 100644 index 0000000..069865d --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_get.json @@ -0,0 +1,60 @@ +{ + "kind": "compute#region", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "id": "12912210600542709766", + "creationTimestamp": "2013-07-08T14:40:37.939-07:00", + "name": "us-central1", + "description": "us-central1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/zones/us-central1-a", + "https://www.googleapis.com/compute/v1/zones/us-central1-b" + ], + "quotas": [ + { + "metric": "INSTANCES", + "usage": 0, + "limit": 8 + }, + { + "metric": "CPUS", + "usage": 0, + "limit": 8 + }, + { + "metric": "EPHEMERAL_ADDRESSES", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS_TOTAL_GB", + "usage": 0, + "limit": 100 + }, + { + "metric": "SNAPSHOTS", + "usage": 0, + "limit": 1000 + }, + { + "metric": "NETWORKS", + "usage": 1, + "limit": 5 + }, + { + "metric": "FIREWALLS", + "usage": 2, + "limit": 100 + }, + { + "metric": "IMAGES", + "usage": 0, + "limit": 100 + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_list.json new file mode 100644 index 0000000..ae0673e --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_list.json @@ -0,0 +1,126 @@ +{ + "kind": "compute#regionList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions", + "id": "projects/myproject/regions", + "items": [ + { + "kind": "compute#region", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "id": "12912210600542709766", + "creationTimestamp": "2013-07-08T14:40:37.939-07:00", + "name": "us-central1", + "description": "us-central1", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/zones/us-central1-a", + "https://www.googleapis.com/compute/v1/zones/us-central1-b" + ], + "quotas": [ + { + "metric": "INSTANCES", + "usage": 0, + "limit": 8 + }, + { + "metric": "CPUS", + "usage": 0, + "limit": 8 + }, + { + "metric": "EPHEMERAL_ADDRESSES", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS_TOTAL_GB", + "usage": 0, + "limit": 100 + }, + { + "metric": "SNAPSHOTS", + "usage": 0, + "limit": 1000 + }, + { + "metric": "NETWORKS", + "usage": 1, + "limit": 5 + }, + { + "metric": "FIREWALLS", + "usage": 2, + "limit": 100 + }, + { + "metric": "IMAGES", + "usage": 0, + "limit": 100 + } + ] + }, + { + "kind": "compute#region", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central2", + "id": "6396763663251190992", + "creationTimestamp": "2013-07-08T14:40:37.939-07:00", + "name": "us-central2", + "description": "us-central2", + "status": "UP", + "zones": [ + "https://www.googleapis.com/compute/v1/zones/us-central2-a" + ], + "quotas": [ + { + "metric": "INSTANCES", + "usage": 0, + "limit": 8 + }, + { + "metric": "CPUS", + "usage": 0, + "limit": 8 + }, + { + "metric": "EPHEMERAL_ADDRESSES", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS", + "usage": 0, + "limit": 8 + }, + { + "metric": "DISKS_TOTAL_GB", + "usage": 0, + "limit": 100 + }, + { + "metric": "SNAPSHOTS", + "usage": 0, + "limit": 1000 + }, + { + "metric": "NETWORKS", + "usage": 1, + "limit": 5 + }, + { + "metric": "FIREWALLS", + "usage": 2, + "limit": 100 + }, + { + "metric": "IMAGES", + "usage": 0, + "limit": 100 + } + ] + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation.json new file mode 100644 index 0000000..67ac27d --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation.json @@ -0,0 +1,16 @@ +{ + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-address", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "endTime": "2012-11-28T06:41:06.142", + "operationType": "insert", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation_list.json new file mode 100644 index 0000000..8a6d619 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/region_operation_list.json @@ -0,0 +1,23 @@ +{ + "kind": "compute#operationList", + "id": "projects/myproject/regions/us-central1/operations", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/operations", + "items": [ + { + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-address", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "endTime": "2012-11-28T06:41:06.142", + "operationType": "insert", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_get.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_get.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_get.json new file mode 100644 index 0000000..be544f2 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_get.json @@ -0,0 +1,14 @@ +{ + + "kind": "compute#route", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375", + "id": "7241926205630356071", + "creationTimestamp": "2013-07-08T14:40:38.502-07:00", + "name": "default-route-c99ebfbed0e1f375", + "description": "Default route to the virtual network.", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", + "destRange": "10.240.0.0/16", + "priority": 1000, + "nextHopNetwork": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", + "tags": [ "fooTag", "barTag" ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_insert.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_insert.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_insert.json new file mode 100644 index 0000000..68fff7d --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_insert.json @@ -0,0 +1 @@ +{"name":"default-route-c99ebfbed0e1f375","description":"Default route to the virtual network.","network":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","destRange":"10.240.0.0/16","priority":1000,"nextHopNetwork":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","tags":["fooTag","barTag"]} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_list.json new file mode 100644 index 0000000..5126ff1 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/route_list.json @@ -0,0 +1,34 @@ +{ + "kind": "compute#routeList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes", + "id": "projects/myproject/global/routes", + "items": [ + { + + "kind": "compute#route", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375", + "id": "7241926205630356071", + "creationTimestamp": "2013-07-08T14:40:38.502-07:00", + "name": "default-route-c99ebfbed0e1f375", + "description": "Default route to the virtual network.", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", + "destRange": "10.240.0.0/16", + "priority": 1000, + "nextHopNetwork": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", + "tags": [ "fooTag", "barTag" ] + }, + { + + "kind": "compute#route", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-fc92a41ecb5a8d17", + "id": "507025480040058551", + "creationTimestamp": "2013-07-08T14:40:38.502-07:00", + "name": "default-route-fc92a41ecb5a8d17", + "description": "Default route to the Internet.", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", + "destRange": "0.0.0.0/0", + "priority": 1000, + "nextHopGateway": "https://www.googleapis.com/compute/v1/projects/myproject/global/gateways/default-internet-gateway" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_get.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_get.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_get.json new file mode 100644 index 0000000..3ba287f --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_get.json @@ -0,0 +1,13 @@ +{ + + "kind": "compute#snapshot", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots/test-snap", + "id": "9734455566806191190", + "creationTimestamp": "2013-07-26T12:54:23.173-07:00", + "status": "READY", + "diskSizeGb": "10", + "sourceDisk": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", + "name": "test-snap", + "description": "", + "sourceDiskId": "8243603669926824540" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_list.json new file mode 100644 index 0000000..431460f --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/snapshot_list.json @@ -0,0 +1,33 @@ +{ + "kind": "compute#snapshotList", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots", + "id": "projects/myproject/global/snapshots", + "items": [ + { + + "kind": "compute#snapshot", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots/test-snap", + "id": "9734455566806191190", + "creationTimestamp": "2013-07-26T12:54:23.173-07:00", + "status": "READY", + "diskSizeGb": "10", + "sourceDisk": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", + "name": "test-snap", + "description": "", + "sourceDiskId": "8243603669926824540" + }, + { + + "kind": "compute#snapshot", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots/test-snap2", + "id": "13895715048576107883", + "creationTimestamp": "2013-07-26T12:57:01.927-07:00", + "status": "READY", + "diskSizeGb": "10", + "sourceDisk": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", + "name": "test-snap2", + "description": "", + "sourceDiskId": "8243603669926824540" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tag_insert.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tag_insert.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tag_insert.json new file mode 100644 index 0000000..61ade71 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tag_insert.json @@ -0,0 +1 @@ +{"items":["aTag"],"fingerprint":"abcd"} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/testpk.pem ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/testpk.pem b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/testpk.pem new file mode 100644 index 0000000..1443074 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/testpk.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQCwqwzakEPP+U9vx9JCuMHebFIVQZ4Sjaj2RU9dJ6YT2s3u7dC6 +/0fGM5xm4fXmSHqyGC6PC8weQSkxnSpbU+R4jMWPM8ML4TIr5wP0avbg+wy3+WWI +of0MN7YHkCfqpaaiKiMw7niK1y07YvxJN8LX1xLpE7aXgIpn6L/qtJdHnQIDAQAB +AoGBAIAHlcsW3W3smPrC7sdXqXeNPHcXFH0RmC7Qz9EMmLiuyqqqQagitFsYr/GH +M3Ltd611BNi5jfUm97ly0m1ZAKp/nkTMVhfKfRIVsBDHtjQHcUOR9tr0LslptmaN +TG0bovbUohe5KwOqMK4YOjUQbInChVBrf7VrNQtv8e0eShdpAkEA3lzLP9QYfP1i +C4iYXqS7cgMDrs3qujC7PoyB54maen+Uvgyau1ZJpKMzXYkORPcYk+b71bl9jF80 +U+7LDnJjPwJBAMtksvL1V8DC5DYL43497JW4KBN4YZ3K7YWx/9gkvc3Q9VdXiUGu +6WKjmcbmsPI/jFdeO71uy934N8qEXLJcyiMCQQCTNKcxWD3l8PCJZiJI9ZFKBwjX +Hmb4X+51mBsfpw7nbbKQplOBFbynC4ujrmoN6e8RaubpNGUTGqvPrNQsejmNAkEA +lUDEAH4BczaQ+QgoXI9ceVG2NvNzzrMHMcC5Ggd8MPhR0VIvKsAMC5I6WjcXSe1Q +Mxy3gf84Ix7u8fHHhCuLOQJAQRhrlXiQUk4cJumNhjza5/+KtaV4FPbEQi+qcWE6 +tGoHPEBfbXyUdcUD4ae8X1W0yri0BuyVNaOCpGCBRIhPZA== +-----END RSA PRIVATE KEY----- http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tokenResponse.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tokenResponse.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tokenResponse.json new file mode 100644 index 0000000..6717a55 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/tokenResponse.json @@ -0,0 +1,5 @@ +{ + "access_token" : "1/8xbJqaOZXSUZbHLl5EOtu1pxz3fmmetKx9W8CV4t79M", + "token_type" : "Bearer", + "expires_in" : 3600 +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_get.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_get.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_get.json new file mode 100644 index 0000000..50cb375 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_get.json @@ -0,0 +1,17 @@ +{ + "kind": "compute#zone", + "id": "13020128040171887099", + "creationTimestamp": "2012-10-19T16:42:54.131", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", + "name": "us-central1-a", + "description": "us-central1-a", + "status": "DOWN", + "maintenanceWindows": [ + { + "name": "2012-11-10-planned-outage", + "description": "maintenance zone", + "beginTime": "2012-11-10T20:00:00.000", + "endTime": "2012-12-02T20:00:00.000" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list.json new file mode 100644 index 0000000..ee4e17b --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list.json @@ -0,0 +1,41 @@ +{ + "kind": "compute#zoneList", + "id": "projects/myproject/zones", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones", + "items": [ + { + "kind": "compute#zone", + "id": "13020128040171887099", + "creationTimestamp": "2012-10-19T16:42:54.131", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", + "name": "us-central1-a", + "description": "us-central1-a", + "status": "DOWN", + "maintenanceWindows": [ + { + "name": "2012-11-10-planned-outage", + "description": "maintenance zone", + "beginTime": "2012-11-10T20:00:00.000", + "endTime": "2012-12-02T20:00:00.000" + } + ] + }, + { + "kind": "compute#zone", + "id": "13024414164050619686", + "creationTimestamp": "2012-10-24T20:13:19.271", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b", + "name": "us-central1-b", + "description": "us-central1-b", + "status": "UP", + "maintenanceWindows": [ + { + "name": "2013-02-17-planned-outage", + "description": "maintenance zone", + "beginTime": "2013-02-17T08:00:00.000", + "endTime": "2013-03-03T08:00:00.000" + } + ] + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list_short.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list_short.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list_short.json new file mode 100644 index 0000000..711af99 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_list_short.json @@ -0,0 +1,24 @@ +{ + "kind": "compute#zoneList", + "id": "projects/myproject/zones", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones", + "items": [ + { + "kind": "compute#zone", + "id": "13020128040171887099", + "creationTimestamp": "2012-10-19T16:42:54.131", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", + "name": "us-central1-a", + "description": "us-central1-a", + "status": "DOWN", + "maintenanceWindows": [ + { + "name": "2012-11-10-planned-outage", + "description": "maintenance zone", + "beginTime": "2012-11-10T20:00:00.000", + "endTime": "2012-12-02T20:00:00.000" + } + ] + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation.json new file mode 100644 index 0000000..c0c5b56 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation.json @@ -0,0 +1,16 @@ +{ + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "endTime": "2012-11-28T06:41:06.142", + "operationType": "insert", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_error.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_error.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_error.json new file mode 100644 index 0000000..d6d054a --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_error.json @@ -0,0 +1,25 @@ +{ + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "httpErrorStatusCode": 400, + "httpErrorMessage": "BAD REQUEST", + "error": { + "errors": [ + { + "code": "RESOURCE_ALREADY_EXISTS", + "message": "The resource 'projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance' already exists" + } + ] + }, + "operationType": "insert", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_list.json ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_list.json b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_list.json new file mode 100644 index 0000000..77f1656 --- /dev/null +++ b/dependencies/jclouds/apis/gce/1.8.0-stratos/src/test/resources/zone_operation_list.json @@ -0,0 +1,23 @@ +{ + "kind": "compute#operationList", + "id": "projects/myproject/zones/us-central1-a/operations", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations", + "items": [ + { + "kind": "compute#operation", + "id": "13053095055850848306", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetId": "13053094017547040099", + "status": "DONE", + "user": "[email protected]", + "progress": 100, + "insertTime": "2012-11-28T06:41:05.060", + "startTime": "2012-11-28T06:41:05.142", + "endTime": "2012-11-28T06:41:06.142", + "operationType": "insert", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" + } + ] +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/dependencies/pom.xml ---------------------------------------------------------------------- diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 5c9a1b0..c37076a 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -37,6 +37,7 @@ <module>jclouds/apis/ec2/1.8.0-stratos</module> <module>jclouds/apis/openstack-nova/1.8.0-stratos</module> <module>jclouds/apis/docker/1.8.0-stratos</module> + <module>jclouds/apis/gce/1.8.0-stratos</module> <module>jclouds/provider/aws-ec2/1.8.0-stratos</module> <module>org.wso2.carbon.ui</module> </modules> http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml ---------------------------------------------------------------------- diff --git a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml index 253a8b9..c957844 100644 --- a/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml +++ b/features/cloud-controller/org.apache.stratos.cloud.controller.feature/pom.xml @@ -166,6 +166,11 @@ <version>1.8.0-stratos</version> </dependency> <dependency> + <groupId>org.apache.stratos</groupId> + <artifactId>gce</artifactId> + <version>1.8.0-stratos</version> + </dependency> + <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>${gson2.version}</version> @@ -299,6 +304,7 @@ <bundleDef>org.apache.stratos:ec2:1.8.0-stratos</bundleDef> <bundleDef>org.apache.stratos:openstack-nova:1.8.0-stratos</bundleDef> <bundleDef>org.apache.stratos:vcloud:1.8.0-stratos</bundleDef> + <bundleDef>org.apache.stratos:gce:1.8.0-stratos</bundleDef> <bundleDef>org.apache.stratos:docker:1.8.0-stratos</bundleDef> <bundleDef>org.apache.commons:commons-compress:1.5</bundleDef> <bundleDef>com.jamesmurty.utils.wso2:java-xmlbuilder:0.4.wso2v1</bundleDef> http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/puppet3-agent/config-gce.sh ---------------------------------------------------------------------- diff --git a/tools/puppet3-agent/config-gce.sh b/tools/puppet3-agent/config-gce.sh new file mode 100644 index 0000000..0c1cbc7 --- /dev/null +++ b/tools/puppet3-agent/config-gce.sh @@ -0,0 +1,101 @@ +#!/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. +# +# -------------------------------------------------------------- +shopt -s nocasematch +ECHO=`which echo` +RM=`which rm` +READ=`which read` +TR=`which tr` +HEAD=`which head` +WGET=`which wget` +MKDIR=`which mkdir` +GREP=`which grep` +SED=`which sed` +CP=`which cp` +MV=`which mv` +CURL=`which curl` + +HOSTSFILE=/etc/hosts +DATE=`date +%d%m%y%S` +RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}" + +function valid_ip() +{ + local ip=$1 + local stat=1 + + if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + OIFS=$IFS + IFS='.' + ip=($ip) + IFS=$OIFS + [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ + && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] + stat=$? + fi + return $stat +} + +read -p "This script will install and configure puppet agent, do you want to continue [y/n]" answer +if [[ $answer = y ]] ; then + + ${CP} -f ${HOSTSFILE} /etc/hosts.tmp + ${MKDIR} -p /tmp/payload + ${CURL} "http://metadata.google.internal/computeMetadata/v1/instance/attributes/stratos_usermetadata" \ + -H "Metadata-Flavor: Google" > /tmp/payload/launch-params + + read -p "Please provide stratos service-name:" SERVICE_NAME + if [[ -z $SERVICE_NAME ]]; then + echo "service is empty!. Base image will be created." + SERVICE_NAME=default + fi + + read -p "Please provide puppet master IP:" PUPPET_IP + if ! valid_ip $PUPPET_IP ; then + echo "invalid IP address format!" + exit -1 + fi + + read -p "Please provide puppet master hostname [puppet.stratos.org]:" DOMAIN + DOMAIN=${DOMAIN:-puppet.stratos.org} + #essential to have PUPPET_HOSTNAME at the end in order to auto-sign the certs + + #read -p "Please provide stratos deployment:" DEPLOYMENT + #DEPLOYMENT=${DEPLOYMENT:-default} + DEPLOYMENT="default" + + NODEID="${RANDOMNUMBER}.${DEPLOYMENT}.${SERVICE_NAME}" + + ${ECHO} -e "\nNode Id ${NODEID}\n" + ${ECHO} -e "\nDomain ${DOMAIN}\n" + + ARGS=("-n${NODEID}" "-d${DOMAIN}" "-s${PUPPET_IP}") + ${ECHO} "\nRunning puppet installation with arguments: ${ARGS[@]}" + /root/bin/puppetinstall/puppetinstall "${ARGS[@]}" + ${RM} /mnt/apache-stratos-cartridge-agent-4.0.0/wso2carbon.lck + ${GREP} -q '/root/bin/init.sh > /tmp/puppet_log' /etc/rc.local || ${SED} -i 's/exit 0$/\/root\/bin\/init.sh \> \/tmp\/puppet_log\nexit 0/' /etc/rc.local + ${RM} -rf /tmp/* + ${RM} -rf /var/lib/puppet/ssl/* + ${MV} -f /etc/hosts.tmp ${HOSTSFILE} + +fi + +# END http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/puppet3-agent/init-gce.sh ---------------------------------------------------------------------- diff --git a/tools/puppet3-agent/init-gce.sh b/tools/puppet3-agent/init-gce.sh new file mode 100644 index 0000000..0ca816f --- /dev/null +++ b/tools/puppet3-agent/init-gce.sh @@ -0,0 +1,146 @@ +#!/bin/bash +# -------------------------------------------------------------- +# +# 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. +# +# -------------------------------------------------------------- + +MKDIR=`which mkdir` +UNZIP=`which unzip` +ECHO=`which echo` +FIND=`which find` +GREP=`which grep` +RM=`which rm` +XARGS=`which xargs` +SED=`which sed` +CUT=`which cut` +AWK=`which awk` +IFCONFIG=`which ifconfig` +HOSTNAME=`which hostname` +SLEEP=`which sleep` +TR=`which tr` +HEAD=`which head` +WGET=`which wget` +PUPPETD=`which puppet` +AGENT="agent" +PUPPETAGENT="${PUPPETD} ${AGENT}" +CURL=`which curl` + +COMMAND="${PUPPETAGENT} -vt" +IP=`${IFCONFIG} eth0 | ${GREP} -e "inet addr" | ${AWK} '{print $2}' | ${CUT} -d ':' -f 2` +LOG=/tmp/puppet-init.log + +HOSTSFILE=/etc/hosts +HOSTNAMEFILE=/etc/hostname +PUPPETCONF=/etc/puppet/puppet.conf + +read_master() { + ${COMMAND} +} + + +is_public_ip_assigned() { + +while true +do + # Reading the internal ip assigned + ${CURL} "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip" \ + -H "Metadata-Flavor: Google" > public-ipv4 + if [ ! -f public-ipv4 ] + then + echo "Public ipv4 file not found. Sleep and retry" >> $LOG + sleep 2; + continue; + else + echo "public-ipv4 file is available. Read value" >> $LOG + # Here means file is available. Read the file + read -r ip<public-ipv4; + echo "value is **[$ip]** " >> $LOG + + if [ -z "$ip" ] + then + echo "File is empty. Retry...." >> $LOG + sleep 2 + rm public-ipv4 + continue + else + echo "public ip is assigned. value is [$ip]. Remove file" >> $LOG + rm public-ipv4 + break + fi + fi +done +} + + +DATE=`date +%d%m%y%S` +RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}" + +if [ ! -d /tmp/payload ]; then + + ## Check whether the public ip is assigned + is_public_ip_assigned + + echo "Public ip have assigned. Continue.." >> $LOG + + ## Clean old poop + ${ECHO} "Removing all existing certificates .." + #${FIND} /var/lib/puppet -type f -print0 | ${XARGS} -0r ${RM} + + ${MKDIR} -p /tmp/payload + ${CURL} "http://metadata.google.internal/computeMetadata/v1/instance/attributes/stratos_usermetadata" \ + -H "Metadata-Flavor: Google" > /tmp/payload/launch-params + + cd /tmp/payload + SERVICE_NAME=`sed 's/,/\n/g' launch-params | grep SERVICE_NAME | cut -d "=" -f 2` + DEPLOYMENT=`sed 's/,/\n/g' launch-params | grep DEPLOYMENT | cut -d "=" -f 2` + INSTANCE_HOSTNAME=`sed 's/,/\n/g' launch-params | grep HOSTNAME | cut -d "=" -f 2` + PUPPET_IP=`sed 's/,/\n/g' launch-params | grep PUPPET_IP | cut -d "=" -f 2` + PUPPET_HOSTNAME=`sed 's/,/\n/g' launch-params | grep PUPPET_HOSTNAME | cut -d "=" -f 2` + PUPPET_ENV=`sed 's/,/\n/g' launch-params | grep PUPPET_ENV | cut -d "=" -f 2` + NODEID="${RANDOMNUMBER}.${DEPLOYMENT}.${SERVICE_NAME}" + #essential to have PUPPET_HOSTNAME at the end in order to auto-sign the certs + DOMAIN="${PUPPET_HOSTNAME}" + ${ECHO} -e "\nNode Id ${NODEID}\n" + ${ECHO} -e "\nDomain ${DOMAIN}\n" + sed -i "s/server=.*/server=${PUPPET_HOSTNAME}/g" ${PUPPETCONF} + /etc/init.d/puppet restart + ARGS=("-n${NODEID}" "-d${DOMAIN}" "-s${PUPPET_IP}") + HOST="${NODEID}.${DOMAIN}" + ${HOSTNAME} ${HOST} + ${ECHO} "${HOST}" > ${HOSTNAMEFILE} + ${ECHO} "${PUPPET_IP} ${PUPPET_HOSTNAME}" >> ${HOSTSFILE} + ${ECHO} "127.0.0.1 ${HOST}" >> ${HOSTSFILE} + /etc/init.d/hostname start + + PUPPET=`which puppet` + PUPPETAGENT="${PUPPET} agent" + RUNPUPPET="${PUPPETAGENT} -vt" + + ${SLEEP} 5 + + ${PUPPETAGENT} --enable + + ${RUNPUPPET} + + ${PUPPETAGENT} --disable + ${ECHO} -e "Initialization completed successfully." + +fi + +# END + http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/stratos-installer/conf/setup.conf ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/conf/setup.conf b/tools/stratos-installer/conf/setup.conf index 1fa114b..70af4e1 100644 --- a/tools/stratos-installer/conf/setup.conf +++ b/tools/stratos-installer/conf/setup.conf @@ -94,6 +94,10 @@ export vcloud_identity="stratos" # vCloud login user export vcloud_credential="password" # vCloud login password export vcloud_jclouds_endpoint="https://vcloud/api" +# GCE +export gce_provider_enabled=false +export gce_identity="<gce_identity>" +export gce_credential="<gce_credential>" # Database configuration # ---------------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml b/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml index b71a1fe..5b4c289 100644 --- a/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml +++ b/tools/stratos-installer/config/all/repository/conf/cloud-controller.xml @@ -85,5 +85,13 @@ <property name="X" value="x" /> <property name="Y" value="y" /> </iaasProviderVCLOUD_PROVIDER_END> + <GCE_PROVIDER_STARTiaasProvider type="gce" name="GCE specific details"> + <className>org.apache.stratos.cloud.controller.iaases.GCEIaas</className> + <provider>google-compute-engine</provider> + <identity svns:secretAlias="cloud.controller.gce.identity">GCE_IDENTITY</identity> + <credential svns:secretAlias="cloud.controller.gce.credential">GCE_CREDENTIAL</credential> + <property name="projectName" value="GCE_PROJECTNAME" />> + <property name="autoAssignIp" value="true" /> + </iaasProviderGCE_PROVIDER_END> </iaasProviders> </cloudController> http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/stratos-installer/ec2.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/ec2.sh b/tools/stratos-installer/ec2.sh index cf38b83..8482866 100755 --- a/tools/stratos-installer/ec2.sh +++ b/tools/stratos-installer/ec2.sh @@ -62,6 +62,8 @@ ${SED} -i "s@OPENSTACK_PROVIDER_START@!--@g" repository/conf/cloud-controller.xm ${SED} -i "s@OPENSTACK_PROVIDER_END@--@g" repository/conf/cloud-controller.xml ${SED} -i "s@VCLOUD_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml ${SED} -i "s@VCLOUD_PROVIDER_END@--@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_END@--@g" repository/conf/cloud-controller.xml popd http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/stratos-installer/gce.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/gce.sh b/tools/stratos-installer/gce.sh new file mode 100755 index 0000000..3cd9039 --- /dev/null +++ b/tools/stratos-installer/gce.sh @@ -0,0 +1,67 @@ +#!/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. +# +# ---------------------------------------------------------------------------- +# +# This script is invoked by setup.sh for configuring OpenStack IaaS information. +# ---------------------------------------------------------------------------- + +# Die on any error: +set -e + +# General commands +if [ "$(uname)" == "Darwin" ]; then + # Do something under Mac OS X platform + SED=`which gsed` && : || (echo "Command 'gsed' is not installed."; exit 10;) +else + # Do something else under some other platform + SED=`which sed` && : || (echo "Command 'sed' is not installed."; exit 10;) +fi + +SLEEP=60 +export LOG=$log_path/stratos-gce.log + +source "./conf/setup.conf" + +stratos_extract_path=$1 + +if [[ ! -d $log_path ]]; then + mkdir -p $log_path +fi + +pushd $stratos_extract_path + +echo "Set vCloud provider specific info in repository/conf/cloud-controller.xml" >> $LOG + +${SED} -i "s@VCLOUD_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml +${SED} -i "s@VCLOUD_PROVIDER_END@--@g" repository/conf/cloud-controller.xml +${SED} -i "s@EC2_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml +${SED} -i "s@EC2_PROVIDER_END@--@g" repository/conf/cloud-controller.xml +${SED} -i "s@OPENSTACK_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml +${SED} -i "s@OPENSTACK_PROVIDER_END@--@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_START@@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_IDENTITY@${gce_identity//@/\\@}@g" repository/conf/cloud-controller.xml +# first replace the newlines in $gce_credential to newline, then add that in the place where +# GCE_CREDENTIAL is found in the xml file +${SED} -i "s@GCE_CREDENTIAL@${gce_credential//$'\n'/\\n}@g" repository/conf/cloud-controller.xml +${SED} -i "s/GCE_PROJECTNAME/$gce_projectname/g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_END@@g" repository/conf/cloud-controller.xml + +popd http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/stratos-installer/openstack.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/openstack.sh b/tools/stratos-installer/openstack.sh index 8f71a7b..ad75cb8 100755 --- a/tools/stratos-installer/openstack.sh +++ b/tools/stratos-installer/openstack.sh @@ -61,5 +61,7 @@ ${SED} -i "s@EC2_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml ${SED} -i "s@EC2_PROVIDER_END@--@g" repository/conf/cloud-controller.xml ${SED} -i "s@VCLOUD_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml ${SED} -i "s@VCLOUD_PROVIDER_END@--@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_END@--@g" repository/conf/cloud-controller.xml popd http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/stratos-installer/setup.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/setup.sh b/tools/stratos-installer/setup.sh index f889151..5a02de2 100755 --- a/tools/stratos-installer/setup.sh +++ b/tools/stratos-installer/setup.sh @@ -191,7 +191,8 @@ function cc_related_popup() { } function cc_conf_validate() { - if [[ $ec2_provider_enabled = "false" && $openstack_provider_enabled = "false" && $vcloud_provider_enabled = "false" ]]; then + if [[ $ec2_provider_enabled = "false" && $openstack_provider_enabled = "false" && $vcloud_provider_enabled = "false" \ + && $gce_provider_enabled = "false" ]]; then echo "Please enable at least one of the IaaS providers in conf/setup.conf file" exit 1 fi @@ -213,6 +214,12 @@ function cc_conf_validate() { exit 1 fi fi + if [[ $gce_provider_enabled = "true" ]]; then + if [[ ( -z $gce_identity || -z $gce_credential ) ]]; then + echo "Please set GCE configuration information in conf/setup.conf file" + exit 1 + fi + fi } # Setup cc @@ -233,6 +240,9 @@ function cc_setup() { if [[ $vcloud_provider_enabled = true ]]; then ./vcloud.sh $stratos_extract_path fi + if [[ $gce_provider_enabled = true ]]; then + ./gce.sh $stratos_extract_path + fi pushd $stratos_extract_path http://git-wip-us.apache.org/repos/asf/stratos/blob/4203d59b/tools/stratos-installer/vcloud.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/vcloud.sh b/tools/stratos-installer/vcloud.sh index ba4893d..ee9a082 100755 --- a/tools/stratos-installer/vcloud.sh +++ b/tools/stratos-installer/vcloud.sh @@ -59,5 +59,7 @@ ${SED} -i "s@EC2_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml ${SED} -i "s@EC2_PROVIDER_END@--@g" repository/conf/cloud-controller.xml ${SED} -i "s@OPENSTACK_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml ${SED} -i "s@OPENSTACK_PROVIDER_END@--@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_START@!--@g" repository/conf/cloud-controller.xml +${SED} -i "s@GCE_PROVIDER_END@--@g" repository/conf/cloud-controller.xml popd
