Cloudify REST 脚本
2013-05-10 00:00
274 查看
#!/bin/bash bootOutput="bl.out" rm -f $bootOutput//删除b1.out文件 ./cloudify.sh "bootstrap-cloud ec2" > $bootOutput 2>&1//运行./cloudify.sh bootstrap-cloud ec2并将输出到b1.out和标准输入重定向到标准输出。 searchString="Rest service is" selectedText=`grep "${searchString}" $bootOutput`//查找b1.out中"Rest service is"的行赋给selectedText rawValue=`echo ${selectedText} | awk '{print $6}'`//将selectedText中第六个域(以空格或tab分割)赋给rawValue restURL="${rawValue%?}"//linux字符串操作,删除rawValue的最后一个字符后执行,即提取restURL echo "1st restURL is ${restURL}" >> $bootOutput 2>&1//打印并重定向到b1.out和标准输出 # If there are two management machines (and in production, we recommend it...), # you'll have two Rest URLs rawValue=`echo ${selectedText} | awk '{print $12}'`//和上面一样 rest2URL="${rawValue%?}" echo "2nd restURL is ${rest2URL}" >> $bootOutput 2>&1 # Now set the restURL value in the service context attributes (global scope , # so it'll be available for all applications) : # e.g. : set-attributes -scope global '{"restURL":"${restURL}", "rest2URL":"${rest2URL}"}' ./cloudify.sh "connect ${restURL};set-attributes -scope global '{\"restURL\":\"${restURL}\", \"rest2URL\":\"${rest2URL}\"}'" >> $bootOutput 2>&1//连接restURL并将restURL设为所有应用的全局属性 # Just checking that it's there :) ./cloudify.sh "connect ${restURL};list-attributes" >> $bootOutput 2>&1//测试连接并显示所有属性 # Now you can install any application # and access the restURL attribute (or "rest2URL") # e.g.: In a groovy lifecycle event handler : # def restURL = context.attributes.global["restURL"] # ./cloudify.sh "connect ${restURL};install-application PATH_TO_APPLICATION" >> $bootOutput 2>&1
相关文章推荐
- 使用REST 获取Cloudify属性
- 疯狂Spring Cloud连载(10)REST客户端Feign介绍
- 玩转SpringCloud(F版本) 三.断路器(Hystrix)RestTemplate+Ribbon和Feign两种方式
- Cloudify中DSL构建解析
- SpringCloud教程二:服务消费者(rest+ribbon)
- 《spring cloud微服务实战》读书笔记——Spring Cloud Ribbon(一)RestTemplate
- 开源PaaS平台:Cloudify
- 玩转SpringCloud(F版本) 二.服务消费者(1)ribbon+restTemplate
- REST类型接口测试脚本开发
- 笔记:Spring Cloud Ribbon RestTemplate 详解
- 参考-Cloudify shell命令介绍
- spring cloud RestTemplate消费者使用Hystrix进行容错和服务降级
- springcloud 的学习(二) ribbon + restTample
- 如何使用RED HAT CLOUDFORMS REST API 简述
- springcloud ribbon+rest的url请求失败
- ReactiveCocoa实战: 模仿 "花瓣",重写 LeanCloud Rest Api的iOS REST Client.
- 使用CloudSight API进行图像识别的Python脚本
- SpringCloud(1)---基于RestTemplate微服务项目案例
- Spring Cloud(服务的消费者 ribbon+restTemplate)
- 时隔一年,终于享受了下当年写的自动安装memcloud脚本