Skip to content

Commit df13724

Browse files
committed
Merge pull request #235 from sharwell/CloudDNS
Preliminary support for Cloud DNS
2 parents 3c081f7 + bf9f001 commit df13724

41 files changed

Lines changed: 7283 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/corelib/Core/Synchronous/DnsServiceExtensions.cs

Lines changed: 936 additions & 0 deletions
Large diffs are not rendered by default.

src/corelib/Providers/Rackspace/CloudDnsProvider.cs

Lines changed: 1247 additions & 0 deletions
Large diffs are not rendered by default.

src/corelib/Providers/Rackspace/IDnsService.cs

Lines changed: 677 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
namespace net.openstack.Providers.Rackspace.Objects.Dns
2+
{
3+
using Newtonsoft.Json;
4+
5+
/// <summary>
6+
/// Represents a change made to a DNS record.
7+
/// </summary>
8+
/// <seealso cref="DnsDomainChange"/>
9+
/// <seealso cref="IDnsService.ListDomainChangesAsync"/>
10+
/// <seealso href="http://docs.rackspace.com/cdns/api/v1.0/cdns-devguide/content/List_Domain_Changes.html">List Domain Changes (Rackspace Cloud DNS Developer Guide - API v1.0)</seealso>
11+
/// <threadsafety static="true" instance="false"/>
12+
/// <preliminary/>
13+
[JsonObject(MemberSerialization.OptIn)]
14+
public class DnsChange
15+
{
16+
#pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value {value}
17+
/// <summary>
18+
/// This is the backing field for the <see cref="Field"/> property.
19+
/// </summary>
20+
[JsonProperty("field")]
21+
private string _field;
22+
23+
/// <summary>
24+
/// This is the backing field for the <see cref="OriginalValue"/> property.
25+
/// </summary>
26+
[JsonProperty("originalValue")]
27+
private string _originalValue;
28+
29+
/// <summary>
30+
/// This is the backing field for the <see cref="NewValue"/> property.
31+
/// </summary>
32+
[JsonProperty("newValue")]
33+
private string _newValue;
34+
#pragma warning restore 649
35+
36+
/// <summary>
37+
/// Initializes a new instance of the <see cref="DnsChange"/> class during
38+
/// JSON deserialization.
39+
/// </summary>
40+
[JsonConstructor]
41+
protected DnsChange()
42+
{
43+
}
44+
45+
/// <summary>
46+
/// Gets the name of the field which changed.
47+
/// </summary>
48+
/// <value>
49+
/// The name of the field which changed, or <c>null</c> if the JSON response from the
50+
/// server did not include this property.
51+
/// </value>
52+
public string Field
53+
{
54+
get
55+
{
56+
return _field;
57+
}
58+
}
59+
60+
/// <summary>
61+
/// Gets the value of the field before the change was made.
62+
/// </summary>
63+
/// <value>
64+
/// The original value of the field which changed, or <c>null</c> if the JSON response
65+
/// from the server did not include this property.
66+
/// </value>
67+
public string OriginalValue
68+
{
69+
get
70+
{
71+
return _originalValue;
72+
}
73+
}
74+
75+
/// <summary>
76+
/// Gets the value of the field after the change was made.
77+
/// </summary>
78+
/// <value>
79+
/// The new value of the field which changed, or <c>null</c> if the JSON response
80+
/// from the server did not include this property.
81+
/// </value>
82+
public string NewValue
83+
{
84+
get
85+
{
86+
return _newValue;
87+
}
88+
}
89+
}
90+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
namespace net.openstack.Providers.Rackspace.Objects.Dns
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Collections.ObjectModel;
6+
using System.Linq;
7+
using Newtonsoft.Json;
8+
9+
/// <summary>
10+
/// Represents the configuration of a collection of domains being added to the DNS service.
11+
/// </summary>
12+
/// <remarks>
13+
/// <note type="inherit">
14+
/// This class can be extended if a server extension requires additional information (beyond
15+
/// the <c>domains</c> property which is already supported) be sent in the body of a
16+
/// <strong>Create Domain</strong> API call.
17+
/// </note>
18+
/// </remarks>
19+
/// <seealso cref="IDnsService.CreateDomainsAsync"/>
20+
/// <threadsafety static="true" instance="false"/>
21+
/// <preliminary/>
22+
[JsonObject(MemberSerialization.OptIn)]
23+
public class DnsConfiguration
24+
{
25+
/// <summary>
26+
/// This is the backing field for the <see cref="DomainConfigurations"/> property.
27+
/// </summary>
28+
[JsonProperty("domains")]
29+
private readonly DnsDomainConfiguration[] _domainConfiguration;
30+
31+
/// <summary>
32+
/// Initializes a new instance of the <see cref="DnsConfiguration"/> class for the
33+
/// specified domains.
34+
/// </summary>
35+
/// <param name="domainConfigurations">A collection of <see cref="DnsDomainConfiguration"/> objects describing the domains.</param>
36+
/// <exception cref="ArgumentNullException">If <paramref name="domainConfigurations"/> is <c>null</c>.</exception>
37+
/// <exception cref="ArgumentException">If <paramref name="domainConfigurations"/> contains a <c>null</c> value.</exception>
38+
public DnsConfiguration(params DnsDomainConfiguration[] domainConfigurations)
39+
: this(domainConfigurations.AsEnumerable())
40+
{
41+
}
42+
43+
/// <summary>
44+
/// Initializes a new instance of the <see cref="DnsConfiguration"/> class for the
45+
/// specified domains.
46+
/// </summary>
47+
/// <param name="domainConfigurations">A collection of <see cref="DnsDomainConfiguration"/> objects describing the domains.</param>
48+
/// <exception cref="ArgumentNullException">If <paramref name="domainConfigurations"/> is <c>null</c>.</exception>
49+
/// <exception cref="ArgumentException">If <paramref name="domainConfigurations"/> contains a <c>null</c> value.</exception>
50+
public DnsConfiguration(IEnumerable<DnsDomainConfiguration> domainConfigurations)
51+
{
52+
if (domainConfigurations == null)
53+
throw new ArgumentNullException("domainConfigurations");
54+
55+
_domainConfiguration = domainConfigurations.ToArray();
56+
57+
if (_domainConfiguration.Contains(null))
58+
throw new ArgumentException("domainConfigurations cannot contain any null values.", "domainConfigurations");
59+
}
60+
61+
/// <summary>
62+
/// Gets a collection of the <see cref="DnsDomainConfiguration"/> objects describing
63+
/// domains in this configuration.
64+
/// </summary>
65+
public ReadOnlyCollection<DnsDomainConfiguration> DomainConfigurations
66+
{
67+
get
68+
{
69+
return new ReadOnlyCollection<DnsDomainConfiguration>(_domainConfiguration);
70+
}
71+
}
72+
}
73+
}

0 commit comments

Comments
 (0)