providers/dme: rename dnsmadeeasy package to dme
This package rename just makes one consistent name across the docs, packages, and dirs. cc/ @soniah
This commit is contained in:
parent
777d270f20
commit
0ee4e2b46c
|
@ -8,7 +8,7 @@ FEATURES:
|
|||
continously updated as apply is running, meaning that the state is
|
||||
less likely to become corrupt in a catastrophic case: terraform panic
|
||||
or system killing Terraform.
|
||||
* **New provider: `dnsmadeeasy`** [GH-855]
|
||||
* **New provider: `dme` (DNSMadeEasy)** [GH-855]
|
||||
|
||||
IMPROVEMENTS:
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform/builtin/providers/dnsmadeeasy"
|
||||
"github.com/hashicorp/terraform/builtin/providers/dme"
|
||||
"github.com/hashicorp/terraform/plugin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
plugin.Serve(&plugin.ServeOpts{
|
||||
ProviderFunc: dnsmadeeasy.Provider,
|
||||
ProviderFunc: dme.Provider,
|
||||
})
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
package dnsmadeeasy
|
||||
package dme
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
dme "github.com/soniah/dnsmadeeasy"
|
||||
"github.com/soniah/dnsmadeeasy"
|
||||
"log"
|
||||
)
|
||||
|
||||
|
@ -14,14 +14,14 @@ type Config struct {
|
|||
}
|
||||
|
||||
// Client returns a new client for accessing DNSMadeEasy
|
||||
func (c *Config) Client() (*dme.Client, error) {
|
||||
client, err := dme.NewClient(c.AKey, c.SKey)
|
||||
func (c *Config) Client() (*dnsmadeeasy.Client, error) {
|
||||
client, err := dnsmadeeasy.NewClient(c.AKey, c.SKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error setting up client: %s", err)
|
||||
}
|
||||
|
||||
if c.UseSandbox {
|
||||
client.URL = dme.SandboxURL
|
||||
client.URL = dnsmadeeasy.SandboxURL
|
||||
}
|
||||
|
||||
log.Printf("[INFO] DNSMadeEasy Client configured for AKey: %s", client.AKey)
|
|
@ -1,4 +1,4 @@
|
|||
package dnsmadeeasy
|
||||
package dme
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -1,4 +1,4 @@
|
|||
package dnsmadeeasy
|
||||
package dme
|
||||
|
||||
import (
|
||||
"os"
|
|
@ -1,4 +1,4 @@
|
|||
package dnsmadeeasy
|
||||
package dme
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -6,7 +6,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
dme "github.com/soniah/dnsmadeeasy"
|
||||
"github.com/soniah/dnsmadeeasy"
|
||||
)
|
||||
|
||||
func resourceDMERecord() *schema.Resource {
|
||||
|
@ -79,7 +79,7 @@ func resourceDMERecord() *schema.Resource {
|
|||
}
|
||||
|
||||
func resourceDMERecordCreate(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*dme.Client)
|
||||
client := meta.(*dnsmadeeasy.Client)
|
||||
|
||||
domainid := d.Get("domainid").(string)
|
||||
log.Printf("[INFO] Creating record for domainid: %s", domainid)
|
||||
|
@ -102,7 +102,7 @@ func resourceDMERecordCreate(d *schema.ResourceData, meta interface{}) error {
|
|||
}
|
||||
|
||||
func resourceDMERecordRead(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*dme.Client)
|
||||
client := meta.(*dnsmadeeasy.Client)
|
||||
|
||||
domainid := d.Get("domainid").(string)
|
||||
recordid := d.Id()
|
||||
|
@ -117,7 +117,7 @@ func resourceDMERecordRead(d *schema.ResourceData, meta interface{}) error {
|
|||
}
|
||||
|
||||
func resourceDMERecordUpdate(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*dme.Client)
|
||||
client := meta.(*dnsmadeeasy.Client)
|
||||
|
||||
domainid := d.Get("domainid").(string)
|
||||
recordid := d.Id()
|
||||
|
@ -136,7 +136,7 @@ func resourceDMERecordUpdate(d *schema.ResourceData, meta interface{}) error {
|
|||
}
|
||||
|
||||
func resourceDMERecordDelete(d *schema.ResourceData, meta interface{}) error {
|
||||
client := meta.(*dme.Client)
|
||||
client := meta.(*dnsmadeeasy.Client)
|
||||
|
||||
domainid := d.Get("domainid").(string)
|
||||
recordid := d.Id()
|
||||
|
@ -203,7 +203,7 @@ func getAll(d *schema.ResourceData, cr map[string]interface{}) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func setAll(d *schema.ResourceData, rec *dme.Record) error {
|
||||
func setAll(d *schema.ResourceData, rec *dnsmadeeasy.Record) error {
|
||||
d.Set("type", rec.Type)
|
||||
d.Set("name", rec.Name)
|
||||
d.Set("ttl", rec.TTL)
|
|
@ -1,4 +1,4 @@
|
|||
package dnsmadeeasy
|
||||
package dme
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -7,14 +7,14 @@ import (
|
|||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
dme "github.com/soniah/dnsmadeeasy"
|
||||
"github.com/soniah/dnsmadeeasy"
|
||||
)
|
||||
|
||||
var _ = fmt.Sprintf("dummy") // dummy
|
||||
var _ = os.DevNull // dummy
|
||||
|
||||
func TestAccDMERecordA(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -43,7 +43,7 @@ func TestAccDMERecordA(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordCName(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -77,7 +77,7 @@ ANAME can't be tested under sandbox, as the value of the ANAME must be a
|
|||
resolvable address.
|
||||
|
||||
func TestAccDMERecordAName(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -107,7 +107,7 @@ func TestAccDMERecordAName(t *testing.T) {
|
|||
*/
|
||||
|
||||
func TestAccDMERecordMX(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -138,7 +138,7 @@ func TestAccDMERecordMX(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordHTTPRED(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -179,7 +179,7 @@ func TestAccDMERecordHTTPRED(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordTXT(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -208,7 +208,7 @@ func TestAccDMERecordTXT(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordSPF(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -237,7 +237,7 @@ func TestAccDMERecordSPF(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordPTR(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -266,7 +266,7 @@ func TestAccDMERecordPTR(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordNS(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -295,7 +295,7 @@ func TestAccDMERecordNS(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordAAAA(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -324,7 +324,7 @@ func TestAccDMERecordAAAA(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAccDMERecordSRV(t *testing.T) {
|
||||
var record dme.Record
|
||||
var record dnsmadeeasy.Record
|
||||
domainid := os.Getenv("DME_DOMAINID")
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
|
@ -359,7 +359,7 @@ func TestAccDMERecordSRV(t *testing.T) {
|
|||
}
|
||||
|
||||
func testAccCheckDMERecordDestroy(s *terraform.State) error {
|
||||
client := testAccProvider.Meta().(*dme.Client)
|
||||
client := testAccProvider.Meta().(*dnsmadeeasy.Client)
|
||||
|
||||
for _, rs := range s.RootModule().Resources {
|
||||
if rs.Type != "dnsmadeeasy_record" {
|
||||
|
@ -376,7 +376,7 @@ func testAccCheckDMERecordDestroy(s *terraform.State) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func testAccCheckDMERecordExists(n string, record *dme.Record) resource.TestCheckFunc {
|
||||
func testAccCheckDMERecordExists(n string, record *dnsmadeeasy.Record) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
rs, ok := s.RootModule().Resources[n]
|
||||
|
||||
|
@ -388,7 +388,7 @@ func testAccCheckDMERecordExists(n string, record *dme.Record) resource.TestChec
|
|||
return fmt.Errorf("No Record ID is set")
|
||||
}
|
||||
|
||||
client := testAccProvider.Meta().(*dme.Client)
|
||||
client := testAccProvider.Meta().(*dnsmadeeasy.Client)
|
||||
|
||||
foundRecord, err := client.ReadRecord(rs.Primary.Attributes["domainid"], rs.Primary.ID)
|
||||
|
|
@ -9,6 +9,7 @@ body.page-sub{
|
|||
body.layout-atlas,
|
||||
body.layout-consul,
|
||||
body.layout-dnsimple,
|
||||
body.layout-dme,
|
||||
body.layout-cloudflare,
|
||||
body.layout-cloudstack,
|
||||
body.layout-google,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
layout: "dnsmadeeasy"
|
||||
layout: "dme"
|
||||
page_title: "Provider: DNSMadeEasy"
|
||||
sidebar_current: "docs-dnsmadeeasy-index"
|
||||
sidebar_current: "docs-dme-index"
|
||||
description: |-
|
||||
The DNSMadeEasy provider is used to interact with the resources supported by DNSMadeEasy. The provider needs to be configured with the proper credentials before it can be used.
|
||||
---
|
|
@ -45,24 +45,24 @@ required for some record types.
|
|||
http://help.dnsmadeeasy.com/tutorials/managed-dns/ has more
|
||||
information.
|
||||
|
||||
### A Record
|
||||
#### A Record
|
||||
|
||||
* `value` is the hostname
|
||||
|
||||
### CNAME Record
|
||||
#### CNAME Record
|
||||
|
||||
* `value` is the alias name
|
||||
|
||||
### ANAME Record
|
||||
#### ANAME Record
|
||||
|
||||
* `value` is the aname target
|
||||
|
||||
### MX Record
|
||||
#### MX Record
|
||||
|
||||
* `value` is the server
|
||||
* `mxLevel` (Integer, Required) is the MX level
|
||||
|
||||
### HTTPRED Record
|
||||
#### HTTPRED Record
|
||||
|
||||
* `value` is the URL
|
||||
* `hardLink` (Boolean, Optional) If true, any request that is
|
||||
|
@ -80,27 +80,27 @@ information.
|
|||
of this field
|
||||
* `description` (Optional) A human-readable description.
|
||||
|
||||
### TXT Record
|
||||
#### TXT Record
|
||||
|
||||
* `value` is free form text
|
||||
|
||||
### SPF Record
|
||||
#### SPF Record
|
||||
|
||||
* `value` is the SPF definition of hosts allowed to send email
|
||||
|
||||
### PTR Record
|
||||
#### PTR Record
|
||||
|
||||
* `value` is the reverse DNS for the host
|
||||
|
||||
### NS Record
|
||||
#### NS Record
|
||||
|
||||
* `value` is the host name of the server
|
||||
|
||||
### AAAA Record
|
||||
#### AAAA Record
|
||||
|
||||
* `value` is the IPv6 address
|
||||
|
||||
### SRV Record
|
||||
#### SRV Record
|
||||
|
||||
* `value` is the host
|
||||
* `priority` (Integer, Required). Acts the same way as MX Level
|
||||
|
@ -121,7 +121,7 @@ The following attributes are exported:
|
|||
Additional fields may also be exported by some record types -
|
||||
see DNS Record Types.
|
||||
|
||||
## Record Type Examples
|
||||
#### Record Type Examples
|
||||
|
||||
Following are examples of using each of the record types.
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<% wrap_layout :inner do %>
|
||||
<% content_for :sidebar do %>
|
||||
<div class="docs-sidebar hidden-print affix-top" role="complementary">
|
||||
<ul class="nav docs-sidenav">
|
||||
<li<%= sidebar_current("docs-home") %>>
|
||||
<a href="/docs/index.html">« Documentation Home</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-dme-index") %>>
|
||||
<a href="/docs/providers/dme/index.html">DNSMadeEasy Provider</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-dme-resource") %>>
|
||||
<a href="#">Resources</a>
|
||||
<ul class="nav nav-visible">
|
||||
<li<%= sidebar_current("docs-dme-resource-record") %>>
|
||||
<a href="/docs/providers/dme/r/record.html">dme_record</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= yield %>
|
||||
<% end %>
|
|
@ -128,6 +128,10 @@
|
|||
<a href="/docs/providers/do/index.html">DigitalOcean</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-providers-dme") %>>
|
||||
<a href="/docs/providers/dme/index.html">DNSMadeEasy</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-providers-dnsimple") %>>
|
||||
<a href="/docs/providers/dnsimple/index.html">DNSimple</a>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue