You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/05/21 12:06:55 UTC
[PATCH core 14/51] Core: Added possiblity to list all Rabbit defined routes by rake rabbit:routes
From: Michal Fojtik <mf...@redhat.com>
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
server/Rakefile | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/server/Rakefile b/server/Rakefile
index 147cdcf..5d205ce 100644
--- a/server/Rakefile
+++ b/server/Rakefile
@@ -193,3 +193,54 @@ namespace :mock do
end
end
+
+namespace :openshift do
+
+ desc "Deploy Deltacloud API to OpenShift"
+ task :deploy do
+ print "RHN or OpenShift login with OpenShift Express access: "
+ STDOUT.flush
+ login = STDIN.gets.chomp
+ print "Password: "
+ system "stty -echo"
+ password = STDIN.gets.chomp
+ system "stty echo"
+ puts `rhc-create-app --rhlogin #{login} --app deltacloudtest --password '#{password}' --type ruby-1.8`
+ end
+end
+
+namespace :rabbit do
+ load File.join(File.dirname(__FILE__), 'config.ru')
+
+ desc "List the routes defined by Rabbit"
+ task :routes do
+ Deltacloud.collections.each do |c|
+ puts "\033[1;32;m#{c.name}\33[0m"
+ c.operations.each do |o|
+ puts "\033[1;37m%6s\033[0m :%-10s %-30s (%s)" % [
+ o.http_method.to_s.upcase,
+ o.operation_name,
+ o.full_path,
+ o.description[0..100]
+ ]
+ end
+ unless c.collections.empty?
+ puts
+ c.collections.each do |s|
+ puts "\033[1;32;m#{s.name}\33[0m"
+ s.operations.each do |o|
+ puts "\033[1;37m%6s\033[0m :%-10s %-30s (%s)" % [
+ o.http_method.to_s.upcase,
+ o.operation_name,
+ o.full_path,
+ o.description[0..100]
+ ]
+ end
+ end
+ end
+ puts
+ end
+ end
+
+end
+
--
1.7.10.1
Re: [PATCH core 14/51] Core: Added possiblity to list all Rabbit
defined routes by rake rabbit:routes
Posted by David Lutterkort <lu...@redhat.com>.
On Mon, 2012-05-21 at 12:06 +0200, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mf...@redhat.com>
>
>
> Signed-off-by: Michal fojtik <mf...@redhat.com>
> ---
> server/Rakefile | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 51 insertions(+)
>
> diff --git a/server/Rakefile b/server/Rakefile
> index 147cdcf..5d205ce 100644
> --- a/server/Rakefile
> +++ b/server/Rakefile
> @@ -193,3 +193,54 @@ namespace :mock do
>
> end
> end
> +
> +namespace :openshift do
> +
> + desc "Deploy Deltacloud API to OpenShift"
> + task :deploy do
> + print "RHN or OpenShift login with OpenShift Express access: "
> + STDOUT.flush
> + login = STDIN.gets.chomp
> + print "Password: "
> + system "stty -echo"
> + password = STDIN.gets.chomp
> + system "stty echo"
> + puts `rhc-create-app --rhlogin #{login} --app deltacloudtest --password '#{password}' --type ruby-1.8`
> + end
> +end
Oooh .. nice
David