dns_la adapter new api
This commit is contained in:
parent
9b691bebe1
commit
3192a05784
@ -42,7 +42,7 @@ dns_la_add() {
|
|||||||
_debug _domain "$_domain"
|
_debug _domain "$_domain"
|
||||||
|
|
||||||
_info "Adding record"
|
_info "Adding record"
|
||||||
|
|
||||||
# record type is enum in new api, 16 for TXT
|
# record type is enum in new api, 16 for TXT
|
||||||
if _la_post "{\"domainId\":\"$_domain_id\",\"type\":16,\"host\":\"$_sub_domain\",\"data\":\"$txtvalue\",\"ttl\":600}" "record"; then
|
if _la_post "{\"domainId\":\"$_domain_id\",\"type\":16,\"host\":\"$_sub_domain\",\"data\":\"$txtvalue\",\"ttl\":600}" "record"; then
|
||||||
if _contains "$response" '"id":'; then
|
if _contains "$response" '"id":'; then
|
||||||
@ -163,7 +163,7 @@ _la_get() {
|
|||||||
|
|
||||||
export _H1="Authorization: Basic $LA_Token"
|
export _H1="Authorization: Basic $LA_Token"
|
||||||
|
|
||||||
if ! response="$(_get "$url" | tr -d ' ' | tr "}" ",")"; then
|
if ! response="$(_get "$url" | tr -d ' ' | tr "}" ",")"; then
|
||||||
_err "Error: $url"
|
_err "Error: $url"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -185,8 +185,8 @@ _la_post() {
|
|||||||
if ! response="$(_post "$body" "$url" "" "$http_method")"; then
|
if ! response="$(_post "$body" "$url" "" "$http_method")"; then
|
||||||
_err "Error: $url"
|
_err "Error: $url"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_debug2 response "$response"
|
_debug2 response "$response"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -196,4 +196,4 @@ _la_token() {
|
|||||||
_debug "$LA_Token"
|
_debug "$LA_Token"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user