/// <summary>
        /// You only need to create a delegation signer record manually if your
        /// domain is registered with DNSimple but hosted with another DNS
        /// provider that is signing your zone. To enable DNSSEC on a domain
        /// that is hosted with DNSimple, use the DNSSEC enable endpoint.
        /// </summary>
        /// <param name="accountId">The account id</param>
        /// <param name="domainIdentifier">The domain name or id</param>
        /// <param name="record">The delegation signer record to be added</param>
        /// <see cref="DelegationSignerRecord"/>
        /// <returns>The newly created delegation signer record.</returns>
        /// <see>https://developer.dnsimple.com/v2/domains/dnssec/#createDomainDelegationSignerRecord</see>
        /// <see>"https://tools.ietf.org/html/rfc4034"</see>
        public SimpleDnsimpleResponse <DelegationSignerRecord> CreateDelegationSignerRecord(
            long accountId, string domainIdentifier,
            DelegationSignerRecord record)
        {
            var request =
                Client.Http.RequestBuilder(DsRecordsPath(accountId,
                                                         domainIdentifier));

            request.Method(Method.POST);
            request.AddJsonPayload(record);

            return(new SimpleDnsimpleResponse <DelegationSignerRecord>(
                       Client.Http.Execute(request.Request)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a Delegation Signer record to the domain.
        /// </summary>
        /// <param name="accountId">The account ID</param>
        /// <param name="domainIdentifier">The domain name or ID</param>
        /// <param name="record">The delegation signer record to be added</param>
        /// <see cref="DelegationSignerRecord"/>
        /// <returns>The newly created delegation signer record.</returns>
        /// <see>https://developer.dnsimple.com/v2/domains/dnssec/#createDomainDelegationSignerRecord</see>
        public SimpleResponse <DelegationSignerRecord> CreateDelegationSignerRecord(long accountId, string domainIdentifier, DelegationSignerRecord record)
        {
            var builder = BuildRequestForPath(DsRecordsPath(accountId, domainIdentifier));

            builder.Method(Method.POST);
            builder.AddJsonPayload(record);

            if (record.Algorithm.Trim().Equals("") ||
                record.Digest.Trim().Equals("") ||
                record.DigestType.Trim().Equals("") ||
                record.Keytag.Trim().Equals(""))
            {
                throw new ArgumentException(
                          "Algorithm, Digest, DigestType and Keytag cannot be null or empty");
            }

            return(new SimpleResponse <DelegationSignerRecord>(Execute(builder.Request)));
        }