Retire non functioning Microsoft DNS Server Agent

Change-Id: Iaa7316c6a208169dbb0e8f6ba5458acba7a15550
This commit is contained in:
Graham Hayes 2016-05-06 15:09:51 +01:00
parent c90cfeccda
commit 9f9177d609
56 changed files with 10 additions and 23858 deletions

View File

@ -1,175 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -1,365 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
namespace OpenStack.Designate.MicrosoftDNS
{
partial class Config
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.configManagerBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.RMQDetails = new System.Windows.Forms.GroupBox();
this.RMQPasswordConfirmInput = new System.Windows.Forms.TextBox();
this.RMQPasswordConfirmLabel = new System.Windows.Forms.Label();
this.RMQPasswordInput = new System.Windows.Forms.TextBox();
this.RMQPasswordLabel = new System.Windows.Forms.Label();
this.RMQUserInput = new System.Windows.Forms.TextBox();
this.RMQUserLabel = new System.Windows.Forms.Label();
this.RMQPortInput = new System.Windows.Forms.NumericUpDown();
this.RMQPortLabel = new System.Windows.Forms.Label();
this.RMQHostsInput = new System.Windows.Forms.TextBox();
this.RQMHostsLabel = new System.Windows.Forms.Label();
this.DNSSettings = new System.Windows.Forms.GroupBox();
this.MasterDNSInput = new System.Windows.Forms.TextBox();
this.MasterDNSLabel = new System.Windows.Forms.Label();
this.QuitButton = new System.Windows.Forms.Button();
this.SaveButton = new System.Windows.Forms.Button();
this.AgentSettings = new System.Windows.Forms.GroupBox();
this.AgentNameInput = new System.Windows.Forms.TextBox();
this.AgentNameLabel = new System.Windows.Forms.Label();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.StatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.ProgressBar = new System.Windows.Forms.ToolStripProgressBar();
this.ValidateButon = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.configManagerBindingSource)).BeginInit();
this.flowLayoutPanel1.SuspendLayout();
this.RMQDetails.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.RMQPortInput)).BeginInit();
this.DNSSettings.SuspendLayout();
this.AgentSettings.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// configManagerBindingSource
//
this.configManagerBindingSource.DataSource = typeof(OpenStack.Designate.MicrosoftDNS.ConfigManager);
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.Controls.Add(this.RMQDetails);
this.flowLayoutPanel1.Controls.Add(this.DNSSettings);
this.flowLayoutPanel1.Controls.Add(this.AgentSettings);
this.flowLayoutPanel1.Controls.Add(this.QuitButton);
this.flowLayoutPanel1.Controls.Add(this.SaveButton);
this.flowLayoutPanel1.Controls.Add(this.ValidateButon);
this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft;
this.flowLayoutPanel1.Location = new System.Drawing.Point(12, 21);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(309, 493);
this.flowLayoutPanel1.TabIndex = 0;
//
// RMQDetails
//
this.RMQDetails.Controls.Add(this.RMQPasswordConfirmInput);
this.RMQDetails.Controls.Add(this.RMQPasswordConfirmLabel);
this.RMQDetails.Controls.Add(this.RMQPasswordInput);
this.RMQDetails.Controls.Add(this.RMQPasswordLabel);
this.RMQDetails.Controls.Add(this.RMQUserInput);
this.RMQDetails.Controls.Add(this.RMQUserLabel);
this.RMQDetails.Controls.Add(this.RMQPortInput);
this.RMQDetails.Controls.Add(this.RMQPortLabel);
this.RMQDetails.Controls.Add(this.RMQHostsInput);
this.RMQDetails.Controls.Add(this.RQMHostsLabel);
this.RMQDetails.Location = new System.Drawing.Point(0, 3);
this.RMQDetails.Name = "RMQDetails";
this.RMQDetails.Size = new System.Drawing.Size(306, 237);
this.RMQDetails.TabIndex = 0;
this.RMQDetails.TabStop = false;
this.RMQDetails.Text = "Rabbit MQ Connection Details";
//
// RMQPasswordConfirmInput
//
this.RMQPasswordConfirmInput.Location = new System.Drawing.Point(116, 208);
this.RMQPasswordConfirmInput.Name = "RMQPasswordConfirmInput";
this.RMQPasswordConfirmInput.PasswordChar = '*';
this.RMQPasswordConfirmInput.Size = new System.Drawing.Size(184, 20);
this.RMQPasswordConfirmInput.TabIndex = 10;
//
// RMQPasswordConfirmLabel
//
this.RMQPasswordConfirmLabel.AutoSize = true;
this.RMQPasswordConfirmLabel.Location = new System.Drawing.Point(6, 211);
this.RMQPasswordConfirmLabel.Name = "RMQPasswordConfirmLabel";
this.RMQPasswordConfirmLabel.Size = new System.Drawing.Size(91, 13);
this.RMQPasswordConfirmLabel.TabIndex = 9;
this.RMQPasswordConfirmLabel.Text = "Confirm Password";
//
// RMQPasswordInput
//
this.RMQPasswordInput.Location = new System.Drawing.Point(116, 177);
this.RMQPasswordInput.Name = "RMQPasswordInput";
this.RMQPasswordInput.PasswordChar = '*';
this.RMQPasswordInput.Size = new System.Drawing.Size(184, 20);
this.RMQPasswordInput.TabIndex = 8;
//
// RMQPasswordLabel
//
this.RMQPasswordLabel.AutoSize = true;
this.RMQPasswordLabel.Location = new System.Drawing.Point(6, 180);
this.RMQPasswordLabel.Name = "RMQPasswordLabel";
this.RMQPasswordLabel.Size = new System.Drawing.Size(104, 13);
this.RMQPasswordLabel.TabIndex = 7;
this.RMQPasswordLabel.Text = "RabbitMQ Password";
//
// RMQUserInput
//
this.RMQUserInput.Location = new System.Drawing.Point(116, 147);
this.RMQUserInput.Name = "RMQUserInput";
this.RMQUserInput.Size = new System.Drawing.Size(184, 20);
this.RMQUserInput.TabIndex = 6;
//
// RMQUserLabel
//
this.RMQUserLabel.AutoSize = true;
this.RMQUserLabel.Location = new System.Drawing.Point(6, 150);
this.RMQUserLabel.Name = "RMQUserLabel";
this.RMQUserLabel.Size = new System.Drawing.Size(80, 13);
this.RMQUserLabel.TabIndex = 5;
this.RMQUserLabel.Text = "RabbitMQ User";
//
// RMQPortInput
//
this.RMQPortInput.Location = new System.Drawing.Point(116, 117);
this.RMQPortInput.Maximum = new decimal(new int[] {
63535,
0,
0,
0});
this.RMQPortInput.Name = "RMQPortInput";
this.RMQPortInput.Size = new System.Drawing.Size(184, 20);
this.RMQPortInput.TabIndex = 4;
//
// RMQPortLabel
//
this.RMQPortLabel.AutoSize = true;
this.RMQPortLabel.Location = new System.Drawing.Point(6, 119);
this.RMQPortLabel.Name = "RMQPortLabel";
this.RMQPortLabel.Size = new System.Drawing.Size(77, 13);
this.RMQPortLabel.TabIndex = 2;
this.RMQPortLabel.Text = "RabbitMQ Port";
//
// RMQHostsInput
//
this.RMQHostsInput.Location = new System.Drawing.Point(116, 20);
this.RMQHostsInput.Multiline = true;
this.RMQHostsInput.Name = "RMQHostsInput";
this.RMQHostsInput.Size = new System.Drawing.Size(184, 83);
this.RMQHostsInput.TabIndex = 1;
//
// RQMHostsLabel
//
this.RQMHostsLabel.AutoSize = true;
this.RQMHostsLabel.Location = new System.Drawing.Point(6, 23);
this.RQMHostsLabel.Name = "RQMHostsLabel";
this.RQMHostsLabel.Size = new System.Drawing.Size(85, 13);
this.RQMHostsLabel.TabIndex = 0;
this.RQMHostsLabel.Text = "RabbitMQ Hosts";
//
// DNSSettings
//
this.DNSSettings.Controls.Add(this.MasterDNSInput);
this.DNSSettings.Controls.Add(this.MasterDNSLabel);
this.DNSSettings.Location = new System.Drawing.Point(0, 246);
this.DNSSettings.Name = "DNSSettings";
this.DNSSettings.Size = new System.Drawing.Size(306, 109);
this.DNSSettings.TabIndex = 1;
this.DNSSettings.TabStop = false;
this.DNSSettings.Text = "DNS Settings";
//
// MasterDNSInput
//
this.MasterDNSInput.Location = new System.Drawing.Point(116, 13);
this.MasterDNSInput.Multiline = true;
this.MasterDNSInput.Name = "MasterDNSInput";
this.MasterDNSInput.Size = new System.Drawing.Size(184, 83);
this.MasterDNSInput.TabIndex = 12;
//
// MasterDNSLabel
//
this.MasterDNSLabel.AutoSize = true;
this.MasterDNSLabel.Location = new System.Drawing.Point(6, 16);
this.MasterDNSLabel.Name = "MasterDNSLabel";
this.MasterDNSLabel.Size = new System.Drawing.Size(104, 13);
this.MasterDNSLabel.TabIndex = 11;
this.MasterDNSLabel.Text = "Master DNS Servers";
//
// QuitButton
//
this.QuitButton.Location = new System.Drawing.Point(231, 417);
this.QuitButton.Name = "QuitButton";
this.QuitButton.Size = new System.Drawing.Size(75, 23);
this.QuitButton.TabIndex = 3;
this.QuitButton.Text = "Quit";
this.QuitButton.UseVisualStyleBackColor = true;
//
// SaveButton
//
this.SaveButton.Location = new System.Drawing.Point(150, 417);
this.SaveButton.Name = "SaveButton";
this.SaveButton.Size = new System.Drawing.Size(75, 23);
this.SaveButton.TabIndex = 2;
this.SaveButton.Text = "Save";
this.SaveButton.UseVisualStyleBackColor = true;
//
// AgentSettings
//
this.AgentSettings.Controls.Add(this.AgentNameInput);
this.AgentSettings.Controls.Add(this.AgentNameLabel);
this.AgentSettings.Location = new System.Drawing.Point(0, 361);
this.AgentSettings.Name = "AgentSettings";
this.AgentSettings.Size = new System.Drawing.Size(306, 50);
this.AgentSettings.TabIndex = 4;
this.AgentSettings.TabStop = false;
this.AgentSettings.Text = "Agent Settings";
//
// AgentNameInput
//
this.AgentNameInput.Location = new System.Drawing.Point(116, 18);
this.AgentNameInput.Name = "AgentNameInput";
this.AgentNameInput.Size = new System.Drawing.Size(184, 20);
this.AgentNameInput.TabIndex = 12;
//
// AgentNameLabel
//
this.AgentNameLabel.AutoSize = true;
this.AgentNameLabel.Location = new System.Drawing.Point(6, 21);
this.AgentNameLabel.Name = "AgentNameLabel";
this.AgentNameLabel.Size = new System.Drawing.Size(66, 13);
this.AgentNameLabel.TabIndex = 11;
this.AgentNameLabel.Text = "Agent Name";
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.StatusLabel,
this.ProgressBar});
this.statusStrip1.Location = new System.Drawing.Point(0, 504);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(333, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
//
// StatusLabel
//
this.StatusLabel.Name = "StatusLabel";
this.StatusLabel.Size = new System.Drawing.Size(23, 17);
this.StatusLabel.Text = "OK";
//
// ProgressBar
//
this.ProgressBar.Name = "ProgressBar";
this.ProgressBar.Size = new System.Drawing.Size(100, 16);
this.ProgressBar.Visible = false;
//
// ValidateButon
//
this.ValidateButon.Location = new System.Drawing.Point(69, 417);
this.ValidateButon.Name = "ValidateButon";
this.ValidateButon.Size = new System.Drawing.Size(75, 23);
this.ValidateButon.TabIndex = 5;
this.ValidateButon.Text = "Validate";
this.ValidateButon.UseVisualStyleBackColor = true;
//
// Config
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(333, 526);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.flowLayoutPanel1);
this.Name = "Config";
this.Text = "OpenStack Designate MicrosoftDNS Agent Config";
this.Load += new System.EventHandler(this.Config_Load);
((System.ComponentModel.ISupportInitialize)(this.configManagerBindingSource)).EndInit();
this.flowLayoutPanel1.ResumeLayout(false);
this.RMQDetails.ResumeLayout(false);
this.RMQDetails.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.RMQPortInput)).EndInit();
this.DNSSettings.ResumeLayout(false);
this.DNSSettings.PerformLayout();
this.AgentSettings.ResumeLayout(false);
this.AgentSettings.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.BindingSource configManagerBindingSource;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.GroupBox RMQDetails;
private System.Windows.Forms.Label RQMHostsLabel;
private System.Windows.Forms.TextBox RMQHostsInput;
private System.Windows.Forms.Label RMQPortLabel;
private System.Windows.Forms.NumericUpDown RMQPortInput;
private System.Windows.Forms.TextBox RMQPasswordInput;
private System.Windows.Forms.Label RMQPasswordLabel;
private System.Windows.Forms.TextBox RMQUserInput;
private System.Windows.Forms.Label RMQUserLabel;
private System.Windows.Forms.TextBox RMQPasswordConfirmInput;
private System.Windows.Forms.Label RMQPasswordConfirmLabel;
private System.Windows.Forms.GroupBox DNSSettings;
private System.Windows.Forms.TextBox MasterDNSInput;
private System.Windows.Forms.Label MasterDNSLabel;
private System.Windows.Forms.Button SaveButton;
private System.Windows.Forms.Button QuitButton;
private System.Windows.Forms.GroupBox AgentSettings;
private System.Windows.Forms.TextBox AgentNameInput;
private System.Windows.Forms.Label AgentNameLabel;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel StatusLabel;
private System.Windows.Forms.ToolStripProgressBar ProgressBar;
private System.Windows.Forms.Button ValidateButon;
}
}

View File

@ -1,229 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenStack.Designate.MicrosoftDNS;
using RabbitMQ.Client;
namespace OpenStack.Designate.MicrosoftDNS
{
public partial class Config : Form
{
private ConfigManager _Config;
private AgentConsumer _AgentConsumer;
private Logging LOG;
public Config()
{
InitializeComponent();
this._Config = new ConfigManager();
this.LOG = Logging.GetLogger(LoggingContext.EventLog, _Config);
this._AddEvents();
}
private void Config_Load(object sender, EventArgs e)
{
//Get current values, & populate inputs
this.RMQPortInput.Value = this._Config.RMQPort;
this.RMQUserInput.Text = this._Config.RMQUser;
this.RMQPasswordInput.Text = this._Config.RMQPassword;
this.RMQPasswordConfirmInput.Text = this._Config.RMQPassword;
this.RMQHostsInput.Lines = this._Config.RMQHosts;
this.MasterDNSInput.Lines = this._Config.DNSMasters;
this.AgentNameInput.Text = this._Config.AgentName;
}
private void _AddEvents()
{
this.QuitButton.Click += QuitButton_Click;
this.SaveButton.Click += SaveButton_Click;
this.ValidateButon.Click += ValidateButon_Click;
}
void ValidateButon_Click(object sender, EventArgs e)
{
this.Validate();
}
void SaveButton_Click(object sender, EventArgs e)
{
if (this.Validate()){
this._Save();
this._Quit();
}
}
private void _ToggleButtons()
{
this.ValidateButon.Enabled = !this.ValidateButon.Enabled;
this.SaveButton.Enabled = !this.SaveButton.Enabled;
this.QuitButton.Enabled = !this.QuitButton.Enabled;
}
new public bool Validate()
{
this.StatusLabel.Text = "Validating";
this.StatusLabel.ForeColor = Color.Black;
this.ProgressBar.Value = 40;
this.ProgressBar.Visible = true;
this._ToggleButtons();
try
{
this.RMQHostsInput.Lines = this._StripBlankLines(this.RMQHostsInput.Lines);
this.MasterDNSInput.Lines = this._StripBlankLines(this.MasterDNSInput.Lines);
this._Validate();
this.StatusLabel.Text = "Values OK";
this.StatusLabel.ForeColor = Color.Green;
this.ProgressBar.Value = 100;
this._ToggleButtons();
return true;
}
catch (Exception error)
{
MessageBox.Show("There is an error in the values supplied:" + error.Message, "Validation Error");
this.StatusLabel.Text = "Error in Validation";
this.StatusLabel.ForeColor = Color.Red;
this.ProgressBar.Value = 100;
this._ToggleButtons();
return false;
}
}
void QuitButton_Click(object sender, EventArgs e)
{
this._Quit();
}
private void _Validate()
{
bool Errors = false;
string ErrorMessage = "";
this.ProgressBar.Value = 40;
if (this.RMQPortInput.Value == 0)
{
ErrorMessage += Environment.NewLine + "RabbitMQ Port Number is invalid";
Errors = true;
}
if (this.RMQPasswordInput.Text != this.RMQPasswordConfirmInput.Text)
{
ErrorMessage += Environment.NewLine + "RabbitMQ passwords do not match";
Errors = true;
throw new Exception(ErrorMessage);
}
if (this.RMQHostsInput.Lines.Length == 0){
ErrorMessage += Environment.NewLine + "RabbitMQ hosts is blank.";
Errors = true;
}
if (this.MasterDNSInput.Lines.Length == 0)
{
ErrorMessage += Environment.NewLine + "Master DNS Servers is blank.";
Errors = true;
}
if (this.RMQUserInput.TextLength == 0)
{
ErrorMessage += Environment.NewLine + "RabbitMQ Username is blank.";
Errors = true;
}
if (this.AgentNameInput.TextLength == 0)
{
ErrorMessage += Environment.NewLine + "Agent Name is blank.";
Errors = true;
}
if (this.RMQPasswordInput.TextLength == 0)
{
ErrorMessage += Environment.NewLine + "RabbitMQ Password is blank.";
Errors = true;
}
this.ProgressBar.Value = 60;
try
{
foreach (string host in this.RMQHostsInput.Lines)
{
string[] _TestHosts = new string[1] {host};
ConfigManager _TestConfig = new ConfigManager(false, false, _TestHosts, null, this.RMQUserInput.Text, this.RMQPasswordInput.Text, (int)this.RMQPortInput.Value);
this._AgentConsumer = new AgentConsumer(_TestConfig);
this._AgentConsumer.Start();
this._AgentConsumer.Stop();
}
}
catch (RabbitMQ.Client.Exceptions.BrokerUnreachableException e)
{
this._AgentConsumer.Stop();
if (e.InnerException != null && e.InnerException is RabbitMQ.Client.Exceptions.AuthenticationFailureException)
{
ErrorMessage += Environment.NewLine + "RabbitMQ Authentication problem. Please check the RabbitMQ username and password values";
Errors = true;
}
else
{
ErrorMessage += Environment.NewLine + "RabbitMQ Connection problem. Please check the values set for Rabbit MQ Hosts and try again";
Errors = true;
}
}
catch (Exception)
{
ErrorMessage += Environment.NewLine + "Unspecified RabbitMQ problem. Please check all RabbitMQ values";
Errors = true;
}
if (Errors)
{
throw new Exception(ErrorMessage);
}
}
private string[] _StripBlankLines(string[] input)
{
for (int i = 0; i < input.Length; i++)
{
if (string.IsNullOrWhiteSpace(input[i]))
{
input = input.Where(w => w != input[i]).ToArray();
}
}
return input;
}
private void _Save()
{
this._Config.DNSMasters = this.MasterDNSInput.Lines;
this._Config.RMQHosts = this.RMQHostsInput.Lines;
this._Config.RMQUser =this.RMQUserInput.Text;
this._Config.RMQPassword = this.RMQPasswordInput.Text;
this._Config.RMQPort = (int)this.RMQPortInput.Value;
this._Config.AgentName = this.AgentNameInput.Text;
}
private void _Quit()
{
Application.Exit();
}
}
}

View File

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="configManagerBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>230, 17</value>
</metadata>
</root>

View File

@ -1,141 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4B73A73E-F892-45BA-9728-61978E659D28}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenStack.Designate.MicrosoftDNS</RootNamespace>
<AssemblyName>OpenStack.Designate.MicrosoftDNS.ConfigGUI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>OpenStack.Designate.MicrosoftDNS.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="RabbitMQ.Client, Version=3.3.5.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\RabbitMQ.Client.3.3.5\lib\net30\RabbitMQ.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Config.Designer.cs">
<DependentUpon>Config.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Config.resx">
<DependentUpon>Config.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenStack.Designate.MicrosoftDNS\OpenStack.Designate.MicrosoftDNS.csproj">
<Project>{ed42a619-de66-4df7-ab2a-f6c341833965}</Project>
<Name>OpenStack.Designate.MicrosoftDNS</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\DataSources\" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,36 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OpenStack.Designate.MicrosoftDNS
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Config());
}
}
}

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenStack.Designate.MicrosoftDNS.ConfigGUI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard")]
[assembly: AssemblyProduct("OpenStack.Designate.MicrosoftDNS.ConfigGUI")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4c855439-f440-4d2b-8593-74a55eb424c2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

View File

@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18408
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenStack.Designate.MicrosoftDNS.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenStack.Designate.MicrosoftDNS.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18408
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace OpenStack.Designate.MicrosoftDNS.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RabbitMQ.Client" version="3.3.5" targetFramework="net45" />
</packages>

View File

@ -1,225 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.IO;
using System.Text;
using System.Threading;
using CommandLine;
using CommandLine.Text;
using OpenStack.Designate.MicrosoftDNS;
namespace OpenStack.Designate.MicrosoftDNS.Console
{
class AgentCLI
{
class Options
{
public Options()
{
this.AgentService = new AgentServiceSubOptions { };
}
//Top Level Options
[Option('d', "debug", DefaultValue = false, HelpText = "Enable Debug Level Logging")]
public bool Debug { get; set; }
[VerbOption("agent-service", HelpText = "Start the Agent Service")]
public AgentServiceSubOptions AgentService { get; set; }
[VerbOption("add-zone", HelpText = "Add a Zone Manually")]
public AddZoneSubOptions AddZone { get; set; }
[VerbOption("get-zone", HelpText = "Get a Zone Details")]
public GetZoneSubOptions GetZone { get; set; }
[VerbOption("delete-zone", HelpText = "Delete a zone manually")]
public DeleteZoneSubOptions DeleteZone { get; set; }
[VerbOption("get-config", HelpText = "Get a Local Config Details")]
public GetConfigSubOptions GetConfig { get; set; }
//Internal Parser
[ParserState]
public IParserState LastParserState { get; set; }
[HelpVerbOption]
public string GetUsage(string verb)
{
return HelpText.AutoBuild(this, verb);
}
}
//2nd Level Option Classes
class GetConfigSubOptions {}
class AgentServiceSubOptions {}
class AddZoneSubOptions
{
[Option("zone-name",Required=true , HelpText = "Zone Name")]
public string ZoneName { get; set; }
}
class GetZoneSubOptions
{
[Option("zone-name",Required=true , HelpText = "Zone Name")]
public string ZoneName { get; set; }
}
class DeleteZoneSubOptions
{
[Option("zone-name",Required=true , HelpText = "Zone Name")]
public string ZoneName { get; set; }
}
public static void Main(string[] args)
{
string invokedVerb = null;
object invokedVerbInstance = null;
var options = new Options();
if (!CommandLine.Parser.Default.ParseArguments(args, options,
(verb, subOptions) =>
{
// if parsing succeeds the verb name and correct instance
// will be passed to onVerbCommand delegate (string,object)
invokedVerb = verb;
invokedVerbInstance = subOptions;
}))
{
Environment.Exit(CommandLine.Parser.DefaultExitCodeFail);
}
switch (invokedVerb)
{
case "agent-service":
AgentCLI.StartAgentService(options, (AgentServiceSubOptions)invokedVerbInstance);
break;
case "add-zone":
AgentCLI.AddZone(options, (AddZoneSubOptions)invokedVerbInstance);
break;
case "get-zone":
AgentCLI.GetZone(options, (GetZoneSubOptions)invokedVerbInstance);
break;
case "delete-zone":
AgentCLI.DeleteZone(options, (DeleteZoneSubOptions)invokedVerbInstance);
break;
case "get-config":
AgentCLI.GetConfig(options);
break;
default:
Environment.Exit(CommandLine.Parser.DefaultExitCodeFail);
break;
}
}
private static void StartAgentService(Options options, AgentServiceSubOptions subOptions)
{
ConfigManager _Config = new ConfigManager();
Logging LOG = Logging.GetLogger(LoggingContext.Console, _Config);
AgentConsumer agentConsumer = new AgentConsumer(_Config);
agentConsumer.Start();
Thread ServiceThread = new Thread(agentConsumer.Consume);
ServiceThread.Start();
LOG.Log(LogLevel.Information, "Started Service Thread");
LOG.Log(LogLevel.Verbose, "Thread ID: " + ServiceThread.ManagedThreadId);
System.Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e)
{
e.Cancel = true;
LOG.Log(LogLevel.Information, "Caught Ctrl+C - Stopping Service");
agentConsumer.Stop();
LOG.Log(LogLevel.Verbose, "Blocking on Service Thread Completion");
ServiceThread.Join();
};
}
private static void AddZone(Options options, AddZoneSubOptions subOptions)
{
ConfigManager _Config = new ConfigManager();
Logging LOG = Logging.GetLogger(LoggingContext.Console, _Config);
DNSServer dns = new DNSServer(_Config);
LOG.Log(LogLevel.Information, "Connecting to WMI");
dns.Connect();
LOG.Log(LogLevel.Information, "Adding Zone");
dns.CreateNewZone(subOptions.ZoneName, _Config.DNSMasters);
}
private static void GetZone(Options options, GetZoneSubOptions subOptions)
{
ConfigManager _Config = new ConfigManager();
Logging LOG = Logging.GetLogger(LoggingContext.Console, _Config);
DNSServer dns = new DNSServer(_Config);
LOG.Log(LogLevel.Information, "Connecting to WMI");
dns.Connect();
LOG.Log(LogLevel.Verbose, "Getting Zone");
DNSServer.DNSZone zone = dns.FetchZone(subOptions.ZoneName);
LOG.Log(LogLevel.Information, "Zone Retrieved: "+ zone.Name);
LOG.Log(LogLevel.Information, "Zone Masters: ");
foreach (string master in zone.MasterServers)
{
LOG.Log(LogLevel.Information, master);
}
}
private static void DeleteZone(Options options, DeleteZoneSubOptions subOptions)
{
ConfigManager _Config = new ConfigManager();
Logging LOG = Logging.GetLogger(LoggingContext.Console, _Config);
DNSServer dns = new DNSServer(_Config);
LOG.Log(LogLevel.Information, "Connecting to WMI");
dns.Connect();
LOG.Log(LogLevel.Verbose, "Fetching Zone to Delete");
DNSServer.DNSZone zone = dns.FetchZone(subOptions.ZoneName);
LOG.Log(LogLevel.Verbose, "Deleting Zone");
zone.DeleteZone();
LOG.Log(LogLevel.Information, "Zone Deleted");
}
private static void GetConfig(Options options)
{
ConfigManager _Config = new ConfigManager();
Logging LOG = Logging.GetLogger(LoggingContext.Console, _Config);
LOG.Log(LogLevel.Information, "::Config Details:: ");
LOG.Log(LogLevel.Information, "Rabbit Hosts:");
foreach (string host in _Config.RMQHosts)
{
LOG.Log(LogLevel.Information, host);
}
LOG.Log(LogLevel.Information, "Rabbit MQ User: " + _Config.RMQUser);
LOG.Log(LogLevel.Information, "Rabbit MQ Port: " + _Config.RMQPort);
LOG.Log(LogLevel.Information, "Master DNS Servers:");
foreach (string host in _Config.DNSMasters)
{
LOG.Log(LogLevel.Information, host);
}
LOG.Log(LogLevel.Information, "Agent Name: " + _Config.AgentName);
LOG.Log(LogLevel.Information, "Logging Level: " + _Config.LogLevel);
LOG.Log(LogLevel.Information, "WMI Host: " + _Config.WMIHost);
LOG.Log(LogLevel.Information, "WMI User: " + _Config.WMIUser);
}
}
}

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BFE54CB8-7B8C-4B58-909D-D1C4F09EF689}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenStack.Designate.MicrosoftDNS.Console</RootNamespace>
<AssemblyName>OpenStack.Designate.MicrosoftDNS.Console</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>OpenStack.Designate.MicrosoftDNS.Console.AgentCLI</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="CommandLine">
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="AgentCLI.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenStack.Designate.MicrosoftDNS\OpenStack.Designate.MicrosoftDNS.csproj">
<Project>{ed42a619-de66-4df7-ab2a-f6c341833965}</Project>
<Name>OpenStack.Designate.MicrosoftDNS</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenStack.Designate.MicrosoftDNS.Console")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard")]
[assembly: AssemblyProduct("OpenStack.Designate.MicrosoftDNS.Console")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a15ac1f6-ae71-41b8-90d8-123d0862b86a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommandLineParser" version="1.9.71" targetFramework="net45" />
</packages>

View File

@ -1,59 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
namespace OpenStack.Designate.MicrosoftDNS.Service
{
partial class AgentService
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.eventLog = new System.Diagnostics.EventLog();
((System.ComponentModel.ISupportInitialize)(this.eventLog)).BeginInit();
//
// AgentService
//
this.ServiceName = "AgentService";
((System.ComponentModel.ISupportInitialize)(this.eventLog)).EndInit();
}
#endregion
private System.Diagnostics.EventLog eventLog;
}
}

View File

@ -1,105 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using OpenStack.Designate.MicrosoftDNS;
namespace OpenStack.Designate.MicrosoftDNS.Service
{
public partial class AgentService : ServiceBase
{
private AgentConsumer _AgentConsumer = null;
private ServiceStatus _ServiceStatus = new ServiceStatus() { dwWaitHint = 100000 };
public enum ServiceState
{
SERVICE_STOPPED = 0x00000001,
SERVICE_START_PENDING = 0x00000002,
SERVICE_STOP_PENDING = 0x00000003,
SERVICE_RUNNING = 0x00000004,
SERVICE_CONTINUE_PENDING = 0x00000005,
SERVICE_PAUSE_PENDING = 0x00000006,
SERVICE_PAUSED = 0x00000007,
}
[StructLayout(LayoutKind.Sequential)]
public struct ServiceStatus
{
public long dwServiceType;
public ServiceState dwCurrentState;
public long dwControlsAccepted;
public long dwWin32ExitCode;
public long dwServiceSpecificExitCode;
public long dwCheckPoint;
public long dwWaitHint;
};
private ConfigManager _Config;
private Logging LOG;
private Thread _ServiceThread;
public AgentService()
{
this._Config = new ConfigManager();
this.LOG = Logging.GetLogger(LoggingContext.EventLog, _Config);
InitializeComponent();
this._AgentConsumer = new AgentConsumer(this._Config);
}
protected override void OnStart(string[] args)
{
// Update the service state to Start Pending.
this._ServiceStatus.dwCurrentState = ServiceState.SERVICE_START_PENDING;
SetServiceStatus(this.ServiceHandle, ref this._ServiceStatus);
// Start the Service
this._AgentConsumer.Start();
// Update the service state to Running.
this._ServiceStatus.dwCurrentState = ServiceState.SERVICE_RUNNING;
SetServiceStatus(this.ServiceHandle, ref this._ServiceStatus);
// Begin Consuming Messgaes
_ServiceThread = new Thread(this._AgentConsumer.Consume);
_ServiceThread.Start();
}
protected override void OnStop()
{
// Update the service state to Stop Pending.
this._ServiceStatus.dwCurrentState = ServiceState.SERVICE_STOP_PENDING;
SetServiceStatus(this.ServiceHandle, ref this._ServiceStatus);
// Stop the Service
this._AgentConsumer.Stop();
this._ServiceThread.Join();
// Update the service state to Stopped.
this._ServiceStatus.dwCurrentState = ServiceState.SERVICE_STOPPED;
SetServiceStatus(this.ServiceHandle, ref this._ServiceStatus);
}
[DllImport("advapi32.dll", SetLastError = true)]
private static extern bool SetServiceStatus(IntPtr handle, ref ServiceStatus serviceStatus);
}
}

View File

@ -1,126 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="eventLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -1,118 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7E666EC4-2292-43AB-99C2-99461B254558}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenStack.Designate.MicrosoftDNS.Service</RootNamespace>
<AssemblyName>OpenStack.Designate.MicrosoftDNS.Service</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>OpenStack.Designate.MicrosoftDNS.Service.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Management" />
<Reference Include="System.ServiceProcess" />
</ItemGroup>
<ItemGroup>
<Compile Include="AgentService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="AgentService.Designer.cs">
<DependentUpon>AgentService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="ProjectInstaller.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ProjectInstaller.Designer.cs">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenStack.Designate.MicrosoftDNS\OpenStack.Designate.MicrosoftDNS.csproj">
<Project>{ed42a619-de66-4df7-ab2a-f6c341833965}</Project>
<Name>OpenStack.Designate.MicrosoftDNS</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AgentService.resx">
<DependentUpon>AgentService.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ProjectInstaller.resx">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,39 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
namespace OpenStack.Designate.MicrosoftDNS.Service
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new AgentService()
};
ServiceBase.Run(ServicesToRun);
}
}
}

View File

@ -1,75 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
namespace OpenStack.Designate.MicrosoftDNS.Service
{
partial class ProjectInstaller
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.agentServiceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
this.agentServiceInstaller = new System.ServiceProcess.ServiceInstaller();
//
// agentServiceProcessInstaller
//
this.agentServiceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.agentServiceProcessInstaller.Password = null;
this.agentServiceProcessInstaller.Username = null;
this.agentServiceProcessInstaller.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller1_AfterInstall);
//
// agentServiceInstaller
//
this.agentServiceInstaller.Description = "OpenStack Designate Microsoft DNS Agent";
this.agentServiceInstaller.DisplayName = "OpenStack Designate Microsoft DNS Agent";
this.agentServiceInstaller.ServiceName = "AgentService";
this.agentServiceInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.agentServiceProcessInstaller,
this.agentServiceInstaller});
}
#endregion
private System.ServiceProcess.ServiceProcessInstaller agentServiceProcessInstaller;
private System.ServiceProcess.ServiceInstaller agentServiceInstaller;
}
}

View File

@ -1,38 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading.Tasks;
namespace OpenStack.Designate.MicrosoftDNS.Service
{
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
{
public ProjectInstaller()
{
InitializeComponent();
}
private void serviceProcessInstaller1_AfterInstall(object sender, InstallEventArgs e)
{
}
}
}

View File

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="agentServiceProcessInstaller.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>37, 60</value>
</metadata>
<metadata name="agentServiceInstaller.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>29, 19</value>
</metadata>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenStack.Designate.MicrosoftDNS.Service")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard")]
[assembly: AssemblyProduct("OpenStack.Designate.MicrosoftDNS.Service")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("35e381a0-b64f-4760-89ca-dd3fe70dc659")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

View File

@ -1,44 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenStack.Designate.MicrosoftDNS", "OpenStack.Designate.MicrosoftDNS\OpenStack.Designate.MicrosoftDNS.csproj", "{ED42A619-DE66-4DF7-AB2A-F6C341833965}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenStack.Designate.MicrosoftDNS.Console", "OpenStack.Designate.MicrosoftDNS.Console\OpenStack.Designate.MicrosoftDNS.Console.csproj", "{BFE54CB8-7B8C-4B58-909D-D1C4F09EF689}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenStack.Designate.MicrosoftDNS.Service", "OpenStack.Designate.MicrosoftDNS.Service\OpenStack.Designate.MicrosoftDNS.Service.csproj", "{7E666EC4-2292-43AB-99C2-99461B254558}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "OpenStack.Designate.MicrosoftDNS.Setup", "OpenStack.Designate.MicrosoftDNS.Setup\OpenStack.Designate.MicrosoftDNS.Setup.vdproj", "{C0CCCB97-1E7A-4F84-AA04-15DEF238A59E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenStack.Designate.MicrosoftDNS.ConfigGUI", "OpenStack.Designate.MicrosoftDNS.ConfigGUI\OpenStack.Designate.MicrosoftDNS.ConfigGUI.csproj", "{4B73A73E-F892-45BA-9728-61978E659D28}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ED42A619-DE66-4DF7-AB2A-F6C341833965}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED42A619-DE66-4DF7-AB2A-F6C341833965}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED42A619-DE66-4DF7-AB2A-F6C341833965}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED42A619-DE66-4DF7-AB2A-F6C341833965}.Release|Any CPU.Build.0 = Release|Any CPU
{BFE54CB8-7B8C-4B58-909D-D1C4F09EF689}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFE54CB8-7B8C-4B58-909D-D1C4F09EF689}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFE54CB8-7B8C-4B58-909D-D1C4F09EF689}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFE54CB8-7B8C-4B58-909D-D1C4F09EF689}.Release|Any CPU.Build.0 = Release|Any CPU
{7E666EC4-2292-43AB-99C2-99461B254558}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E666EC4-2292-43AB-99C2-99461B254558}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7E666EC4-2292-43AB-99C2-99461B254558}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E666EC4-2292-43AB-99C2-99461B254558}.Release|Any CPU.Build.0 = Release|Any CPU
{C0CCCB97-1E7A-4F84-AA04-15DEF238A59E}.Debug|Any CPU.ActiveCfg = Debug
{C0CCCB97-1E7A-4F84-AA04-15DEF238A59E}.Release|Any CPU.ActiveCfg = Release
{4B73A73E-F892-45BA-9728-61978E659D28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B73A73E-F892-45BA-9728-61978E659D28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B73A73E-F892-45BA-9728-61978E659D28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B73A73E-F892-45BA-9728-61978E659D28}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,190 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.IO;
using System.Text;
using RabbitMQ.Client;
using RabbitMQ.Client.Events;
namespace OpenStack.Designate.MicrosoftDNS
{
// Agent Consumer
public class AgentConsumer
{
Logging LOG = Logging.GetLogger();
private ConnectionFactory _ConnectionFactory = null;
private IConnection _Connection = null;
private IModel _Channel = null;
private QueueingBasicConsumer _Consumer = null;
private AgentConsumerHandler _Handler;
private ConfigManager _Config;
private bool _Stopping = false;
public AgentConsumer(ConfigManager config)
{
this._Config = config;
this._Handler = new AgentConsumerHandler(this);
this._ConnectionFactory = new ConnectionFactory();
this._ConnectionFactory.UserName = this._Config.RMQUser;
this._ConnectionFactory.Password = this._Config.RMQPassword;
this._ConnectionFactory.Port = this._Config.RMQPort;
}
public void Start()
{
this._Connect();
}
private void _Connect()
{
LOG.Log(LogLevel.Information, "AgentConsumer Connecting");
this._CreateConnection();
this._Channel = this._Connection.CreateModel();
this._Consumer = new QueueingBasicConsumer(this._Channel);
}
private void _CreateConnection()
{
Exception LastError = null;
foreach (string host in this._Config.RMQHosts)
{
try
{
this._ConnectionFactory.HostName = host;
this._Connection = this._ConnectionFactory.CreateConnection();
if (this._Connection != null && this._Connection.IsOpen)
{
LOG.Log(LogLevel.Information, "Connected to Rabbit MQ Server: " + host);
break;
}
}
catch (Exception e)
{
if (e.InnerException != null && e.InnerException is RabbitMQ.Client.Exceptions.AuthenticationFailureException)
{
throw e;
}
else
{
LastError = e;
}
}
}
if (LastError != null)
{
throw LastError;
}
}
private void _Initialize()
{
LOG.Log(LogLevel.Information, "AgentConsumer Initializing");
string agent_queue = String.Format(@"agent.{0}", this._Config.AgentName);
LOG.Log(LogLevel.Verbose, "agent_queue: " + agent_queue);
string agent_fanout_queue = String.Format(@"agent_fanout_{0}", this._Config.AgentName);
LOG.Log(LogLevel.Verbose, "agent_fanout_queue: " + agent_fanout_queue);
this._Channel.ExchangeDeclare("designate", "topic");
LOG.Log(LogLevel.Verbose, "Declared Topic Exchange");
this._Channel.ExchangeDeclare("agent_fanout", "fanout");
LOG.Log(LogLevel.Verbose, "Declared Fanout Exchange");
this._Channel.QueueDeclare("agent", false, false, false, null);
LOG.Log(LogLevel.Verbose, "Declared agent queue");
this._Channel.QueueDeclare(agent_queue, false, false, false, null);
LOG.Log(LogLevel.Verbose, "Declared " + agent_queue + " queue");
this._Channel.QueueDeclare(agent_fanout_queue, false, false, true, null);
LOG.Log(LogLevel.Verbose, "Declared " + agent_fanout_queue + " queue");
this._Channel.QueueBind("agent", "designate", "agent");
LOG.Log(LogLevel.Verbose, "Bound to agent queue");
this._Channel.QueueBind(agent_queue, "designate", agent_queue);
LOG.Log(LogLevel.Verbose, "Bound to " + agent_queue + " queue");
this._Channel.QueueBind(agent_fanout_queue, "agent_fanout", "agent");
LOG.Log(LogLevel.Verbose, "Bound to " + agent_fanout_queue + " queue");
this._Channel.BasicConsume("agent", true, this._Consumer);
LOG.Log(LogLevel.Verbose, "Consuming from agent queue");
this._Channel.BasicConsume(agent_queue, true, this._Consumer);
LOG.Log(LogLevel.Verbose, "Consuming from " + agent_queue + " queue");
this._Channel.BasicConsume(agent_fanout_queue, true, this._Consumer);
LOG.Log(LogLevel.Verbose, "Consuming from " + agent_fanout_queue + " queue");
}
public void Consume()
{
this._Initialize();
LOG.Log(LogLevel.Information, "AgentConsumer Processing Messages");
while (this._Stopping != true)
{
try
{
BasicDeliverEventArgs e = (BasicDeliverEventArgs) this._Consumer.Queue.Dequeue();
this._Handler.Dispatch(Encoding.UTF8.GetString(e.Body));
//channel.BasicAck(e.DeliveryTag, false);
}
catch (EndOfStreamException)
{
// The consumer was cancelled, the model closed, or the
// connection went away.
if (!this._Stopping)
{
LOG.Log(LogLevel.Error, "AgentConsumer EndOfStreamException");
this._Connect();
this._Initialize();
}
}
}
}
public void Stop()
{
LOG.Log(LogLevel.Information, "Stopping AgentConsumer");
this._Stopping = true;
if (this._Connection != null)
{
LOG.Log(LogLevel.Information, "Closing Connection");
this._Connection.Close();
LOG.Log(LogLevel.Information, "Connection Closed");
}
}
public void Reply(string queue, string message)
{
using (var channel = this._Connection.CreateModel())
{
var body = Encoding.UTF8.GetBytes(message);
IBasicProperties properties = channel.CreateBasicProperties();
properties.ContentType = "application/json";
channel.BasicPublish(queue, queue, properties, body);
LOG.Log(LogLevel.Verbose, "Replied with message: "+ message + " to Queue: " + queue);
}
}
}
}

View File

@ -1,169 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.IO;
using System.Text;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
namespace OpenStack.Designate.MicrosoftDNS
{
//Exceptions
public class MethodNotImplementedException : NotImplementedException
{
public MethodNotImplementedException(string method)
: base()
{
Logging LOG = Logging.GetLogger();
LOG.Log(LogLevel.Verbose, method + " Method Not Implemented");
}
}
class AgentConsumerHandler
{
private DataContractJsonSerializer _OsloMessagingEnvelopeSerializer = new DataContractJsonSerializer(typeof(OsloMessagingEnvelope));
private DataContractJsonSerializer _OsloMessagingMessageSerializer = new DataContractJsonSerializer(typeof(OsloMessagingMessage));
private DataContractJsonSerializer _OsloMessagingReplyMessageSerializer = new DataContractJsonSerializer(typeof(OsloMessagingReplyMessage));
private Logging LOG;
private DNSServer _DNS;
private ConfigManager _Config;
private AgentConsumer _Consumer;
public AgentConsumerHandler(AgentConsumer consumer)
{
_Consumer = consumer;
LOG = Logging.GetLogger();
_Config = new ConfigManager();
_DNS = new DNSServer(_Config);
_DNS.Connect();
}
public OsloMessagingMessage Deserialize(string message)
{
OsloMessagingEnvelope ome = this._DeserializeOsloMessagingEnvelope(message);
OsloMessagingMessage omm = this._DeserializeOsloMessagingMessage(ome.OsloMessage);
return omm;
}
private string _SerialiseReplyMessage(string msg_id){
OsloMessagingReplyMessage replyMessageDataContract = new OsloMessagingReplyMessage();
OsloMessagingEnvelope replyEnvelopeDataContract = new OsloMessagingEnvelope();
MemoryStream replyMessageStream = new MemoryStream();
MemoryStream replyEnvelopeStream = new MemoryStream();
replyMessageDataContract.UniqueID = Guid.NewGuid().ToString("N");
replyMessageDataContract.ending = true;
replyMessageDataContract.result = null;
replyMessageDataContract.failure = null;
replyMessageDataContract.MessageId = msg_id;
this._OsloMessagingReplyMessageSerializer.WriteObject(replyMessageStream, replyMessageDataContract);
string replyMessage = ASCIIEncoding.ASCII.GetString(replyMessageStream.ToArray());
LOG.Log(LogLevel.Verbose, "Reply Message: " + replyMessage);
replyEnvelopeDataContract.OsloMessage = replyMessage;
replyEnvelopeDataContract.OsloVersion = "2.0";
this._OsloMessagingEnvelopeSerializer.WriteObject(replyEnvelopeStream, replyEnvelopeDataContract);
string replyEnvelope = ASCIIEncoding.ASCII.GetString(replyEnvelopeStream.ToArray());
LOG.Log(LogLevel.Verbose, "Reply: " + replyEnvelope);
return replyEnvelope;
}
public void Reply(string msg_id, string reply_queue)
{
string message = this._SerialiseReplyMessage(msg_id);
this._Consumer.Reply(reply_queue, message);
}
private OsloMessagingEnvelope _DeserializeOsloMessagingEnvelope(string message)
{
MemoryStream ms = new MemoryStream(ASCIIEncoding.ASCII.GetBytes(message));
OsloMessagingEnvelope om = null;
try
{
om = (OsloMessagingEnvelope)this._OsloMessagingEnvelopeSerializer.ReadObject(ms);
}
catch (SerializationException ex)
{
LOG.Log(LogLevel.Error, "Failed to deserialize OsloMessagingEnvelope: " + ex.Message);
throw ex;
}
return om;
}
private OsloMessagingMessage _DeserializeOsloMessagingMessage(string message)
{
MemoryStream ms = new MemoryStream(ASCIIEncoding.ASCII.GetBytes(message));
OsloMessagingMessage om = null;
try
{
om = (OsloMessagingMessage)this._OsloMessagingMessageSerializer.ReadObject(ms);
}
catch (SerializationException ex)
{
LOG.Log(LogLevel.Error, "Failed to deserialize OsloMessagingMessage: " + ex.Message);
throw ex;
}
return om;
}
public void Dispatch(string message)
{
LOG.Log(LogLevel.Verbose, "Received message");
try
{
OsloMessagingMessage om = this.Deserialize(message);
switch (om.Method)
{
case "create_domain":
_DNS.CreateNewZone(om.Args.Domain.Data.Name, this._Config.DNSMasters);
LOG.Log(LogLevel.Information, "Created Domain: " + om.Args.Domain.Data.Name);
this.Reply(om.MessageId, om.ReplyQueue);
break;
case "delete_domain":
DNSServer.DNSZone zone = _DNS.FetchZone(om.Args.Domain.Data.Name);
zone.DeleteZone();
LOG.Log(LogLevel.Information, "Deleted Domain: " + om.Args.Domain.Data.Name);
this.Reply(om.MessageId, om.ReplyQueue);
break;
default:
throw new MethodNotImplementedException(om.Method);
}
}
catch (SerializationException ex)
{
LOG.Log(LogLevel.Error, "Failed to dispatch message: " + ex.Message);
}
}
}
}

View File

@ -1,187 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Security;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;
namespace OpenStack.Designate.MicrosoftDNS
{
public class ConfigManager
{
//Registry Base Key
private RegistryKey _LocalMachine = Registry.LocalMachine;
private RegistryKey _Software;
private RegistryKey _DesignateMSDNS;
//Config Values
private string[] _RMQHosts;
private string[] _DNSMasters;
private int _RMQPort;
private string _RMQUser;
private string _RMQPassword;
private string _AgentName;
private bool _WriteToRegistry = false;
private string _WMIHost;
private string _WMIUser;
private string _WMIPassword;
private string _WMIAuthority;
private LogLevel _LogLevel;
public ConfigManager(bool WriteToRegistry = true, bool ReadFromRegistry = true)
{
this._WriteToRegistry = WriteToRegistry;
if (WriteToRegistry)
{
this._Setup();
if (ReadFromRegistry)
{
this._InitValues();
}
}
}
public ConfigManager(bool WriteToRegistry, bool ReadFromRegistry, string[] RMQHosts = null, string[] DNSMasters = null, string RMQUser = null, string RMQPassword = null, int RMQPort = 0, string AgentName = null)
: this(WriteToRegistry, ReadFromRegistry)
{
this._RMQHosts = RMQHosts;
this._DNSMasters = DNSMasters;
this._RMQUser = RMQUser;
this._RMQPassword = RMQPassword;
this._RMQPort = RMQPort;
this._AgentName = AgentName;
}
private void _Setup()
{
//Init the registry connection
this._Software = this._LocalMachine.OpenSubKey("SOFTWARE", RegistryKeyPermissionCheck.ReadWriteSubTree, System.Security.AccessControl.RegistryRights.FullControl);
this._DesignateMSDNS = this._Software.CreateSubKey("DesignateMSDNS", RegistryKeyPermissionCheck.ReadWriteSubTree);
this._Software.Flush();
}
private void _InitValues(){
//Get Current Values
this._RMQHosts = (string[])this._DesignateMSDNS.GetValue("RMQHosts", new string[0] { });
this._DNSMasters = (string[])this._DesignateMSDNS.GetValue("DNSMasters", new string[0] { });
this._RMQPort = (int)this._DesignateMSDNS.GetValue("RMQPort", 5672);
this._RMQUser = (string)this._DesignateMSDNS.GetValue("RMQUser", "guest");
this._RMQPassword = (string)this._DesignateMSDNS.GetValue("RMQPassword", "guest");
this._AgentName = (string)this._DesignateMSDNS.GetValue("AgentName", System.Environment.MachineName);
this._WMIHost = (string)this._DesignateMSDNS.GetValue("WMIHost", "127.0.0.1");
this._WMIUser = (string)this._DesignateMSDNS.GetValue("WMIUser", null);
this._WMIPassword = (string)this._DesignateMSDNS.GetValue("WMIPassword", null);
this._WMIAuthority = (string)this._DesignateMSDNS.GetValue("WMIAuthority", null);
this._LogLevel = (LogLevel)this._DesignateMSDNS.GetValue("LogLevel", LogLevel.Information);
}
private void _SaveValue(string key, string value)
{
if (this._WriteToRegistry)
{
this._DesignateMSDNS.SetValue(key, value, RegistryValueKind.String);
this._DesignateMSDNS.Flush();
}
}
private void _SaveValue(string key, string[] value)
{
if (this._WriteToRegistry)
{
this._DesignateMSDNS.SetValue(key, value, RegistryValueKind.MultiString);
this._DesignateMSDNS.Flush();
}
}
private void _SaveValue(string key, int value)
{
if (this._WriteToRegistry)
{
this._DesignateMSDNS.SetValue(key, value, RegistryValueKind.DWord);
this._DesignateMSDNS.Flush();
}
}
//Getters and Setters
public string[] RMQHosts
{
get { return _RMQHosts; }
set { _RMQHosts = value; this._SaveValue("RMQHosts", value); }
}
public string[] DNSMasters
{
get { return _DNSMasters; }
set { _DNSMasters = value; this._SaveValue("DNSMasters", value); }
}
public string RMQUser
{
get { return _RMQUser; }
set { _RMQUser = value; this._SaveValue("RMQUser", value); }
}
public string RMQPassword
{
get { return _RMQPassword; }
set { _RMQPassword = value; this._SaveValue("RMQPassword", value); }
}
public int RMQPort
{
get { return _RMQPort; }
set { _RMQPort = value; this._SaveValue("RMQPort", value); }
}
public string AgentName
{
get { return _AgentName; }
set { _AgentName = value; this._SaveValue("AgentName", value); }
}
public string WMIHost
{
get { return _WMIHost; }
set { _WMIHost = value; this._SaveValue("WMIHost", value); }
}
public string WMIUser
{
get { return _WMIUser; }
set { _WMIUser = value; this._SaveValue("WMIUser", value); }
}
public string WMIPassword
{
get { return _WMIPassword; }
set { _WMIPassword = value; this._SaveValue("WMIPassword", value); }
}
public string WMIAuthority
{
get { return _WMIAuthority; }
set { _WMIAuthority = value; this._SaveValue("WMIAuthority", value); }
}
public LogLevel LogLevel
{
get { return _LogLevel; }
set { _LogLevel = value; this._SaveValue("LogLevel", (int) value); }
}
}
}

View File

@ -1,177 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
namespace OpenStack.Designate.MicrosoftDNS
{
// Exceptions
public class DNSServerException : ApplicationException
{
public DNSServerException(string message) : base(message)
{
Logging LOG = Logging.GetLogger();
LOG.Log(LogLevel.Critical, message);
}
}
// A DNS Server class that handles all access to a particular MSDNS Server
public class DNSServer
{
private ManagementScope _MgmtScope = null;
private ConfigManager _Config;
private Logging LOG;
public DNSServer(ConfigManager config)
{
LOG = Logging.GetLogger();
this._Config = config;
ConnectionOptions co = new ConnectionOptions();
co.Username = _Config.WMIUser;
co.Password = _Config.WMIPassword;
co.Authority = _Config.WMIAuthority;
this._MgmtScope = new ManagementScope(String.Format(@"\\{0}\Root\MicrosoftDNS", _Config.WMIHost), co);
}
public void Connect()
{
try
{
LOG.Log(LogLevel.Verbose, "Connecting to WMI on: " + this._MgmtScope.Path);
this._MgmtScope.Connect();
}
catch (ManagementException ex)
{
throw new DNSServerException("Failed to connect to WMI" + ex.Message);
}
finally
{
if (this._MgmtScope.IsConnected)
{
LOG.Log(LogLevel.Information, "Connected to WMI sucessfully");
}
else
{
LOG.Log(LogLevel.Error, "Failed to connect to WMI");
}
}
}
public class DNSZone
{
private ManagementObject _mgmtObject = null;
public DNSZone(ManagementObject mgmtObject)
{
this._mgmtObject = mgmtObject;
}
public string Name
{
get { return (string)this._mgmtObject["Name"]; }
set { this._mgmtObject["Name"] = value; }
}
public string[] MasterServers
{
get { return (string[])this._mgmtObject["MasterServers"]; }
set { this._mgmtObject["MasterServers"] = value; }
}
public void UpdateZone()
{
this._mgmtObject.Put();
}
public void DeleteZone()
{
try
{
this._mgmtObject.Delete();
}
catch (ManagementException)
{
throw new DNSServerException("Something EXPLODED");
}
}
}
public void CreateNewZone(string zoneName, string[] masters)
{
try
{
ManagementObject mc = new ManagementClass(this._MgmtScope, new ManagementPath("MicrosoftDNS_Zone"), null);
mc.Get();
ManagementBaseObject parameters = mc.GetMethodParameters("CreateZone");
parameters["ZoneName"] = zoneName;
parameters["IpAddr"] = masters;
parameters["ZoneType"] = 1; // 1 == Secondary
parameters["DsIntegrated"] = false;
mc.InvokeMethod("CreateZone", parameters, null);
}
catch (ManagementException ex)
{
throw new DNSServerException("Something EXPLODED: "+ ex.Message);
}
}
public DNSZone FetchZone(string zoneName)
{
try
{
if (zoneName[zoneName.Length-1] == '.')
zoneName = zoneName.Substring(0, zoneName.Length - 1);
string query = String.Format("SELECT * FROM MicrosoftDNS_Zone WHERE Name='{0}'", zoneName);
ManagementObjectSearcher s = new ManagementObjectSearcher(this._MgmtScope, new ObjectQuery(query));
DNSZone zone = null;
ManagementObjectCollection c = s.Get();
if (c.Count != 1)
{
throw new DNSServerException("Done Borked");
}
else
{
foreach (ManagementObject z in c)
{
zone = new DNSZone(z);
}
}
return zone;
}
catch (ManagementException)
{
throw new DNSServerException("Something EXPLODED");
}
}
public ManagementBaseObject ReturnValue { get; set; }
}
}

View File

@ -1,105 +0,0 @@
// Copyright 2014 Hewlett-Packard Development Company, L.P.
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenStack.Designate.MicrosoftDNS
{
[DataContract]
public class OsloMessagingEnvelope
{
[DataMember(Name = "oslo.version", IsRequired = true)]
public string OsloVersion;
[DataMember(Name = "oslo.message", IsRequired = true)]
public string OsloMessage;
}
[DataContract]
public class OsloMessagingReplyMessage
{
[DataMember(Name = "_msg_id", IsRequired = true)]
public string MessageId;
[DataMember(Name = "_unique_id", IsRequired = true)]
public string UniqueID;
[DataMember(Name = "failure", IsRequired = false)]
public string failure;
[DataMember(Name = "result", IsRequired = false)]
public string result;
[DataMember(Name = "ending", IsRequired = true)]
public bool ending;
}
[DataContract]
public class OsloMessagingMessage
{
[DataMember(Name = "method", IsRequired = true)]
public string Method;
[DataMember(Name = "_reply_q", IsRequired = true)]
public string ReplyQueue;
[DataMember(Name = "_msg_id", IsRequired = true)]
public string MessageId;
[DataMember(Name = "_unique_id", IsRequired = true)]
public string UniqueId;
[DataMember(Name = "args", IsRequired = true)]
public BackendCreateDomainArguments Args;
}
[DataContract]
public class BackendCreateDomainArguments
{
[DataMember(Name = "domain", IsRequired = false)]
public DesignateDomainObject Domain;
}
[DataContract]
public abstract class DesignateObject
{
[DataMember(Name = "designate_object.changes", IsRequired = true)]
public string[] Changes;
[DataMember(Name = "designate_object.name", IsRequired = true)]
public string Name;
[DataMember(Name = "designate_object.original_values", IsRequired = true)]
public Dictionary<string, object> OriginalValues;
}
[DataContract]
public class DesignateDomainObject : DesignateObject
{
[DataMember(Name = "designate_object.data", IsRequired = true)]
public DesignateDomainObjectData Data;
}
[DataContract]
public class DesignateDomainObjectData
{
[DataMember(Name = "id", IsRequired = true)]
public string ID;
[DataMember(Name = "name", IsRequired = true)]
public string Name;
}
}

View File

@ -1,107 +0,0 @@
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenStack.Designate.MicrosoftDNS
{
public enum LoggingContext
{
Console, EventLog
}
public enum LogLevel
{
Critical, Error, Warning, Information, Verbose
}
public class Logging
{
private static Logging _instance;
private LoggingContext context = LoggingContext.Console;
private ConfigManager _Config;
private EventLog _EventLog;
private Logging(LoggingContext context, ConfigManager config) {
this.context = context;
if (this.context == LoggingContext.EventLog)
{
this._EventLog = new System.Diagnostics.EventLog();
this._EventLog.Source = "Openstack Designate MSDNSAgent";
this._EventLog.Log = "Application";
if (!EventLog.SourceExists(this._EventLog.Source))
{
EventLog.CreateEventSource(this._EventLog.Source, this._EventLog.Log);
}
}
this._Config = config;
}
public static Logging GetLogger(LoggingContext context, ConfigManager config)
{
if (_instance == null)
{
_instance = new Logging(context, config);
}
return _instance;
}
public static Logging GetLogger()
{
if (_instance == null)
{
throw new NotImplementedException();
}
return _instance;
}
public void Log(LogLevel level, string message)
{
StackFrame callstack = new StackFrame(1);
string caller = "[" + callstack.GetMethod().Module + ":" + callstack.GetMethod().Name + "]";
string time = "[" + DateTime.Now.ToShortTimeString() + "]";
string level_ = "[" + level + "]";
if (this.context == LoggingContext.Console)
{
if (_Config.LogLevel >= level)
{
System.Console.WriteLine( time + " " + level_.PadLeft(13) + " " + caller.PadRight(65) + ":: " + message);
}
}
else if (this.context == LoggingContext.EventLog)
{
EventLogEntryType windowsLevel;
switch (level)
{
case LogLevel.Critical:
windowsLevel = EventLogEntryType.Error;
break;
case LogLevel.Error:
windowsLevel = EventLogEntryType.Error;
break;
case LogLevel.Warning:
windowsLevel = EventLogEntryType.Warning;
break;
case LogLevel.Information:
windowsLevel = EventLogEntryType.Information;
break;
case LogLevel.Verbose:
windowsLevel = EventLogEntryType.Information;
break;
default:
windowsLevel = EventLogEntryType.Information;
break;
}
this._EventLog.WriteEntry(caller + message, windowsLevel);
}
}
}
}

View File

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{ED42A619-DE66-4DF7-AB2A-F6C341833965}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenStack.Designate.MicrosoftDNS</RootNamespace>
<AssemblyName>OpenStack.Designate.MicrosoftDNS</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="RabbitMQ.Client, Version=3.3.5.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\RabbitMQ.Client.3.3.5\lib\net30\RabbitMQ.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="AgentConsumer.cs" />
<Compile Include="AgentConsumerHandler.cs" />
<Compile Include="DataContracts.cs" />
<Compile Include="ConfigManager.cs" />
<Compile Include="DNSManager.cs" />
<Compile Include="Logging.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenStack.Designate.MicrosoftDNS")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Hewlett-Packard")]
[assembly: AssemblyProduct("OpenStack.Designate.MicrosoftDNS")]
[assembly: AssemblyCopyright("Copyright © Hewlett-Packard 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("bfb985b1-b693-4842-a55e-1e0736b886e7")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RabbitMQ.Client" version="3.3.5" targetFramework="net45" />
</packages>

10
README.md Normal file
View File

@ -0,0 +1,10 @@
This project is no longer maintained.
The contents of this repository are still available in the Git
source code management system. To see the contents of this
repository before it reached its end of life, please check out the
previous commit with "git checkout HEAD^1".
For any further questions, please email
openstack-dev@lists.openstack.org or join #openstack-dns on
Freenode.

View File

@ -1,18 +0,0 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>CommandLineParser</id>
<version>1.9.71</version>
<title>Command Line Parser Library</title>
<authors>Giacomo Stelluti Scala</authors>
<owners>Giacomo Stelluti Scala</owners>
<licenseUrl>https://raw.github.com/gsscoder/commandline/master/doc/LICENSE</licenseUrl>
<projectUrl>https://github.com/gsscoder/commandline</projectUrl>
<iconUrl>https://github.com/gsscoder/commandline/raw/master/art/CommandLine.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>The Command Line Parser Library offers to CLR applications a clean and concise API for manipulating command line arguments and related tasks.</description>
<releaseNotes />
<copyright>Copyright (c) 2005 - 2013 Giacomo Stelluti Scala</copyright>
<tags>command line argument option parser parsing library syntax shell</tags>
</metadata>
</package>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +0,0 @@
Command Line Parser Library 1.9.71.2 stable
------------------------------------------
Giacomo Stelluti Scala
(gsscoder@gmail.com)
GitHub (Latest Sources, Updated Docs): https://github.com/gsscoder/commandline
Codeplex (Binary Downloads): http://commandline.codeplex.com/
Remarks:
- IParser and IParserSettings interface were removed.
Upgrading from < 1.9.6.1 rc1:
-----------------------------
Now CommandLine.Parser is defiend as:
interface CommandLine.Parser {
bool ParseArguments(string[] args, object options);
bool ParseArguments(string[] args, object options, Action<string, object> onVerbCommand);
bool ParseArgumentsStrict(string[] args, object options, Action onFail = null);
bool ParseArgumentsStrict(string[] args, object options, Action<string, object> onVerbCommand, Action onFail = null);
}
Please refer to wiki (https://github.com/gsscoder/commandline/wiki).
For help screen in verb command scenario use new HelpText::AutoBuild(object,string).
Upgrading from < 1.9.4.91 versions:
-----------------------------------
- Use System.Char for short name:
[Option('o', "my-option", DefaultValue=10, HelpText="This is an option!")]
public int MyOption { get; set; }
- Receive parsing errors without CommandLineOptionsBase (removed):
public class Options {
[ParserState]
public IParserState LastParserState { get; set; }
}
- Types rename:
MultiLineTextAttribute -> MultilineTextAttribute (first 'L' -> lowercase)
CommandLineParser -> Parser (suggestion: qualify with namespace -> CommandLine.Parser).
ICommandLineParser -> IParser
CommandLineParserSettings -> ParserSettings
CommandLineParserException -> ParserException
Upgrading from 1.8.* versions:
------------------------------
The major API change is that all attributes that inherits from BaseOptionAttribute now
apply only to properties. Fields are no longer supported.
Old Code:
---------
class Options {
[Option("o", "my-option", HelpText="This is an option!")]
public int MyOption = 10;
}
New Code:
---------
class Options {
[Option("o", "my-option", DefaultValue=10, HelpText="This is an option!")]
public int MyOption { get; set; }
}
As you can see I've added the new DefaultValue property to help you initialize properties.
Shortcut for Help Screen
------------------------
[HelpOption]
public string GetUsage()
{
return HelpText.AutoBuild(this,
(HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
}
Note:
-----
If you don't use mutually exclusive options, now there's a singleton built for common uses:
if (CommandLineParser.Default.ParseArguments(args, options)) {
// consume values here
}
Have fun!

View File

@ -1,17 +0,0 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>RabbitMQ.Client</id>
<version>3.3.5</version>
<title>RabbitMQ.Client</title>
<authors>Pivotal, joefitzgerald</authors>
<owners>Pivotal, joefitzgerald</owners>
<licenseUrl>http://www.rabbitmq.com/dotnet.html</licenseUrl>
<projectUrl>http://www.rabbitmq.com/dotnet.html</projectUrl>
<iconUrl>https://en.gravatar.com/userimage/10048884/0ea8846e080980f705da081be53599ce.png?size=100</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>The RabbitMQ .NET client is an implementation of an AMQP client library for C# (and, implicitly, other .NET languages), and a binding exposing AMQP services via Microsoft's Windows Communication Foundation (WCF).</description>
<language>en-US</language>
<tags>RabbitMQ Client AMQP SpringSource GoPivotal</tags>
</metadata>
</package>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\OpenStack.Designate.MicrosoftDNS.ConfigGUI\packages.config" />
<repository path="..\OpenStack.Designate.MicrosoftDNS.Console\packages.config" />
<repository path="..\OpenStack.Designate.MicrosoftDNS\packages.config" />
</repositories>