AddDomainRecord.go 815 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package dns
  2. import (
  3. "encoding/json"
  4. "log"
  5. "github.com/denverdino/aliyungo/common"
  6. )
  7. type AddDomainRecordArgs struct {
  8. DomainName string
  9. RR string
  10. Type string
  11. Value string
  12. //optional
  13. TTL json.Number
  14. Line string
  15. }
  16. type AddDomainRecordResponse struct {
  17. common.Response
  18. InstanceId string
  19. RecordId string
  20. }
  21. // AddDomainRecord
  22. //
  23. // You can read doc at https://docs.aliyun.com/#/pub/dns/api-reference/record-related&AddDomainRecord
  24. func (client *Client) AddDomainRecord(args *AddDomainRecordArgs) (response *AddDomainRecordResponse, err error) {
  25. action := "AddDomainRecord"
  26. response = &AddDomainRecordResponse{}
  27. err = client.Invoke(action, args, response)
  28. if err == nil {
  29. return response, nil
  30. } else {
  31. log.Printf("%s error, %v", action, err)
  32. return response, err
  33. }
  34. }