#region License Information /* HeuristicLab * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Net; using System.Xml.Linq; namespace HeuristicLab.Clients.Hive.CloudManager.Azure { public static class Constants { #region HeuristicLab public const string HLSlaveRoleName = "HeuristicLab.Clients.Hive.Slave.AzureClient"; #endregion #region Service Management Versioning // see: http://msdn.microsoft.com/en-us/library/windowsazure/gg592580.aspx public const string APIVersionDefault = APIVersion20111001; public const string APIVersion20111001 = "2011-10-01"; public const string APIVersion20110225 = "2011-02-25"; public const string APIVersion20110818 = "2011-08-18"; #endregion #region Namespaces public static XNamespace NSWindowsAzure { get { return "http://schemas.microsoft.com/windowsazure"; } } public static XNamespace NSSchemaMicrosoft { get { return "http://schemas.microsoft.com/"; } } public static XNamespace NSServiceConfiguration { get { return "http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration"; } } #endregion #region Web Request public const string HeaderRequestId = "x-ms-request-id"; public const string HeaderVersionName = "x-ms-version"; public const string ContentTypeAppXml = "application/xml"; public const string HttpMethodPOST = "POST"; public const string HttpMethodGET = "GET"; public const string HttpMethodDELETE = "DELETE"; #endregion #region Service Management URIs // see: http://msdn.microsoft.com/en-us/library/ee460786.aspx public const string URISubscriptionFormat = "https://management.core.windows.net/{0}"; public const string URIHostedServiceFormat = "https://management.core.windows.net/{0}/services/hostedservices"; public const string URISpecificHostedServiceFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}"; public const string URIStorageServiceFormat = "https://management.core.windows.net/{0}/services/storageservices"; public const string URISpecificStorageServiceFormat = "https://management.core.windows.net/{0}/services/storageservices/{1}"; public const string URIStorageServiceKeys = "https://management.core.windows.net/{0}/services/storageservices/{1}/keys"; public const string URILocationsFormat = "https://management.core.windows.net/{0}/locations"; public const string URIAffinityGroupFormat = "https://management.core.windows.net/{0}/affinitygroups"; public const string URICertificateFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}/certificates"; public const string URIDeploymentFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}/deploymentslots/{2}"; public const string URISpecificDeploymentFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}/deployments/{2}"; public const string URIDeploymentConfigurationFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}/deploymentslots/{2}/?comp=config"; public const string URISpecificDeploymentConfigurationFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}/deployments/{2}/?comp=config"; public const string URIChangeDeploymentStatusFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}/deployments/{2}/?comp=status"; public const string URIGetOperationStatusFormat = "https://management.core.windows.net/{0}/operations/{1}"; #endregion #region Connection Strings public const string StorageServiceConnectionFormat = "AccountName={0};AccountKey={1};DefaultEndpointsProtocol=https"; #endregion #region Deployment public const string DeploymentSlotStaging = "staging"; public const string DeploymentSlotProduction = "production"; public const string DeploymentPackageUrl = "https://hivestorage.blob.core.windows.net/hiveslave/HeuristicLab.Clients.Hive.Slave.Azure.cspkg"; public const string DeploymentConfigurationUrl = "https://hivestorage.blob.core.windows.net/hiveslave/ServiceConfiguration.Cloud.cscfg"; public const string DeploymentLabel = "HeuristicLab.Hive.Slave"; public const string DeploymentRoleName = "HeuristicLab.Clients.Hive.Slave.AzureClient"; public const string DeploymentConfigurationPath = "PackageFiles/ServiceConfiguration.Cloud.cscfg"; public const string DeploymentPackagePathSmall = "PackageFiles/HeuristicLab.Clients.Hive.Slave.Azure.Small.cspkg"; public const string DeploymentPackagePathMedium = "PackageFiles/HeuristicLab.Clients.Hive.Slave.Azure.Medium.cspkg"; public const string DeploymentPackagePathLarge = "PackageFiles/HeuristicLab.Clients.Hive.Slave.Azure.Large.cspkg"; public const string DeploymentPackagePathExtraLarge = "PackageFiles/HeuristicLab.Clients.Hive.Slave.Azure.ExtraLarge.cspkg"; #endregion #region Enums public enum InstanceSize { ExtraSmall = 0, Small = 1, Medium = 2, Large = 4, ExtraLarge = 8 } public enum OperationStatus { InProgress, Failed, Succeeded, TimedOut } #endregion #region Structs public struct OperationResult { public Constants.OperationStatus Status { get; set; } public HttpStatusCode StatusCode { get; set; } public TimeSpan RunningTime { get; set; } public string Code { get; set; } public string Message { get; set; } } #endregion } }