1/** 2 * Copyright 2016 IBM Corp. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/** 18 * AUTOMATICALLY GENERATED CODE - DO NOT MODIFY 19 */ 20 21package services 22 23import ( 24 "fmt" 25 "strings" 26 27 "github.com/softlayer/softlayer-go/datatypes" 28 "github.com/softlayer/softlayer-go/session" 29 "github.com/softlayer/softlayer-go/sl" 30) 31 32// The SoftLayer_Dns_Domain data type represents a single DNS domain record hosted on the SoftLayer nameservers. Domains contain general information about the domain name such as name and serial. Individual records such as A, AAAA, CTYPE, and MX records are stored in the domain's associated [[SoftLayer_Dns_Domain_ResourceRecord (type)|SoftLayer_Dns_Domain_ResourceRecord]] records. 33type Dns_Domain struct { 34 Session *session.Session 35 Options sl.Options 36} 37 38// GetDnsDomainService returns an instance of the Dns_Domain SoftLayer service 39func GetDnsDomainService(sess *session.Session) Dns_Domain { 40 return Dns_Domain{Session: sess} 41} 42 43func (r Dns_Domain) Id(id int) Dns_Domain { 44 r.Options.Id = &id 45 return r 46} 47 48func (r Dns_Domain) Mask(mask string) Dns_Domain { 49 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 50 mask = fmt.Sprintf("mask[%s]", mask) 51 } 52 53 r.Options.Mask = mask 54 return r 55} 56 57func (r Dns_Domain) Filter(filter string) Dns_Domain { 58 r.Options.Filter = filter 59 return r 60} 61 62func (r Dns_Domain) Limit(limit int) Dns_Domain { 63 r.Options.Limit = &limit 64 return r 65} 66 67func (r Dns_Domain) Offset(offset int) Dns_Domain { 68 r.Options.Offset = &offset 69 return r 70} 71 72// Create an A record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_AType. 73func (r Dns_Domain) CreateARecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_AType, err error) { 74 params := []interface{}{ 75 host, 76 data, 77 ttl, 78 } 79 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createARecord", params, &r.Options, &resp) 80 return 81} 82 83// Create an AAAA record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_AaaaType. 84func (r Dns_Domain) CreateAaaaRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_AaaaType, err error) { 85 params := []interface{}{ 86 host, 87 data, 88 ttl, 89 } 90 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createAaaaRecord", params, &r.Options, &resp) 91 return 92} 93 94// Create a CNAME record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createCnameRecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_CnameType. 95func (r Dns_Domain) CreateCnameRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_CnameType, err error) { 96 params := []interface{}{ 97 host, 98 data, 99 ttl, 100 } 101 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createCnameRecord", params, &r.Options, &resp) 102 return 103} 104 105// Create an MX record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. MX records are created with a default priority of 10. createMxRecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_MxType. 106func (r Dns_Domain) CreateMxRecord(host *string, data *string, ttl *int, mxPriority *int) (resp datatypes.Dns_Domain_ResourceRecord_MxType, err error) { 107 params := []interface{}{ 108 host, 109 data, 110 ttl, 111 mxPriority, 112 } 113 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createMxRecord", params, &r.Options, &resp) 114 return 115} 116 117// Create an NS record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createNsRecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_NsType. 118func (r Dns_Domain) CreateNsRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_NsType, err error) { 119 params := []interface{}{ 120 host, 121 data, 122 ttl, 123 } 124 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createNsRecord", params, &r.Options, &resp) 125 return 126} 127 128// Create a new domain on the SoftLayer name servers. The SoftLayer_Dns_Domain object passed to this function must have at least one A or AAAA resource record. 129// 130// createObject creates a default SOA record with the data: 131// * '''host''': "@" 132// * '''data''': "ns1.softlayer.com." 133// * '''responsible person''': "root.[your domain name]." 134// * '''expire''': 604800 seconds 135// * '''refresh''': 3600 seconds 136// * '''retry''': 300 seconds 137// * '''minimum''': 3600 seconds 138// 139// 140// If your new domain uses the .de top-level domain then SOA refresh is set to 10000 seconds, retry is set to 1800 seconds, and minimum to 10000 seconds. 141// 142// If your domain doesn't contain NS resource records for ns1.softlayer.com or ns2.softlayer.com then ''createObject'' will create them for you. 143// 144// ''createObject'' returns a Boolean ''true'' on successful object creation or ''false'' if your domain was unable to be created.. 145func (r Dns_Domain) CreateObject(templateObject *datatypes.Dns_Domain) (resp datatypes.Dns_Domain, err error) { 146 params := []interface{}{ 147 templateObject, 148 } 149 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createObject", params, &r.Options, &resp) 150 return 151} 152 153// Create multiple domains on the SoftLayer name servers. Each domain record passed to ''createObjects'' follows the logic in the SoftLayer_Dns_Domain ''createObject'' method. 154func (r Dns_Domain) CreateObjects(templateObjects []datatypes.Dns_Domain) (resp []datatypes.Dns_Domain, err error) { 155 params := []interface{}{ 156 templateObjects, 157 } 158 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createObjects", params, &r.Options, &resp) 159 return 160} 161 162// setPtrRecordForIpAddress() sets a single reverse DNS record for a single IP address and returns the newly created or edited [[SoftLayer_Dns_Domain_ResourceRecord]] record. Currently this method only supports IPv4 addresses and performs no operation when given an IPv6 address. 163func (r Dns_Domain) CreatePtrRecord(ipAddress *string, ptrRecord *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord, err error) { 164 params := []interface{}{ 165 ipAddress, 166 ptrRecord, 167 ttl, 168 } 169 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createPtrRecord", params, &r.Options, &resp) 170 return 171} 172 173// Create an SPF record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_SpfType. 174func (r Dns_Domain) CreateSpfRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_SpfType, err error) { 175 params := []interface{}{ 176 host, 177 data, 178 ttl, 179 } 180 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createSpfRecord", params, &r.Options, &resp) 181 return 182} 183 184// Create a TXT record on a SoftLayer domain. This is a shortcut method, meant to take the work out of creating a SoftLayer_Dns_Domain_ResourceRecord if you already have a domain record available. createARecord returns the newly created SoftLayer_Dns_Domain_ResourceRecord_TxtType. 185func (r Dns_Domain) CreateTxtRecord(host *string, data *string, ttl *int) (resp datatypes.Dns_Domain_ResourceRecord_TxtType, err error) { 186 params := []interface{}{ 187 host, 188 data, 189 ttl, 190 } 191 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "createTxtRecord", params, &r.Options, &resp) 192 return 193} 194 195// deleteObject permanently removes a domain and all of it's associated resource records from the softlayer name servers. '''This cannot be undone.''' Be wary of running this method. If you remove a domain in error you will need to re-create it by creating a new SoftLayer_Dns_Domain object. 196func (r Dns_Domain) DeleteObject() (resp bool, err error) { 197 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "deleteObject", nil, &r.Options, &resp) 198 return 199} 200 201// Retrieve The SoftLayer customer account that owns a domain. 202func (r Dns_Domain) GetAccount() (resp datatypes.Account, err error) { 203 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getAccount", nil, &r.Options, &resp) 204 return 205} 206 207// Search for [[SoftLayer_Dns_Domain]] records by domain name. getByDomainName() performs an inclusive search for domain records, returning multiple records based on partial name matches. Use this method to locate domain records if you don't have access to their id numbers. 208func (r Dns_Domain) GetByDomainName(name *string) (resp []datatypes.Dns_Domain, err error) { 209 params := []interface{}{ 210 name, 211 } 212 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getByDomainName", params, &r.Options, &resp) 213 return 214} 215 216// Retrieve A flag indicating that the dns domain record is a managed resource. 217func (r Dns_Domain) GetManagedResourceFlag() (resp bool, err error) { 218 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getManagedResourceFlag", nil, &r.Options, &resp) 219 return 220} 221 222// getObject retrieves the SoftLayer_Dns_Domain object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Dns_Domain service. You can only retrieve domains that are assigned to your SoftLayer account. 223func (r Dns_Domain) GetObject() (resp datatypes.Dns_Domain, err error) { 224 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getObject", nil, &r.Options, &resp) 225 return 226} 227 228// Retrieve The individual records contained within a domain record. These include but are not limited to A, AAAA, MX, CTYPE, SPF and TXT records. 229func (r Dns_Domain) GetResourceRecords() (resp []datatypes.Dns_Domain_ResourceRecord, err error) { 230 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getResourceRecords", nil, &r.Options, &resp) 231 return 232} 233 234// Retrieve The secondary DNS record that defines this domain as being managed through zone transfers. 235func (r Dns_Domain) GetSecondary() (resp datatypes.Dns_Secondary, err error) { 236 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getSecondary", nil, &r.Options, &resp) 237 return 238} 239 240// Retrieve The start of authority (SOA) record contains authoritative and propagation details for a DNS zone. This property is not considered in requests to createObject and editObject. 241func (r Dns_Domain) GetSoaResourceRecord() (resp datatypes.Dns_Domain_ResourceRecord_SoaType, err error) { 242 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getSoaResourceRecord", nil, &r.Options, &resp) 243 return 244} 245 246// Return a SoftLayer hosted domain and resource records' data formatted as zone file. 247func (r Dns_Domain) GetZoneFileContents() (resp string, err error) { 248 err = r.Session.DoRequest("SoftLayer_Dns_Domain", "getZoneFileContents", nil, &r.Options, &resp) 249 return 250} 251 252// The SoftLayer_Dns_Domain_Registration data type represents a domain registration record. 253type Dns_Domain_Registration struct { 254 Session *session.Session 255 Options sl.Options 256} 257 258// GetDnsDomainRegistrationService returns an instance of the Dns_Domain_Registration SoftLayer service 259func GetDnsDomainRegistrationService(sess *session.Session) Dns_Domain_Registration { 260 return Dns_Domain_Registration{Session: sess} 261} 262 263func (r Dns_Domain_Registration) Id(id int) Dns_Domain_Registration { 264 r.Options.Id = &id 265 return r 266} 267 268func (r Dns_Domain_Registration) Mask(mask string) Dns_Domain_Registration { 269 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 270 mask = fmt.Sprintf("mask[%s]", mask) 271 } 272 273 r.Options.Mask = mask 274 return r 275} 276 277func (r Dns_Domain_Registration) Filter(filter string) Dns_Domain_Registration { 278 r.Options.Filter = filter 279 return r 280} 281 282func (r Dns_Domain_Registration) Limit(limit int) Dns_Domain_Registration { 283 r.Options.Limit = &limit 284 return r 285} 286 287func (r Dns_Domain_Registration) Offset(offset int) Dns_Domain_Registration { 288 r.Options.Offset = &offset 289 return r 290} 291 292// The addNameserversToDomain method adds nameservers to a domain for a domain that already has nameservers assigned to it. This method does not create a nameserver; the nameserver must already exist. 293func (r Dns_Domain_Registration) AddNameserversToDomain(nameservers []string) (resp bool, err error) { 294 params := []interface{}{ 295 nameservers, 296 } 297 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "addNameserversToDomain", params, &r.Options, &resp) 298 return 299} 300 301// The deleteRegisteredNameserver method deletes a nameserver that was registered, provided it is not currently serving a domain 302func (r Dns_Domain_Registration) DeleteRegisteredNameserver(nameserver *string) (resp bool, err error) { 303 params := []interface{}{ 304 nameserver, 305 } 306 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "deleteRegisteredNameserver", params, &r.Options, &resp) 307 return 308} 309 310// Retrieve The SoftLayer customer account that the domain is registered to. 311func (r Dns_Domain_Registration) GetAccount() (resp datatypes.Account, err error) { 312 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getAccount", nil, &r.Options, &resp) 313 return 314} 315 316// The getAuthenticationCode method retrieves the authentication code for the domain. 317func (r Dns_Domain_Registration) GetAuthenticationCode() (resp string, err error) { 318 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getAuthenticationCode", nil, &r.Options, &resp) 319 return 320} 321 322// The getDomainInformation method retrieves all the information for a domain. 323func (r Dns_Domain_Registration) GetDomainInformation() (resp datatypes.Container_Dns_Domain_Registration_Information, err error) { 324 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getDomainInformation", nil, &r.Options, &resp) 325 return 326} 327 328// The getDomainNameservers method retrieve nameservers information for domain. 329func (r Dns_Domain_Registration) GetDomainNameservers() (resp []datatypes.Container_Dns_Domain_Registration_Nameserver, err error) { 330 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getDomainNameservers", nil, &r.Options, &resp) 331 return 332} 333 334// Retrieve The domain registration status. 335func (r Dns_Domain_Registration) GetDomainRegistrationStatus() (resp datatypes.Dns_Domain_Registration_Status, err error) { 336 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getDomainRegistrationStatus", nil, &r.Options, &resp) 337 return 338} 339 340// The getExtendedAttributes method determines if a country code top level domain requires extended attributes. 341func (r Dns_Domain_Registration) GetExtendedAttributes(domainName *string) (resp []datatypes.Container_Dns_Domain_Registration_ExtendedAttribute, err error) { 342 params := []interface{}{ 343 domainName, 344 } 345 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getExtendedAttributes", params, &r.Options, &resp) 346 return 347} 348 349// getObject retrieves the SoftLayer_Dns_Domain_Registration object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Dns_Domain_Registration service. 350func (r Dns_Domain_Registration) GetObject() (resp datatypes.Dns_Domain_Registration, err error) { 351 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getObject", nil, &r.Options, &resp) 352 return 353} 354 355// The getRegisteredNameserver method retrieves registered nameservers. 356func (r Dns_Domain_Registration) GetRegisteredNameserver() (resp datatypes.Container_Dns_Domain_Registration_Nameserver, err error) { 357 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getRegisteredNameserver", nil, &r.Options, &resp) 358 return 359} 360 361// Retrieve The registrant verification status. 362func (r Dns_Domain_Registration) GetRegistrantVerificationStatus() (resp datatypes.Dns_Domain_Registration_Registrant_Verification_Status, err error) { 363 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getRegistrantVerificationStatus", nil, &r.Options, &resp) 364 return 365} 366 367// When a domain is registered or transferred, or when the registrant contact information is changed, the registrant must reply to an email requesting them to confirm that the submitted contact information is correct. This method returns the current state of the verification request. 368func (r Dns_Domain_Registration) GetRegistrantVerificationStatusDetail() (resp datatypes.Container_Dns_Domain_Registration_Registrant_Verification_StatusDetail, err error) { 369 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getRegistrantVerificationStatusDetail", nil, &r.Options, &resp) 370 return 371} 372 373// Retrieve 374func (r Dns_Domain_Registration) GetServiceProvider() (resp datatypes.Service_Provider, err error) { 375 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getServiceProvider", nil, &r.Options, &resp) 376 return 377} 378 379// The getTransferInformation method checks to see if the domain can be transferred and also can be used to check the status of the last transfer request. 380func (r Dns_Domain_Registration) GetTransferInformation(domainName *string) (resp datatypes.Container_Dns_Domain_Registration_Transfer_Information, err error) { 381 params := []interface{}{ 382 domainName, 383 } 384 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "getTransferInformation", params, &r.Options, &resp) 385 return 386} 387 388// The lockDomain method locks a domain to prevent unauthorized, unwanted or accidental changes to the domain name. When set, the following actions are prohibited: 389// * Transferring of the domain name 390// * Deletion of the domain name 391func (r Dns_Domain_Registration) LockDomain() (resp bool, err error) { 392 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "lockDomain", nil, &r.Options, &resp) 393 return 394} 395 396// The lookupDomain method checks whether a specified domain name is available for registration in TLD's, and suggests other similar domain names, and checks whether they are available as well. 397func (r Dns_Domain_Registration) LookupDomain(domainName *string) (resp []datatypes.Container_Dns_Domain_Registration_Lookup, err error) { 398 params := []interface{}{ 399 domainName, 400 } 401 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "lookupDomain", params, &r.Options, &resp) 402 return 403} 404 405// The modifyContact method modifies contact information (admin, billing, owner, technical) for a domain. 406func (r Dns_Domain_Registration) ModifyContact(contact *datatypes.Container_Dns_Domain_Registration_Contact) (resp bool, err error) { 407 params := []interface{}{ 408 contact, 409 } 410 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "modifyContact", params, &r.Options, &resp) 411 return 412} 413 414// The modifyRegisteredNameserver method modifies a nameserver that was registered. 415func (r Dns_Domain_Registration) ModifyRegisteredNameserver(oldNameserver *string, newNameserver *string, ipAddress *string) (resp bool, err error) { 416 params := []interface{}{ 417 oldNameserver, 418 newNameserver, 419 ipAddress, 420 } 421 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "modifyRegisteredNameserver", params, &r.Options, &resp) 422 return 423} 424 425// The registerNameserver method creates a nameserver for the domain. 426func (r Dns_Domain_Registration) RegisterNameserver(nameserver *string, ipAddress *string) (resp bool, err error) { 427 params := []interface{}{ 428 nameserver, 429 ipAddress, 430 } 431 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "registerNameserver", params, &r.Options, &resp) 432 return 433} 434 435// The removeNameserversFromDomain method removes nameservers from a domain for a domain that already has nameservers assigned to it. 436func (r Dns_Domain_Registration) RemoveNameserversFromDomain(nameservers []string) (resp bool, err error) { 437 params := []interface{}{ 438 nameservers, 439 } 440 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "removeNameserversFromDomain", params, &r.Options, &resp) 441 return 442} 443 444// The sendAuthenticationCode method sends the authentication code to the administrative contact for the domain. 445func (r Dns_Domain_Registration) SendAuthenticationCode() (resp bool, err error) { 446 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "sendAuthenticationCode", nil, &r.Options, &resp) 447 return 448} 449 450// When a domain is registered or transferred, or when the registrant contact information is changed, the registrant must reply to an email requesting them to confirm that the submitted contact information is correct. This method sends the verification email to the registrant. 451func (r Dns_Domain_Registration) SendRegistrantVerificationEmail() (resp bool, err error) { 452 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "sendRegistrantVerificationEmail", nil, &r.Options, &resp) 453 return 454} 455 456// The sendTransferApprovalEmail method resends a transfer approval email message for a transfer that is in 'pending owner approval' state, to the admin contact listed for the domain at the time that the transfer request was submitted 457func (r Dns_Domain_Registration) SendTransferApprovalEmail() (resp bool, err error) { 458 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "sendTransferApprovalEmail", nil, &r.Options, &resp) 459 return 460} 461 462// The setAuthenticationCode method sets the authentication code for the domain. The authentication code is a transfer key and provides an extra level of security, safeguarding domain names from unauthorized transfers. 463func (r Dns_Domain_Registration) SetAuthenticationCode(authenticationCode *string) (resp bool, err error) { 464 params := []interface{}{ 465 authenticationCode, 466 } 467 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "setAuthenticationCode", params, &r.Options, &resp) 468 return 469} 470 471// The unlockDomain method unlocks a domain 472func (r Dns_Domain_Registration) UnlockDomain() (resp bool, err error) { 473 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration", "unlockDomain", nil, &r.Options, &resp) 474 return 475} 476 477// SoftLayer_Dns_Domain_Registration_Registrant_Verification_Status models the state of the registrant. Here are the following status codes: 478// 479// 480// *'''Admin Reviewing''': The registrant data has been submitted and being reviewed by compliance team. 481// *'''Pending''': The verification process has been inititated, and verification email will be sent. 482// *'''Suspended''': The registrant has failed verification and the domain has been suspended. 483// *'''Verified''': The registrant has been validated. 484// *'''Verifying''': The verification process has been initiated and is waiting for registrant response. 485// *'''Unverified''': The verification process has not been inititated. 486// 487// 488type Dns_Domain_Registration_Registrant_Verification_Status struct { 489 Session *session.Session 490 Options sl.Options 491} 492 493// GetDnsDomainRegistrationRegistrantVerificationStatusService returns an instance of the Dns_Domain_Registration_Registrant_Verification_Status SoftLayer service 494func GetDnsDomainRegistrationRegistrantVerificationStatusService(sess *session.Session) Dns_Domain_Registration_Registrant_Verification_Status { 495 return Dns_Domain_Registration_Registrant_Verification_Status{Session: sess} 496} 497 498func (r Dns_Domain_Registration_Registrant_Verification_Status) Id(id int) Dns_Domain_Registration_Registrant_Verification_Status { 499 r.Options.Id = &id 500 return r 501} 502 503func (r Dns_Domain_Registration_Registrant_Verification_Status) Mask(mask string) Dns_Domain_Registration_Registrant_Verification_Status { 504 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 505 mask = fmt.Sprintf("mask[%s]", mask) 506 } 507 508 r.Options.Mask = mask 509 return r 510} 511 512func (r Dns_Domain_Registration_Registrant_Verification_Status) Filter(filter string) Dns_Domain_Registration_Registrant_Verification_Status { 513 r.Options.Filter = filter 514 return r 515} 516 517func (r Dns_Domain_Registration_Registrant_Verification_Status) Limit(limit int) Dns_Domain_Registration_Registrant_Verification_Status { 518 r.Options.Limit = &limit 519 return r 520} 521 522func (r Dns_Domain_Registration_Registrant_Verification_Status) Offset(offset int) Dns_Domain_Registration_Registrant_Verification_Status { 523 r.Options.Offset = &offset 524 return r 525} 526 527// no documentation yet 528func (r Dns_Domain_Registration_Registrant_Verification_Status) GetAllObjects() (resp []datatypes.Dns_Domain_Registration_Registrant_Verification_Status, err error) { 529 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration_Registrant_Verification_Status", "getAllObjects", nil, &r.Options, &resp) 530 return 531} 532 533// no documentation yet 534func (r Dns_Domain_Registration_Registrant_Verification_Status) GetObject() (resp datatypes.Dns_Domain_Registration_Registrant_Verification_Status, err error) { 535 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration_Registrant_Verification_Status", "getObject", nil, &r.Options, &resp) 536 return 537} 538 539// SoftLayer_Dns_Domain_Registration_Status models the state of domain name. Here are the following status codes: 540// 541// 542// *'''Active''': This domain name is active. 543// *'''Pending Owner Approval''': Pending owner approval for completion of transfer. 544// *'''Pending Admin Review''': Pending admin review for transfer. 545// *'''Pending Registry''': Pending registry for transfer. 546// *'''Expired''': Domain name has expired. 547// 548// 549type Dns_Domain_Registration_Status struct { 550 Session *session.Session 551 Options sl.Options 552} 553 554// GetDnsDomainRegistrationStatusService returns an instance of the Dns_Domain_Registration_Status SoftLayer service 555func GetDnsDomainRegistrationStatusService(sess *session.Session) Dns_Domain_Registration_Status { 556 return Dns_Domain_Registration_Status{Session: sess} 557} 558 559func (r Dns_Domain_Registration_Status) Id(id int) Dns_Domain_Registration_Status { 560 r.Options.Id = &id 561 return r 562} 563 564func (r Dns_Domain_Registration_Status) Mask(mask string) Dns_Domain_Registration_Status { 565 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 566 mask = fmt.Sprintf("mask[%s]", mask) 567 } 568 569 r.Options.Mask = mask 570 return r 571} 572 573func (r Dns_Domain_Registration_Status) Filter(filter string) Dns_Domain_Registration_Status { 574 r.Options.Filter = filter 575 return r 576} 577 578func (r Dns_Domain_Registration_Status) Limit(limit int) Dns_Domain_Registration_Status { 579 r.Options.Limit = &limit 580 return r 581} 582 583func (r Dns_Domain_Registration_Status) Offset(offset int) Dns_Domain_Registration_Status { 584 r.Options.Offset = &offset 585 return r 586} 587 588// no documentation yet 589func (r Dns_Domain_Registration_Status) GetAllObjects() (resp []datatypes.Dns_Domain_Registration_Status, err error) { 590 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration_Status", "getAllObjects", nil, &r.Options, &resp) 591 return 592} 593 594// no documentation yet 595func (r Dns_Domain_Registration_Status) GetObject() (resp datatypes.Dns_Domain_Registration_Status, err error) { 596 err = r.Session.DoRequest("SoftLayer_Dns_Domain_Registration_Status", "getObject", nil, &r.Options, &resp) 597 return 598} 599 600// The SoftLayer_Dns_Domain_ResourceRecord data type represents a single resource record entry in a SoftLayer hosted domain. Each resource record contains a ''host'' and ''data'' property, defining a resource's name and it's target data. Domains contain multiple types of resource records. The ''type'' property separates out resource records by type. ''Type'' can take one of the following values: 601// * '''"a"''' for [[SoftLayer_Dns_Domain_ResourceRecord_AType|address]] records 602// * '''"aaaa"''' for [[SoftLayer_Dns_Domain_ResourceRecord_AaaaType|address]] records 603// * '''"cname"''' for [[SoftLayer_Dns_Domain_ResourceRecord_CnameType|canonical name]] records 604// * '''"mx"''' for [[SoftLayer_Dns_Domain_ResourceRecord_MxType|mail exchanger]] records 605// * '''"ns"''' for [[SoftLayer_Dns_Domain_ResourceRecord_NsType|name server]] records 606// * '''"ptr"''' for [[SoftLayer_Dns_Domain_ResourceRecord_PtrType|pointer]] records in reverse domains 607// * '''"soa"''' for a domain's [[SoftLayer_Dns_Domain_ResourceRecord_SoaType|start of authority]] record 608// * '''"spf"''' for [[SoftLayer_Dns_Domain_ResourceRecord_SpfType|sender policy framework]] records 609// * '''"srv"''' for [[SoftLayer_Dns_Domain_ResourceRecord_SrvType|service]] records 610// * '''"txt"''' for [[SoftLayer_Dns_Domain_ResourceRecord_TxtType|text]] records 611// 612// 613// As ''SoftLayer_Dns_Domain_ResourceRecord'' objects are created and loaded, the API verifies the ''type'' property and casts the object as the appropriate type. 614type Dns_Domain_ResourceRecord struct { 615 Session *session.Session 616 Options sl.Options 617} 618 619// GetDnsDomainResourceRecordService returns an instance of the Dns_Domain_ResourceRecord SoftLayer service 620func GetDnsDomainResourceRecordService(sess *session.Session) Dns_Domain_ResourceRecord { 621 return Dns_Domain_ResourceRecord{Session: sess} 622} 623 624func (r Dns_Domain_ResourceRecord) Id(id int) Dns_Domain_ResourceRecord { 625 r.Options.Id = &id 626 return r 627} 628 629func (r Dns_Domain_ResourceRecord) Mask(mask string) Dns_Domain_ResourceRecord { 630 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 631 mask = fmt.Sprintf("mask[%s]", mask) 632 } 633 634 r.Options.Mask = mask 635 return r 636} 637 638func (r Dns_Domain_ResourceRecord) Filter(filter string) Dns_Domain_ResourceRecord { 639 r.Options.Filter = filter 640 return r 641} 642 643func (r Dns_Domain_ResourceRecord) Limit(limit int) Dns_Domain_ResourceRecord { 644 r.Options.Limit = &limit 645 return r 646} 647 648func (r Dns_Domain_ResourceRecord) Offset(offset int) Dns_Domain_ResourceRecord { 649 r.Options.Offset = &offset 650 return r 651} 652 653// createObject creates a new domain resource record. The ''host'' property of the templateObject parameter is scrubbed to remove all non-alpha numeric characters except for "@", "_", ".", "*", and "-". The ''data'' property of the templateObject parameter is scrubbed to remove all non-alphanumeric characters for "." and "-". Creating a resource record updates the serial number of the domain the resource record is associated with. 654// 655// ''createObject'' returns Boolean ''true'' on successful create or ''false'' if it was unable to create a resource record. 656func (r Dns_Domain_ResourceRecord) CreateObject(templateObject *datatypes.Dns_Domain_ResourceRecord) (resp datatypes.Dns_Domain_ResourceRecord, err error) { 657 params := []interface{}{ 658 templateObject, 659 } 660 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "createObject", params, &r.Options, &resp) 661 return 662} 663 664// Create multiple resource records on a domain. This follows the same logic as ''createObject'. The serial number of the domain associated with this resource record is updated upon creation. 665// 666// ''createObjects'' returns Boolean ''true'' on successful creation or ''false'' if it was unable to create a resource record. 667func (r Dns_Domain_ResourceRecord) CreateObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord) (resp []datatypes.Dns_Domain_ResourceRecord, err error) { 668 params := []interface{}{ 669 templateObjects, 670 } 671 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "createObjects", params, &r.Options, &resp) 672 return 673} 674 675// Delete a domain's resource record. '''This cannot be undone.''' Be wary of running this method. If you remove a resource record in error you will need to re-create it by creating a new SoftLayer_Dns_Domain_ResourceRecord object. The serial number of the domain associated with this resource record is updated upon deletion. You may not delete SOA, NS, or PTR resource records. 676// 677// ''deleteObject'' returns Boolean ''true'' on successful deletion or ''false'' if it was unable to remove a resource record. 678func (r Dns_Domain_ResourceRecord) DeleteObject() (resp bool, err error) { 679 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "deleteObject", nil, &r.Options, &resp) 680 return 681} 682 683// Remove multiple resource records from a domain. This follows the same logic as ''deleteObject'' and '''cannot be undone'''. The serial number of the domain associated with this resource record is updated upon deletion. You may not delete SOA records, PTR records, or NS resource records that point to ns1.softlayer.com or ns2.softlayer.com. 684// 685// ''deleteObjects'' returns Boolean ''true'' on successful deletion or ''false'' if it was unable to remove a resource record. 686func (r Dns_Domain_ResourceRecord) DeleteObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord) (resp bool, err error) { 687 params := []interface{}{ 688 templateObjects, 689 } 690 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "deleteObjects", params, &r.Options, &resp) 691 return 692} 693 694// editObject edits an existing domain resource record. The ''host'' property of the templateObject parameter is scrubbed to remove all non-alpha numeric characters except for "@", "_", ".", "*", and "-". The ''data'' property of the templateObject parameter is scrubbed to remove all non-alphanumeric characters for "." and "-". Editing a resource record updates the serial number of the domain the resource record is associated with. 695// 696// ''editObject'' returns Boolean ''true'' on a successful edit or ''false'' if it was unable to edit the resource record. 697func (r Dns_Domain_ResourceRecord) EditObject(templateObject *datatypes.Dns_Domain_ResourceRecord) (resp bool, err error) { 698 params := []interface{}{ 699 templateObject, 700 } 701 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "editObject", params, &r.Options, &resp) 702 return 703} 704 705// Edit multiple resource records on a domain. This follows the same logic as ''createObject'. The serial number of the domain associated with this resource record is updated upon creation. 706// 707// ''createObjects'' returns Boolean ''true'' on successful creation or ''false'' if it was unable to create a resource record. 708func (r Dns_Domain_ResourceRecord) EditObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord) (resp bool, err error) { 709 params := []interface{}{ 710 templateObjects, 711 } 712 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "editObjects", params, &r.Options, &resp) 713 return 714} 715 716// Retrieve The domain that a resource record belongs to. 717func (r Dns_Domain_ResourceRecord) GetDomain() (resp datatypes.Dns_Domain, err error) { 718 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "getDomain", nil, &r.Options, &resp) 719 return 720} 721 722// getObject retrieves the SoftLayer_Dns_Domain_ResourceRecord object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Dns_Domain_ResourceRecord service. You can only retrieve resource records belonging to domains that are assigned to your SoftLayer account. 723func (r Dns_Domain_ResourceRecord) GetObject() (resp datatypes.Dns_Domain_ResourceRecord, err error) { 724 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord", "getObject", nil, &r.Options, &resp) 725 return 726} 727 728// SoftLayer_Dns_Domain_ResourceRecord_MxType is a SoftLayer_Dns_Domain_ResourceRecord object whose ''type'' property is set to "mx" and used to describe MX resource records. MX records control which hosts are responsible as mail exchangers for a domain. For instance, in the domain example.org, an MX record whose host is "@" and data is "mail" says that the host "mail.example.org" is responsible for handling mail for example.org. That means mail sent to users @example.org are delivered to mail.example.org. 729// 730// Domains can have more than one MX record if it uses more than one server to send mail through. Multiple MX records are denoted by their priority, defined by the mxPriority property. 731// 732// MX records must be defined for hosts with accompanying A or AAAA resource records. They may not point mail towards a host defined by a CNAME record. 733type Dns_Domain_ResourceRecord_MxType struct { 734 Session *session.Session 735 Options sl.Options 736} 737 738// GetDnsDomainResourceRecordMxTypeService returns an instance of the Dns_Domain_ResourceRecord_MxType SoftLayer service 739func GetDnsDomainResourceRecordMxTypeService(sess *session.Session) Dns_Domain_ResourceRecord_MxType { 740 return Dns_Domain_ResourceRecord_MxType{Session: sess} 741} 742 743func (r Dns_Domain_ResourceRecord_MxType) Id(id int) Dns_Domain_ResourceRecord_MxType { 744 r.Options.Id = &id 745 return r 746} 747 748func (r Dns_Domain_ResourceRecord_MxType) Mask(mask string) Dns_Domain_ResourceRecord_MxType { 749 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 750 mask = fmt.Sprintf("mask[%s]", mask) 751 } 752 753 r.Options.Mask = mask 754 return r 755} 756 757func (r Dns_Domain_ResourceRecord_MxType) Filter(filter string) Dns_Domain_ResourceRecord_MxType { 758 r.Options.Filter = filter 759 return r 760} 761 762func (r Dns_Domain_ResourceRecord_MxType) Limit(limit int) Dns_Domain_ResourceRecord_MxType { 763 r.Options.Limit = &limit 764 return r 765} 766 767func (r Dns_Domain_ResourceRecord_MxType) Offset(offset int) Dns_Domain_ResourceRecord_MxType { 768 r.Options.Offset = &offset 769 return r 770} 771 772// createObject creates a new MX record. The ''host'' property of the templateObject parameter is scrubbed to remove all non-alpha numeric characters except for "@", "_", ".", "*", and "-". The ''data'' property of the templateObject parameter is scrubbed to remove all non-alphanumeric characters for "." and "-". Creating an MX record updates the serial number of the domain the resource record is associated with. 773func (r Dns_Domain_ResourceRecord_MxType) CreateObject(templateObject *datatypes.Dns_Domain_ResourceRecord_MxType) (resp datatypes.Dns_Domain_ResourceRecord_MxType, err error) { 774 params := []interface{}{ 775 templateObject, 776 } 777 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "createObject", params, &r.Options, &resp) 778 return 779} 780 781// Create multiple MX records on a domain. This follows the same logic as ''createObject'. The serial number of the domain associated with this MX record is updated upon creation. 782// 783// ''createObjects'' returns Boolean ''true'' on successful creation or ''false'' if it was unable to create a resource record. 784func (r Dns_Domain_ResourceRecord_MxType) CreateObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord) (resp []datatypes.Dns_Domain_ResourceRecord, err error) { 785 params := []interface{}{ 786 templateObjects, 787 } 788 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "createObjects", params, &r.Options, &resp) 789 return 790} 791 792// Delete a domain's MX record. '''This cannot be undone.''' Be wary of running this method. If you remove a resource record in error you will need to re-create it by creating a new SoftLayer_Dns_Domain_ResourceRecord_MxType object. The serial number of the domain associated with this MX record is updated upon deletion. 793// 794// ''deleteObject'' returns Boolean ''true'' on successful deletion or ''false'' if it was unable to remove a resource record. 795func (r Dns_Domain_ResourceRecord_MxType) DeleteObject() (resp bool, err error) { 796 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "deleteObject", nil, &r.Options, &resp) 797 return 798} 799 800// Remove multiple MX records from a domain. This follows the same logic as ''deleteObject'' and '''cannot be undone'''. The serial number of the domain associated with this MX record is updated upon deletion. 801// 802// ''deleteObjects'' returns Boolean ''true'' on successful deletion or ''false'' if it was unable to remove a resource record. 803func (r Dns_Domain_ResourceRecord_MxType) DeleteObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord_MxType) (resp bool, err error) { 804 params := []interface{}{ 805 templateObjects, 806 } 807 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "deleteObjects", params, &r.Options, &resp) 808 return 809} 810 811// editObject edits an existing MX resource record. The ''host'' property of the templateObject parameter is scrubbed to remove all non-alpha numeric characters except for "@", "_", ".", "*", and "-". The ''data'' property of the templateObject parameter is scrubbed to remove all non-alphanumeric characters for "." and "-". Editing an MX record updates the serial number of the domain the record is associated with. 812// 813// ''editObject'' returns Boolean ''true'' on a successful edit or ''false'' if it was unable to edit the resource record. 814func (r Dns_Domain_ResourceRecord_MxType) EditObject(templateObject *datatypes.Dns_Domain_ResourceRecord_MxType) (resp bool, err error) { 815 params := []interface{}{ 816 templateObject, 817 } 818 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "editObject", params, &r.Options, &resp) 819 return 820} 821 822// Edit multiple MX records on a domain. This follows the same logic as ''createObject'. The serial number of the domain associated with this MX record is updated upon creation. 823// 824// ''createObjects'' returns Boolean ''true'' on successful creation or ''false'' if it was unable to create a resource record. 825func (r Dns_Domain_ResourceRecord_MxType) EditObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord_MxType) (resp bool, err error) { 826 params := []interface{}{ 827 templateObjects, 828 } 829 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "editObjects", params, &r.Options, &resp) 830 return 831} 832 833// Retrieve The domain that a resource record belongs to. 834func (r Dns_Domain_ResourceRecord_MxType) GetDomain() (resp datatypes.Dns_Domain, err error) { 835 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "getDomain", nil, &r.Options, &resp) 836 return 837} 838 839// getObject retrieves the SoftLayer_Dns_Domain_ResourceRecord_MxType object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Dns_Domain_ResourceRecord_MxType service. You can only retrieve resource records belonging to domains that are assigned to your SoftLayer account. 840func (r Dns_Domain_ResourceRecord_MxType) GetObject() (resp datatypes.Dns_Domain_ResourceRecord_MxType, err error) { 841 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_MxType", "getObject", nil, &r.Options, &resp) 842 return 843} 844 845// SoftLayer_Dns_Domain_ResourceRecord_SrvType is a SoftLayer_Dns_Domain_ResourceRecord object whose ''type'' property is set to "srv" and defines a DNS SRV record on a SoftLayer hosted domain. 846type Dns_Domain_ResourceRecord_SrvType struct { 847 Session *session.Session 848 Options sl.Options 849} 850 851// GetDnsDomainResourceRecordSrvTypeService returns an instance of the Dns_Domain_ResourceRecord_SrvType SoftLayer service 852func GetDnsDomainResourceRecordSrvTypeService(sess *session.Session) Dns_Domain_ResourceRecord_SrvType { 853 return Dns_Domain_ResourceRecord_SrvType{Session: sess} 854} 855 856func (r Dns_Domain_ResourceRecord_SrvType) Id(id int) Dns_Domain_ResourceRecord_SrvType { 857 r.Options.Id = &id 858 return r 859} 860 861func (r Dns_Domain_ResourceRecord_SrvType) Mask(mask string) Dns_Domain_ResourceRecord_SrvType { 862 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 863 mask = fmt.Sprintf("mask[%s]", mask) 864 } 865 866 r.Options.Mask = mask 867 return r 868} 869 870func (r Dns_Domain_ResourceRecord_SrvType) Filter(filter string) Dns_Domain_ResourceRecord_SrvType { 871 r.Options.Filter = filter 872 return r 873} 874 875func (r Dns_Domain_ResourceRecord_SrvType) Limit(limit int) Dns_Domain_ResourceRecord_SrvType { 876 r.Options.Limit = &limit 877 return r 878} 879 880func (r Dns_Domain_ResourceRecord_SrvType) Offset(offset int) Dns_Domain_ResourceRecord_SrvType { 881 r.Options.Offset = &offset 882 return r 883} 884 885// createObject creates a new SRV record. The ''host'' property of the templateObject parameter is scrubbed to remove all non-alpha numeric characters except for "@", "_", ".", "*", and "-". The ''data'' property of the templateObject parameter is scrubbed to remove all non-alphanumeric characters for "." and "-". Creating an SRV record updates the serial number of the domain the resource record is associated with. 886func (r Dns_Domain_ResourceRecord_SrvType) CreateObject(templateObject *datatypes.Dns_Domain_ResourceRecord_SrvType) (resp datatypes.Dns_Domain_ResourceRecord_SrvType, err error) { 887 params := []interface{}{ 888 templateObject, 889 } 890 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "createObject", params, &r.Options, &resp) 891 return 892} 893 894// Create multiple SRV records on a domain. This follows the same logic as ''createObject'. The serial number of the domain associated with this SRV record is updated upon creation. 895// 896// ''createObjects'' returns Boolean ''true'' on successful creation or ''false'' if it was unable to create a resource record. 897func (r Dns_Domain_ResourceRecord_SrvType) CreateObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord) (resp []datatypes.Dns_Domain_ResourceRecord, err error) { 898 params := []interface{}{ 899 templateObjects, 900 } 901 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "createObjects", params, &r.Options, &resp) 902 return 903} 904 905// Delete a domain's SRV record. '''This cannot be undone.''' Be wary of running this method. If you remove a resource record in error you will need to re-create it by creating a new SoftLayer_Dns_Domain_ResourceRecord_SrvType object. The serial number of the domain associated with this SRV record is updated upon deletion. 906// 907// ''deleteObject'' returns Boolean ''true'' on successful deletion or ''false'' if it was unable to remove a resource record. 908func (r Dns_Domain_ResourceRecord_SrvType) DeleteObject() (resp bool, err error) { 909 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "deleteObject", nil, &r.Options, &resp) 910 return 911} 912 913// Remove multiple SRV records from a domain. This follows the same logic as ''deleteObject'' and '''cannot be undone'''. The serial number of the domain associated with this SRV record is updated upon deletion. 914// 915// ''deleteObjects'' returns Boolean ''true'' on successful deletion or ''false'' if it was unable to remove a resource record. 916func (r Dns_Domain_ResourceRecord_SrvType) DeleteObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord_SrvType) (resp bool, err error) { 917 params := []interface{}{ 918 templateObjects, 919 } 920 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "deleteObjects", params, &r.Options, &resp) 921 return 922} 923 924// editObject edits an existing SRV resource record. The ''host'' property of the templateObject parameter is scrubbed to remove all non-alpha numeric characters except for "@", "_", ".", "*", and "-". The ''data'' property of the templateObject parameter is scrubbed to remove all non-alphanumeric characters for "." and "-". Editing an SRV record updates the serial number of the domain the record is associated with. 925// 926// ''editObject'' returns Boolean ''true'' on a successful edit or ''false'' if it was unable to edit the resource record. 927func (r Dns_Domain_ResourceRecord_SrvType) EditObject(templateObject *datatypes.Dns_Domain_ResourceRecord_SrvType) (resp bool, err error) { 928 params := []interface{}{ 929 templateObject, 930 } 931 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "editObject", params, &r.Options, &resp) 932 return 933} 934 935// Edit multiple SRV records on a domain. This follows the same logic as ''createObject'. The serial number of the domain associated with this SRV record is updated upon creation. 936// 937// ''createObjects'' returns Boolean ''true'' on successful creation or ''false'' if it was unable to create a resource record. 938func (r Dns_Domain_ResourceRecord_SrvType) EditObjects(templateObjects []datatypes.Dns_Domain_ResourceRecord_SrvType) (resp bool, err error) { 939 params := []interface{}{ 940 templateObjects, 941 } 942 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "editObjects", params, &r.Options, &resp) 943 return 944} 945 946// Retrieve The domain that a resource record belongs to. 947func (r Dns_Domain_ResourceRecord_SrvType) GetDomain() (resp datatypes.Dns_Domain, err error) { 948 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "getDomain", nil, &r.Options, &resp) 949 return 950} 951 952// getObject retrieves the SoftLayer_Dns_Domain_ResourceRecord_SrvType object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_Dns_Domain_ResourceRecord_SrvType service. You can only retrieve resource records belonging to domains that are assigned to your SoftLayer account. 953func (r Dns_Domain_ResourceRecord_SrvType) GetObject() (resp datatypes.Dns_Domain_ResourceRecord_SrvType, err error) { 954 err = r.Session.DoRequest("SoftLayer_Dns_Domain_ResourceRecord_SrvType", "getObject", nil, &r.Options, &resp) 955 return 956} 957 958// The SoftLayer_Dns_Secondary data type contains information on a single secondary DNS zone which is managed through SoftLayer's zone transfer service. Domains created via zone transfer may not be modified by the SoftLayer portal or API. 959type Dns_Secondary struct { 960 Session *session.Session 961 Options sl.Options 962} 963 964// GetDnsSecondaryService returns an instance of the Dns_Secondary SoftLayer service 965func GetDnsSecondaryService(sess *session.Session) Dns_Secondary { 966 return Dns_Secondary{Session: sess} 967} 968 969func (r Dns_Secondary) Id(id int) Dns_Secondary { 970 r.Options.Id = &id 971 return r 972} 973 974func (r Dns_Secondary) Mask(mask string) Dns_Secondary { 975 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) { 976 mask = fmt.Sprintf("mask[%s]", mask) 977 } 978 979 r.Options.Mask = mask 980 return r 981} 982 983func (r Dns_Secondary) Filter(filter string) Dns_Secondary { 984 r.Options.Filter = filter 985 return r 986} 987 988func (r Dns_Secondary) Limit(limit int) Dns_Secondary { 989 r.Options.Limit = &limit 990 return r 991} 992 993func (r Dns_Secondary) Offset(offset int) Dns_Secondary { 994 r.Options.Offset = &offset 995 return r 996} 997 998// A secondary DNS record may be converted to a primary DNS record. By converting a secondary DNS record, the SoftLayer name servers will be the authoritative nameserver for this domain and will be directly editable in the SoftLayer API and Portal. 999// 1000// Primary DNS record conversion performs the following steps: 1001// * The SOA record is updated with SoftLayer's primary name server. 1002// * All NS records are removed and replaced with SoftLayer's NS records. 1003// * The secondary DNS record is removed. 1004// 1005// 1006// After the DNS records are converted, the following restrictions will apply to the new domain record: 1007// * You will need to manage the zone record using the [[SoftLayer_Dns_Domain]] service. 1008// * You may not edit the SOA or NS records. 1009// * You may only edit the following resource records: A, AAAA, CNAME, MX, TX, SRV. 1010// 1011// 1012// This change can not be undone, and the record can not be converted back into a secondary DNS record once the conversion is complete. 1013func (r Dns_Secondary) ConvertToPrimary() (resp bool, err error) { 1014 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "convertToPrimary", nil, &r.Options, &resp) 1015 return 1016} 1017 1018// Create a secondary DNS record. The ''zoneName'', ''masterIpAddress'', and ''transferFrequency'' properties in the templateObject parameter are required parameters to create a secondary DNS record. 1019func (r Dns_Secondary) CreateObject(templateObject *datatypes.Dns_Secondary) (resp datatypes.Dns_Secondary, err error) { 1020 params := []interface{}{ 1021 templateObject, 1022 } 1023 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "createObject", params, &r.Options, &resp) 1024 return 1025} 1026 1027// Create multiple secondary DNS records. Each record passed to ''createObjects'' follows the logic in the SoftLayer_Dns_Secondary [[SoftLayer_Dns_Secondary::createObject|createObject]] method. 1028func (r Dns_Secondary) CreateObjects(templateObjects []datatypes.Dns_Secondary) (resp []datatypes.Dns_Secondary, err error) { 1029 params := []interface{}{ 1030 templateObjects, 1031 } 1032 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "createObjects", params, &r.Options, &resp) 1033 return 1034} 1035 1036// Delete a secondary DNS Record. This will also remove any associated domain records and resource records on the SoftLayer nameservers that were created as a result of the zone transfers. This action cannot be undone. 1037func (r Dns_Secondary) DeleteObject() (resp bool, err error) { 1038 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "deleteObject", nil, &r.Options, &resp) 1039 return 1040} 1041 1042// Edit the properties of a secondary DNS record by passing in a modified instance of a SoftLayer_Dns_Secondary object. You may only edit the ''masterIpAddress'' and ''transferFrequency'' properties of your secondary DNS record. ''ZoneName'' may not be altered after a secondary DNS record has been created. Please remove and re-create the record if you need to make changes to your zone name. 1043func (r Dns_Secondary) EditObject(templateObject *datatypes.Dns_Secondary) (resp bool, err error) { 1044 params := []interface{}{ 1045 templateObject, 1046 } 1047 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "editObject", params, &r.Options, &resp) 1048 return 1049} 1050 1051// Retrieve The SoftLayer account that owns a secondary DNS record. 1052func (r Dns_Secondary) GetAccount() (resp datatypes.Account, err error) { 1053 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "getAccount", nil, &r.Options, &resp) 1054 return 1055} 1056 1057// Search for [[SoftLayer_Dns_Domain_Secondary]] records by domain name. getByDomainName() performs an inclusive search for secondary domain records, returning multiple records based on partial name matches. Use this method to locate secondary domain records if you don't have access to their id numbers. 1058func (r Dns_Secondary) GetByDomainName(name *string) (resp []datatypes.Dns_Secondary, err error) { 1059 params := []interface{}{ 1060 name, 1061 } 1062 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "getByDomainName", params, &r.Options, &resp) 1063 return 1064} 1065 1066// Retrieve The domain record created by zone transfer from a secondary DNS record. 1067func (r Dns_Secondary) GetDomain() (resp datatypes.Dns_Domain, err error) { 1068 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "getDomain", nil, &r.Options, &resp) 1069 return 1070} 1071 1072// Retrieve The error messages created during secondary DNS record transfer. 1073func (r Dns_Secondary) GetErrorMessages() (resp []datatypes.Dns_Message, err error) { 1074 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "getErrorMessages", nil, &r.Options, &resp) 1075 return 1076} 1077 1078// getObject retrieves the SoftLayer_Dns_Secondary object whose ID number corresponds to the ID number of the init paramater passed to the SoftLayer_Dns_Secondary service. You can only retrieve a secondary DNS record that is assigned to your SoftLayer customer account. 1079func (r Dns_Secondary) GetObject() (resp datatypes.Dns_Secondary, err error) { 1080 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "getObject", nil, &r.Options, &resp) 1081 return 1082} 1083 1084// Retrieve The current status of the secondary DNS zone. 1085func (r Dns_Secondary) GetStatus() (resp datatypes.Dns_Status, err error) { 1086 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "getStatus", nil, &r.Options, &resp) 1087 return 1088} 1089 1090// Force a secondary DNS zone transfer by setting it's status "Transfer Now". A zone transfer will be initiated within a minute of receiving this API call. 1091func (r Dns_Secondary) TransferNow() (resp bool, err error) { 1092 err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "transferNow", nil, &r.Options, &resp) 1093 return 1094} 1095