瀏覽代碼

include network id in status

tags/v0.1.6
Jonathan Cobb 5 年之前
父節點
當前提交
3926815527
共有 15 個檔案被更改,包括 64 行新增15 行删除
  1. +1
    -1
      bin/bdelete
  2. +1
    -1
      bin/bget
  3. +35
    -0
      bin/bgetn
  4. +2
    -2
      bin/bpost
  5. +1
    -1
      bin/bposte
  6. +2
    -2
      bin/bput
  7. +1
    -1
      bin/bpute
  8. +4
    -1
      bin/bubble_common
  9. +3
    -1
      bin/run.sh
  10. +2
    -0
      bubble-server/src/main/java/bubble/service/cloud/NodeProgressMeter.java
  11. +4
    -1
      bubble-server/src/main/java/bubble/service/cloud/NodeProgressMeterConstants.java
  12. +3
    -0
      bubble-server/src/main/java/bubble/service/cloud/NodeProgressMeterTick.java
  13. +1
    -1
      bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java
  14. +3
    -2
      bubble-server/src/test/resources/models/tests/network/simple_network.json
  15. +1
    -1
      utils/cobbzilla-wizard

+ 1
- 1
bin/bdelete 查看文件

@@ -24,4 +24,4 @@ SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
URL="${1:?no URL provided}"
shift

exec ${SCRIPT_DIR}/bubble delete -U ${URL} ${@}
BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble delete -U ${URL} ${@}

+ 1
- 1
bin/bget 查看文件

@@ -24,4 +24,4 @@ SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
URL="${1:?no URL provided}"
shift

exec ${SCRIPT_DIR}/bubble get -U ${URL} ${@}
BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble get -U ${URL} ${@}

+ 35
- 0
bin/bgetn 查看文件

@@ -0,0 +1,35 @@
#!/bin/bash
#
# Run an HTTP GET against the API, then print out the "name" attribute only
#
# Usage:
#
# bgetn path [options]
#
# path : an API path
# options : bscript options, see bubble.main.BubbleScriptOptions (and parent classes) for more info
#
# Environment variables
#
# BUBBLE_API : which API to use. Default is local (http://127.0.0.1:PORT, where PORT is found in .bubble.env)
# BUBBLE_USER : account to use. Default is root
# BUBBLE_PASS : password for account. Default is root
# BUBBLE_INCLUDE : path to look for JSON include files. default value is to assume we are being run from
# bubble repo, bubble-models repo, or bubble-client and use include files from minimal model.
#
SCRIPT="${0}"
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
. ${SCRIPT_DIR}/bubble_common

URL="${1:?no URL provided}"
shift

JSON="$(BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble get -U ${URL} ${@})"
if [[ ${JSON} = \{* ]] ; then
echo "${JSON}" | jq -r .name
elif [[ "${JSON}" = \[* ]] ; then
echo "${JSON}" | jq -r .[].name
else
echo "not sure what to do with JSON:"
echo "${JSON}"
fi

+ 2
- 2
bin/bpost 查看文件

@@ -39,7 +39,7 @@ fi
shift

if [[ "${REQUEST_JSON}" == "-" ]] ; then
exec ${SCRIPT_DIR}/bubble post -U ${URL} ${@}
BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble post -U ${URL} ${@}
else
cat ${REQUEST_JSON} | exec ${SCRIPT_DIR}/bubble post -U ${URL} ${@}
cat ${REQUEST_JSON} | BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble post -U ${URL} ${@}
fi

+ 1
- 1
bin/bposte 查看文件

@@ -25,4 +25,4 @@ SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
URL="${1:?no URL provided}"
shift

cat /dev/null | exec ${SCRIPT_DIR}/bubble post -U ${URL} ${@}
cat /dev/null | BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble post -U ${URL} ${@}

+ 2
- 2
bin/bput 查看文件

@@ -39,7 +39,7 @@ fi
shift

if [[ "${REQUEST_JSON}" == "-" ]] ; then
exec ${SCRIPT_DIR}/bubble put -U ${URL} ${@}
BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble put -U ${URL} ${@}
else
cat ${REQUEST_JSON} | exec ${SCRIPT_DIR}/bubble put -U ${URL} ${@}
cat ${REQUEST_JSON} | BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble put -U ${URL} ${@}
fi

+ 1
- 1
bin/bpute 查看文件

@@ -25,4 +25,4 @@ SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
URL="${1:?no URL provided}"
shift

cat /dev/null | exec ${SCRIPT_DIR}/bubble put -U ${URL} ${@}
cat /dev/null | BUBBLE_QUIET=1 ${SCRIPT_DIR}/bubble put -U ${URL} ${@}

+ 4
- 1
bin/bubble_common 查看文件

@@ -90,9 +90,12 @@ if [[ -z "${BUBBLE_JAR}" ]] ; then
elif [[ -f "/home/bubble/current/bubble.jar" ]] ; then
BUBBLE_JAR="/home/bubble/current/bubble.jar"
else
BUBBLE_JAR="$(find ${BUBBLE_SCRIPTS}/../bubble-server/target -type f -name bubble*.jar | head -1)"
BUBBLE_JAR="$(find ${BUBBLE_SCRIPTS}/../bubble-server/target -type f -name "bubble*.jar" | head -1)"
fi
fi
if [[ -z "${BUBBLE_JAR}" ]] ; then
echo 1>&2 "warning: bubble jar could not be located"
fi

# Check to see if we are on the PATH, if not suggest that we could be
BUBBLE_BIN="$(cd $(dirname ${0}) && pwd)"


+ 3
- 1
bin/run.sh 查看文件

@@ -55,7 +55,9 @@ if [[ -z "${BUBBLE_ENV}" ]] ; then
fi
fi
if [[ -f ${BUBBLE_ENV} ]] ; then
echo 1>&2 "Loading env: ${BUBBLE_ENV}"
if [[ -z "${BUBBLE_QUIET}" || ${BUBBLE_QUIET} != 1 ]] ; then
echo 1>&2 "Loading env: ${BUBBLE_ENV}"
fi
. ${BUBBLE_ENV}
fi



+ 2
- 0
bubble-server/src/main/java/bubble/service/cloud/NodeProgressMeter.java 查看文件

@@ -86,6 +86,7 @@ public class NodeProgressMeter extends PipedOutputStream implements Runnable {
private NodeProgressMeterTick newTick(String messageKey, String line) {
return new NodeProgressMeterTick()
.setAccount(nn.getAccount())
.setNetwork(nn.getNetwork())
.setMessageKey(messageKey)
.setDetails(line);
}
@@ -156,6 +157,7 @@ public class NodeProgressMeter extends PipedOutputStream implements Runnable {
closed.set(true);
background(this::close);
_setCurrentTick(new NodeProgressMeterTick()
.setNetwork(nn.getNetwork())
.setAccount(nn.getAccount())
.setMessageKey(METER_COMPLETED)
.setPercent(100));


+ 4
- 1
bubble-server/src/main/java/bubble/service/cloud/NodeProgressMeterConstants.java 查看文件

@@ -73,6 +73,7 @@ public class NodeProgressMeterConstants {
if (percent == null) return die("getStandardTicks: "+f.getName()+" entry missing from STANDARD_TICKS");
ticks.add(new NodeProgressMeterTick()
.setAccount(nn.getAccount())
.setNetwork(nn.getNetwork())
.setPattern(value)
.setMatch(exact)
.setMessageKey(f.getName().toLowerCase())
@@ -105,7 +106,9 @@ public class NodeProgressMeterConstants {
public static List<NodeProgressMeterTick> getInstallTicks(NewNodeNotification nn) {
final NodeProgressMeterTick[] installTicks = json(stream2string(TICKS_JSON), NodeProgressMeterTick[].class);
for (NodeProgressMeterTick tick : installTicks) {
tick.setAccount(nn.getAccount()).setMessageKey(INSTALL_TICK_PREFIX + tick.getMessageKey());
tick.setNetwork(nn.getNetwork())
.setAccount(nn.getAccount())
.setMessageKey(INSTALL_TICK_PREFIX + tick.getMessageKey());
}
return asList(installTicks);
}


+ 3
- 0
bubble-server/src/main/java/bubble/service/cloud/NodeProgressMeterTick.java 查看文件

@@ -22,6 +22,9 @@ public class NodeProgressMeterTick {
@Getter @Setter private String account;
public boolean hasAccount() { return !empty(account); }

@Getter @Setter private String network;
public boolean hasNetwork() { return !empty(network); }

@Getter @Setter private String pattern;
@JsonIgnore @Getter(lazy=true) private final Pattern _pattern = Pattern.compile(getPattern());



+ 1
- 1
bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java 查看文件

@@ -652,7 +652,7 @@ public class StandardNetworkService implements NetworkService {
final RedisService stats = getNetworkSetupStatus();
final List<NodeProgressMeterTick> ticks = new ArrayList<>();
for (String key : stats.keys(getProgressMeterPrefix(accountUuid)+"*")) {
final String json = stats.get(key);
final String json = stats.get_withPrefix(key);
if (json != null) {
try {
ticks.add(json(json, NodeProgressMeterTick.class));


+ 3
- 2
bubble-server/src/test/resources/models/tests/network/simple_network.json 查看文件

@@ -169,11 +169,12 @@
},
"response": {
"store": "nn"
}
},
"after": "await_url me/status 40m 20s await_json.length > 0 && await_json[0].getPercent() == 100"
},

{
"before": "await_url https://{{nn.fqdn}}:{{serverConfig.nginxPort}}/api/.bubble 40m 20s",
"before": "await_url https://{{nn.fqdn}}:{{serverConfig.nginxPort}}/api/.bubble 10m 20s",
"comment": "list DNS for the network, should now see a DNS A record for new instance",
"request": {
"uri": "me/networks/{{plan.name}}/dns/find?type=A&name={{{url_encoded_escaped_regex nn.fqdn}}}"


+ 1
- 1
utils/cobbzilla-wizard

@@ -1 +1 @@
Subproject commit e3256afba721949ef4993ce7e13ec5d5ef8c2368
Subproject commit 0bfd8b9c795011392713870f7d604c948a44b8ac

Loading…
取消
儲存