This script installs a PowerShell module that provides a wrapper for the DNS Made Easy REST API. The module also provides some helper cmdlets for the following operations:
Add-ARecord Get-Records Remove-Record
The cmdlets return XMLDocument objects that are easily traversable using PowerShell. The following script is an example of importing the DNS Made Easy PowerShell mdule and using the "Add-Arecord" and "Get-Records" functions to update and list DNS records hosted with DNS Made Easy:
# Add DMeTools module to powershell session Import-Module DmeHelpers # Read variables from dashboard inputs $apiKey = "$env:DME_API_KEY" $secretKey = "$env:DME_SECRET_KEY" $domain = "$env:DNS_DOMAIN_NAME" $dnsARecord = "$env:DNS_A_RECORD" # Add A Record Add-ARecord -apiKey $apiKey -secretKey $secretKey -domain $domain -subDomain "$dnsARecord" -ipAddress "$env:RS_PRIVATE_IP" # List records $dnsRecords = Get-Records -apiKey $apiKey -secretKey $secretKey -domain $domain $dnsRecords.record | ft
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.