-
Notifications
You must be signed in to change notification settings - Fork 8
/
create_dns_cname_recordset.go
37 lines (32 loc) · 1.26 KB
/
create_dns_cname_recordset.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package dns
import "github.com/jen20/riviera/azure"
type CNAMERecord struct {
CNAME string `json:"cname" mapstructure:"cname"`
}
type CreateCNAMERecordSetResponse struct {
ID string `mapstructure:"id"`
Name string `mapstructure:"name"`
Location string `mapstructure:"location"`
Tags map[string]*string `mapstructure:"tags"`
TTL *int `mapstructure:"TTL"`
CNAMERecord CNAMERecord `mapstructure:"CNAMERecord"`
}
type CreateCNAMERecordSet struct {
Name string `json:"-"`
ResourceGroupName string `json:"-"`
ZoneName string `json:"-"`
Location string `json:"-" riviera:"location"`
Tags map[string]*string `json:"-" riviera:"tags"`
TTL int `json:"TTL"`
CNAMERecord CNAMERecord `json:"CNAMERecord"`
}
func (command CreateCNAMERecordSet) APIInfo() azure.APIInfo {
return azure.APIInfo{
APIVersion: apiVersion,
Method: "PUT",
URLPathFunc: dnsRecordSetDefaultURLPathFunc(command.ResourceGroupName, command.ZoneName, "CNAME", command.Name),
ResponseTypeFunc: func() interface{} {
return &CreateCNAMERecordSetResponse{}
},
}
}