Repository: jclouds-examples Updated Branches: refs/heads/master 5662aae4e -> 0168a3998
Remove Clojure examples These have not seen any development in many years. Project: http://git-wip-us.apache.org/repos/asf/jclouds-examples/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds-examples/commit/0168a399 Tree: http://git-wip-us.apache.org/repos/asf/jclouds-examples/tree/0168a399 Diff: http://git-wip-us.apache.org/repos/asf/jclouds-examples/diff/0168a399 Branch: refs/heads/master Commit: 0168a3998effd336f610dd8261ae8f6fb09af2fd Parents: 5662aae Author: Andrew Gaul <g...@apache.org> Authored: Wed Aug 9 14:22:45 2017 -0700 Committer: Andrew Gaul <g...@apache.org> Committed: Wed Aug 9 14:23:04 2017 -0700 ---------------------------------------------------------------------- blobstore-clojure/project.clj | 24 ------- .../src/create_list/containers.clj | 29 -------- compute-clojure/project.clj | 27 -------- .../src/compute_clojure/compute_examples.clj | 71 -------------------- 4 files changed, 151 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/0168a399/blobstore-clojure/project.clj ---------------------------------------------------------------------- diff --git a/blobstore-clojure/project.clj b/blobstore-clojure/project.clj deleted file mode 100644 index fdc5e72..0000000 --- a/blobstore-clojure/project.clj +++ /dev/null @@ -1,24 +0,0 @@ -; -; Licensed to the Apache Software Foundation (ASF) under one or more -; contributor license agreements. See the NOTICE file distributed with -; this work for additional information regarding copyright ownership. -; The ASF licenses this file to You under the Apache License, Version 2.0 -; (the "License"); you may not use this file except in compliance with -; the License. You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -; - -(defproject blobstore-clojure "1.0-SNAPSHOT" - :description "create and list buckets" - :url "https://github.com/jclouds/jclouds-examples/tree/master/blobstore-clojure" - :dependencies [[org.clojure/clojure "1.3.0"] - [org.clojure/tools.logging "0.2.3"] - [org.clojure/core.incubator "0.1.0"] - [org.apache.jclouds/jclouds-allblobstore "1.8.0"]]) http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/0168a399/blobstore-clojure/src/create_list/containers.clj ---------------------------------------------------------------------- diff --git a/blobstore-clojure/src/create_list/containers.clj b/blobstore-clojure/src/create_list/containers.clj deleted file mode 100644 index a286d18..0000000 --- a/blobstore-clojure/src/create_list/containers.clj +++ /dev/null @@ -1,29 +0,0 @@ -; -; Licensed to the Apache Software Foundation (ASF) under one or more -; contributor license agreements. See the NOTICE file distributed with -; this work for additional information regarding copyright ownership. -; The ASF licenses this file to You under the Apache License, Version 2.0 -; (the "License"); you may not use this file except in compliance with -; the License. You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -; - -(ns create-list.containers - (:use org.jclouds.blobstore2) - (:import org.jclouds.blobstore.BlobStore)) - -(defn create-and-list - "create a container, then list all containers in your account" - ([^String provider ^String provider-identity ^String provider-credential ^String container-to-create] - (create-and-list (blobstore provider provider-identity provider-credential) container-to-create)) - ([^BlobStore blobstore container-to-create] - (create-container blobstore container-to-create) - (containers blobstore))) - http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/0168a399/compute-clojure/project.clj ---------------------------------------------------------------------- diff --git a/compute-clojure/project.clj b/compute-clojure/project.clj deleted file mode 100644 index 1fcd312..0000000 --- a/compute-clojure/project.clj +++ /dev/null @@ -1,27 +0,0 @@ -; -; Licensed to the Apache Software Foundation (ASF) under one or more -; contributor license agreements. See the NOTICE file distributed with -; this work for additional information regarding copyright ownership. -; The ASF licenses this file to You under the Apache License, Version 2.0 -; (the "License"); you may not use this file except in compliance with -; the License. You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -; - -(defproject compute-clojure "1.0.0.0" - :description "Clojure compute examples" - :dependencies [[org.clojure/clojure "1.3.0"] - [org.clojure/tools.logging "0.2.3"] - [org.clojure/core.incubator "0.1.0"] - [org.jclouds/jclouds-allcompute "1.6.0"] - [org.jclouds/driver/jclouds-sshj "1.6.0"] - [org.jclouds/labs/joyentcloud "1.6.0"] - [org.jclouds/driver/jclouds-slf4j "1.6.0"] - [ch.qos.logback/logback-classic "1.0.0"]]) http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/0168a399/compute-clojure/src/compute_clojure/compute_examples.clj ---------------------------------------------------------------------- diff --git a/compute-clojure/src/compute_clojure/compute_examples.clj b/compute-clojure/src/compute_clojure/compute_examples.clj deleted file mode 100644 index cda60f2..0000000 --- a/compute-clojure/src/compute_clojure/compute_examples.clj +++ /dev/null @@ -1,71 +0,0 @@ -; -; Licensed to the Apache Software Foundation (ASF) under one or more -; contributor license agreements. See the NOTICE file distributed with -; this work for additional information regarding copyright ownership. -; The ASF licenses this file to You under the Apache License, Version 2.0 -; (the "License"); you may not use this file except in compliance with -; the License. You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. -; - -(ns compute-clojure.compute-examples - (:use - [org.jclouds.compute2] - [clojure.java.io]) - (:import - [org.jclouds.domain LoginCredentials] - [org.jclouds.scriptbuilder InitBuilder] - [org.jclouds.compute.options TemplateOptions$Builder] - [org.jclouds.scriptbuilder.domain Statement Statements] - [org.jclouds.scriptbuilder.statements.login AdminAccess])) - -(defn print-nodes-in-group [compute group] - (let [nodes (nodes-with-details-matching compute #(= group (.getGroup %)))] - (map #(println (format "<< node %s private ips:%s public-ips:%s%n" (.getId %) (private-ips %) (public-ips %))) nodes))) - -(defn get-credentials [] - (-> (LoginCredentials/builder) - (.user (System/getProperty "user.name")) - (.privateKey (slurp (str (System/getProperty "user.home") "/.ssh/id_rsa") :encoding "utf-8")) - (.build))) - -(defn options [login] - (-> (TemplateOptions$Builder/overrideLoginCredentials login) - (.runAsRoot false) - (.wrapInInitScript false))) - -(defn print-exec-response [response] - (let [node (key response) - output (val response)] - (println (format "<< node: %s %s %s %s%n" (.getId node) (private-ips node) (public-ips node) output)))) - -(defn create [compute group] - "Create a new node in the given group" - (do - (println (format ">> adding node to group: %s%n" group)) - (let [response (create-node compute group (TemplateOptions$Builder/runScript (AdminAccess/standard)))] - (println (format "<< %s%n" response)) - response))) - -(defn exec [compute command group login] - "Execute command for the given group, using login" - (do - (println (format ">> running [%s] on group %s as %s%n" command group (.getUser login))) - (let [responses (run-script-on-nodes-matching compute (in-group? group) (Statements/exec command) (options login))] - (map print-exec-response responses) - responses))) - -(defn destroy [compute group] - "Destroy all nodes in the given group" - (do - (println (format ">> destroying nodes in group %s%n" group)) - (let [responses (destroy-nodes-matching compute (in-group? group))] - (map #(println (format "<< %s%n" %)) responses) - responses)))