Ejemplo n.º 1
0
 void PopulateFromXml(XElement element)
 {
     element.HydrateObject(XmlNamespaces.WindowsAzure, this);
     Slot = (DeploymentSlot)Enum.Parse(typeof(DeploymentSlot), (string)element.Element(XmlNamespaces.WindowsAzure + "DeploymentSlot"), true);
     if (!string.IsNullOrEmpty(Label)) Label = Label.FromBase64String();
     Configuration = new ServiceConfiguration(XElement.Parse(element.Element(XmlNamespaces.WindowsAzure + "Configuration").Value.FromBase64String()));
 }
Ejemplo n.º 2
0
        internal StorageAccount(XElement xml, Subscription subscription)
            : this()
        {
            var azureNamespace = XmlNamespaces.WindowsAzure;

            xml.HydrateObject(azureNamespace, this);
            Subscription = subscription;

            var storageServicePropertiesElement = xml.Element(azureNamespace + "StorageServiceProperties");
            storageServicePropertiesElement.HydrateObject(azureNamespace, this);

            if (!string.IsNullOrEmpty(Label)) Label = Label.FromBase64String();

            var extendedProperties = xml.Element(azureNamespace + "ExtendedProperties");
            if (extendedProperties != null)
            {
                ExtendedProperties = extendedProperties.Elements()
                    .ToDictionary(
                        x => (string) x.Element(azureNamespace + "Name"),
                        x => (string) x.Element(azureNamespace + "Value"));
            }

            Endpoints = GetEndpoints(storageServicePropertiesElement, azureNamespace, "Endpoints");
            SecondaryEndpoints = GetEndpoints(storageServicePropertiesElement, azureNamespace, "SecondaryEndpoints");
        }
Ejemplo n.º 3
0
 internal TrafficManagerProfile(XElement xml, Subscription subscription) : this()
 {
     var ns = XmlNamespaces.WindowsAzure;
     xml.HydrateObject(ns, this);
     Enabled = (string) xml.Element(ns + "Status") != "Disabled";
     Subscription = subscription;
 }
Ejemplo n.º 4
0
        internal ExtensionImageVersion(XElement xml)
        {
            var azureNamespace = XmlNamespaces.WindowsAzure;

            xml.HydrateObject(azureNamespace, this);

            PublicConfigurationSchema = PublicConfigurationSchema.FromBase64String();
            PrivateConfigurationSchema = PrivateConfigurationSchema.FromBase64String();
            SampleConfig = SampleConfig.FromBase64String();
        }
Ejemplo n.º 5
0
        internal ReservedIp(XElement xml, Subscription subscription)
        {
            Contract.Requires(Subscription == null);
            Contract.Requires(subscription != null);

            var azureNamespace = XmlNamespaces.WindowsAzure;

            xml.HydrateObject(azureNamespace, this);
            Subscription = subscription;
        }
Ejemplo n.º 6
0
        public Extension(XElement xml, CloudService parent)
        {
            Contract.Requires(parent != null);

            xml.HydrateObject(XmlNamespaces.WindowsAzure, this);

            PublicConfiguration = PublicConfiguration.FromBase64String();
            PrivateConfiguration = PrivateConfiguration.FromBase64String();
            
            Parent = parent;
        }
Ejemplo n.º 7
0
        internal AvailableExtensionImage(XElement xml, Subscription subscription)
        {
            Subscription = subscription;
            var azureNamespace = XmlNamespaces.WindowsAzure;

            xml.HydrateObject(azureNamespace, this);

            PublicConfigurationSchema = PublicConfigurationSchema.FromBase64String();
            PrivateConfigurationSchema = PrivateConfigurationSchema.FromBase64String();
            SampleConfig = SampleConfig.FromBase64String();

            Versions = new LatentSequence<ExtensionImageVersion>(GetExtensionImageVersionsAsync);
        }
Ejemplo n.º 8
0
 internal FirewallRule(XElement xml, DatabaseServer parent)
 {
     Parent = parent;
     xml.HydrateObject(XmlNamespaces.WindowsAzure, this);
     var startIpAddressElement = xml.Element(XmlNamespaces.WindowsAzure + "StartIPAddress");
     if (startIpAddressElement != null)
     {
         StartIpAddress = startIpAddressElement.Value;
     }
     var endIpAddressElement = xml.Element(XmlNamespaces.WindowsAzure + "EndIPAddress");
     if (endIpAddressElement != null)
     {
         EndIpAddress = endIpAddressElement.Value;
     }
 }
Ejemplo n.º 9
0
        internal Location(XElement xml, Subscription subscription)
        {
            Contract.Requires(Subscription == null);
            Contract.Requires(subscription != null);

            var azureNamespace = XmlNamespaces.WindowsAzure;

            xml.HydrateObject(azureNamespace, this);
            Subscription = subscription;

            var computeCapabilitiesElement = xml.Element(azureNamespace + "ComputeCapabilities");

            AvailableServices = GetAvailableServices(xml, azureNamespace);
            WebWorkerRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "WebWorkerRoleSizes");
            VirtualMachinesRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "VirtualMachinesRoleSizes");
        }
Ejemplo n.º 10
0
        internal AffinityGroup(XElement xml, Subscription subscription)
        {
            Contract.Requires(Subscription == null);
            Contract.Requires(subscription != null);

            var azureNamespace = XmlNamespaces.WindowsAzure;

            xml.HydrateObject(azureNamespace, this);
            Subscription = subscription;

            if (!string.IsNullOrEmpty(Label))
            {
                Label = Label.FromBase64String();
            }

            var computeCapabilitiesElement = xml.Element(azureNamespace + "ComputeCapabilities");

            Capabilities = GetCapabilities(xml, azureNamespace);
            WebWorkerRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "WebWorkerRoleSizes");
            VirtualMachinesRoleSizes = GetRoleSizes(computeCapabilitiesElement, azureNamespace, "VirtualMachinesRoleSizes");
        }
Ejemplo n.º 11
0
 internal FirewallRule(XElement xml, DatabaseServer parent)
 {
     Parent = parent;
     xml.HydrateObject(XmlNamespaces.SqlAzure, this);
 }
Ejemplo n.º 12
0
 internal Database(XElement xml, DatabaseServer databaseServer)
 {
     xml.HydrateObject(XmlNamespaces.WindowsAzure, this);
     DatabaseServer = databaseServer;
 }
Ejemplo n.º 13
0
 internal DatabaseServer(XElement xml, Subscription subscription) : this()
 {
     xml.HydrateObject(XmlNamespaces.SqlAzure, this);
     Subscription = subscription;
 }
Ejemplo n.º 14
0
 internal TrafficManagerHttpOptions(XElement xml)
 {
     xml.HydrateObject(XmlNamespaces.WindowsAzure, this);
 }
Ejemplo n.º 15
0
 internal TrafficManagerMonitor(XElement xml)
 {
     var ns = XmlNamespaces.WindowsAzure;
     xml.HydrateObject(ns, this);
     HttpOptions = new TrafficManagerHttpOptions(xml.Element(ns + "HttpOptions"));
 }
Ejemplo n.º 16
0
 internal RoleInstance(XElement element, Deployment parent)
 {
     element.HydrateObject(XmlNamespaces.WindowsAzure, this);
     Parent = parent;
 }
Ejemplo n.º 17
0
 internal TrafficManagerPolicy(XElement xml)
 {
     var ns = XmlNamespaces.WindowsAzure;
     xml.HydrateObject(ns, this);
     EndPoints = xml.Element(ns + "Endpoints").Elements(ns + "Endpoint").Select(xe => new TrafficManagerEndpoint(xe)).ToList();
 }