Files
threshold/internal/tests/cli/boundary/_hosts.bash
T

29 lines
543 B
Bash
Raw Normal View History

function create_host() {
local name=$1
2020-10-12 14:56:23 -07:00
local hcid=$2
boundary hosts create static \
-name $name \
-description 'test host' \
-address '1.1.1.1' \
-host-catalog-id $hcid
}
function read_host() {
boundary hosts read -id $1
}
function delete_host() {
boundary hosts delete -id $1
}
function list_hosts() {
2020-10-12 14:56:23 -07:00
boundary hosts list -host-catalog-id $1 -format json
}
function host_id() {
2020-10-12 14:56:23 -07:00
local name=$1
local hcid=$2
strip $(list_hosts $hcid | jq -c ".[] | select(.name | contains(\"$name\")) | .[\"id\"]")
}