-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script to display all records for a given zone. Assumes authent…
…ication has happened and that an authentication token is available in the credentials file.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
# | ||
# Matt Jones 2013 | ||
# | ||
# Output a basic set of records for the domain | ||
# Usage: ./details.sh <mydomain.org> | ||
|
||
. ./rsdns_functions.sh | ||
|
||
DOMAIN=$1 | ||
CRED=credentials | ||
. ./$CRED | ||
|
||
getDomainId | ||
|
||
curl -s \ | ||
-H "X-Auth-Token: $TOKEN" \ | ||
-H 'Accept: application/xml' \ | ||
"https://dns.api.rackspacecloud.com/v1.0/${TENANT}/domains/${DOMAINID}" | xmlstarlet fo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Utility functions that are used across the RSDNS scripts and provide common functionality | ||
# | ||
# Matt Jones, 2013 | ||
|
||
# Get the Identifier for a Domain given the DOMAIN name and the TENANT, as well as an authorization TOKEN | ||
function getDomainId() { | ||
DOMAINID=`curl -s -H "X-Auth-Token: $TOKEN" -H 'Accept: application/xml' "https://dns.api.rackspacecloud.com/v1.0/${TENANT}/domains?name=$DOMAIN" | xmlstarlet fo | xmlstarlet sel -N ns2=http://docs.rackspacecloud.com/dns/api/v1.0 -T -t -m "/ns2:domains/ns2:domain" -v "@id" --nl` | ||
} |