当前位置: 首页>>代码示例>>C#>>正文


C# DeploymentSlot类代码示例

本文整理汇总了C#中DeploymentSlot的典型用法代码示例。如果您正苦于以下问题:C# DeploymentSlot类的具体用法?C# DeploymentSlot怎么用?C# DeploymentSlot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DeploymentSlot类属于命名空间,在下文中一共展示了DeploymentSlot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetAzureDeyployment

 /// <summary>
 /// Returns a list of Deployment objects for a given subscription
 /// </summary>
 /// <param name="serviceName">The name of the cloud service</param>
 /// <param name="slot">The slot being either Production or Staging</param>
 /// <returns></returns>
 protected DeploymentGetResponse GetAzureDeyployment(string serviceName, DeploymentSlot slot)
 {
     ComputeManagementClient client = new ComputeManagementClient(MyCloudCredentials);
     try
     {
         try
         {
             return client.Deployments.GetBySlot(serviceName, slot);
         }
         catch (CloudException ex)
         {
             if (ex.ErrorCode == "ResourceNotFound")
             {
                 Logger.Warn(ex, String.Format("Resource not found during retrieval of Deployment object for service: {0}, {1}", serviceName, ex.ErrorCode));
                 return null;
             }
             else
             {
                 Logger.Warn(ex, String.Format("Exception during retrieval of Deployment objects for the service: {0}, Errorcode: {1}", serviceName, ex.ErrorCode));
                 return null;
             }
         }
     }
     catch (Exception e)
     {
         Logger.Warn(e, String.Format("Exception during retrieval of Deployment objects for the service: {0}", serviceName));
         return null;
     }
 }
开发者ID:netflakes,项目名称:AzureManagement,代码行数:35,代码来源:AzureManagement.cs

示例2: RoleContextManager

 /// <summary>
 /// Used to create a role context
 /// </summary>
 internal RoleContextManager(string subscriptionId, X509Certificate2 certificate, string serviceName, DeploymentSlot slot)
 {
     SubscriptionId = subscriptionId;
     ManagementCertificate = certificate;
     ServiceName = serviceName;
     DeploymentSlot = slot;
 }
开发者ID:wenming,项目名称:fluent-management,代码行数:10,代码来源:RoleContextManager.cs

示例3: UpdateRoleStatusCommand

 /// <summary>
 /// Constructs a command to create an update to the status of a role
 /// </summary>
 internal UpdateRoleStatusCommand(string serviceName, DeploymentSlot slot, UpdateDeploymentStatus status)
 {
     OperationId = "hostedservices";
     ServiceType = "services";
     HttpCommand = serviceName + "/deploymentslots/" + slot.ToString().ToLower() + "/?comp=status";
     Status = status;
 }
开发者ID:azurecoder,项目名称:fluent-management,代码行数:10,代码来源:UpdateRoleStatusCommand.cs

示例4: ServiceClient

 /// <summary>
 /// Used to construct the ServiceClient
 /// </summary>
 public ServiceClient(string subscriptionId, X509Certificate2 certificate, string cloudService, DeploymentSlot slot = DeploymentSlot.Production)
 {
     SubscriptionId = subscriptionId;
     ManagementCertificate = certificate;
     Name = cloudService;
     Slot = slot;
 }
开发者ID:krist00fer,项目名称:fluent-management,代码行数:10,代码来源:ServiceClient.cs

示例5: GetConfiguration

        public XDocument GetConfiguration(SubscriptionCloudCredentials credentials, string serviceName, DeploymentSlot slot)
        {
            using (var client = CloudContext.Clients.CreateComputeManagementClient(credentials))
            {
                try
                {
                    var response = client.Deployments.GetBySlot(serviceName, slot);

                    if (response.StatusCode != HttpStatusCode.OK)
                    {
                        throw new Exception(string.Format("Getting deployment by slot returned HTTP Status Code: {0}",
                            response.StatusCode));
                    }

                    return string.IsNullOrEmpty(response.Configuration)
                        ? null
                        : XDocument.Parse(response.Configuration);
                }
                catch (CloudException cloudException)
                {
                    Log.VerboseFormat("Getting deployments for service '{0}', slot {1}, returned:\n{2}", serviceName, slot.ToString(), cloudException.Message);
                    return null;
                }
            }
        }
开发者ID:bjewell52,项目名称:Calamari,代码行数:25,代码来源:AzureCloudServiceConfigurationRetriever.cs

示例6: GetHostedServiceContainsDeploymentCommand

 /// <summary>
 /// Constructs a GetHostedServiceList command
 /// </summary>
 internal GetHostedServiceContainsDeploymentCommand(string serviceName, DeploymentSlot slot = DeploymentSlot.Production)
 {
     OperationId = "hostedservices";
     ServiceType = "services";
     HttpCommand = (HostedServiceName = serviceName) + "/deploymentslots/" + slot.ToString().ToLower();
     HttpVerb = HttpVerbGet;
 }
开发者ID:RonnyA,项目名称:fluent-management,代码行数:10,代码来源:GetHostedServiceContainsDeploymentCommand.cs

示例7: GetAggregateDeploymentStatusCommand

 /// <summary>
 /// Used to create an instance of GetAggregateDeploymentStatusCommand
 /// </summary>
 //https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deploymentslots/<deployment-slot>
 internal GetAggregateDeploymentStatusCommand(string hostedServiceName, DeploymentSlot slot)
 {
     OperationId = "hostedservices";
     ServiceType = "services";
     HttpCommand = (HostedServiceName = hostedServiceName) + "/deploymentslots/" + slot.ToString().ToLower();
     HttpVerb = HttpVerbGet;
 }
开发者ID:RonnyA,项目名称:fluent-management,代码行数:11,代码来源:GetAggregateDeploymentStatusCommand.cs

示例8: ChangeDeploymentConfiguration

 public virtual async Task<OperationResponse> ChangeDeploymentConfiguration(XDocument serviceConfiguration, DeploymentSlot slot = DeploymentSlot.Production)
 {
     return await ChangeDeploymentConfiguration(new DeploymentChangeConfigurationParameters
     {
         Configuration = serviceConfiguration.ToString(),
         Mode = DeploymentChangeConfigurationMode.Auto,
     }, slot);
 }
开发者ID:farukc,项目名称:Dash,代码行数:8,代码来源:AzureServiceManagementClient.cs

示例9: DeleteDeploymentCommand

 // https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deploymentslots/<deployment-slot>
 /// <summary>
 /// Constructs a service deployment delete command with a given name and slot 
 /// </summary>
 /// <param name="serviceName">The name of the service which is being swept for deployments</param>
 /// <param name="slot">The deployment slot used can be production or staging</param>
 internal DeleteDeploymentCommand(string serviceName, DeploymentSlot slot)
 {
     Name = serviceName;
     DeploymentSlot = slot;
     HttpVerb = HttpVerbDelete;
     HttpCommand = Name + "/deploymentslots/" + slot.ToString().ToLower();
     ServiceType = "services";
     OperationId = "hostedservices";
 }
开发者ID:RonnyA,项目名称:fluent-management,代码行数:15,代码来源:DeleteDeploymentCommand.cs

示例10: GetDeploymenConfigurationCommand

 /// <summary>
 /// Constructs a GetHostedServiceList command
 /// </summary>
 // https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deploymentslots/<deployment-slot>
 internal GetDeploymenConfigurationCommand(string serviceName, DeploymentSlot slot = DeploymentSlot.Production)
 {
     // need to increment the version in this request otherwise will not be able to check vm instances
     AdditionalHeaders["x-ms-version"] = "2012-03-01";
     OperationId = "hostedservices";
     ServiceType = "services";
     HttpCommand = (HostedServiceName = serviceName) + "/deploymentslots/" + slot.ToString().ToLower();
     HttpVerb = HttpVerbGet;
 }
开发者ID:RonnyA,项目名称:fluent-management,代码行数:13,代码来源:GetDeploymentConfigurationCommand.cs

示例11: SetDeploymenConfigurationCommand

 /// <summary>
 /// Constructs a SetDeploymenConfigurationCommand command
 /// </summary>
 // POST https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deploymentslots/<deployment-slot>/?comp=config
 internal SetDeploymenConfigurationCommand(string serviceName, CscfgFile config, DeploymentSlot slot = DeploymentSlot.Production)
 {
     // need to increment the version in this request otherwise will not be able to check vm instances
     AdditionalHeaders["x-ms-version"] = "2012-03-01";
     OperationId = "hostedservices";
     ServiceType = "services";
     HttpCommand = (CloudServiceName = serviceName) + "/deploymentslots/" + (Slot = slot).ToString().ToLower() + "/?comp=config";
     Configuration = config;
     HttpVerb = HttpVerbPost;
 }
开发者ID:wenming,项目名称:fluent-management,代码行数:14,代码来源:SetDeploymentConfigurationCommand.cs

示例12: GetRoleStatusCommand

 /// <summary>
 /// Used to create an instance of GetRoleStatusCommand
 /// </summary>
 //https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deploymentslots/<deployment-slot>
 internal GetRoleStatusCommand(string hostedServiceName, string roleName, DeploymentSlot slot)
 {
     OperationId = "hostedservices";
     ServiceType = "services";
     HttpCommand = (HostedServiceName = hostedServiceName) + "/deploymentslots/" + slot.ToString().ToLower();
     ;
     HttpVerb = HttpVerbGet;
     RoleName = roleName;
     Slot = slot;
 }
开发者ID:RonnyA,项目名称:fluent-management,代码行数:14,代码来源:GetRoleStatusCommand.cs

示例13: Deployment

        public Deployment(string deploymentName, DeploymentSlot deploymentSlot, ServiceConfiguration serviceConfig)
            : this()
        {
            Contract.Requires(deploymentName != null);
            Contract.Requires(serviceConfig != null);

            Name = Label = deploymentName;
            Slot = deploymentSlot;
            Configuration = serviceConfig;
        }
开发者ID:jamesmiles,项目名称:API,代码行数:10,代码来源:Deployment.cs

示例14: ChangeDeploymentConfigurationAsync

        /// <summary>
        /// Begins an asychronous operation to change the configuration of a deployment.
        /// </summary>
        /// <param name="cloudServiceName">The name of the cloud service which contains the deployment with the configuration to be changed. Required.</param>
        /// <param name="slot">The <see cref="DeploymentSlot"/> which contains the deployment with the configuration to be changed.</param>
        /// <param name="configFilePath">The local file path to the Azure deployment configuration file (.cscfg) defining the deployment. Required.</param>
        /// <param name="treatWarningsAsError">Set to true to treat configuation warnings as errors and fail the configuration change. Default is false.</param>
        /// <param name="mode">The <see cref="UpgradeType"/> value indicating whether the configuation change should happen automatically (<see cref="UpgradeType.Auto"/> or
        /// manually (<see cref="UpgradeType.Manual"/>. If set to <see cref="UpgradeType.Manual"/>, you must subsequently call <see cref="WalkUpgradeDomainAsync"/> to
        /// control the configuration change across the deployment.</param>
        /// <param name="extendedProperties">An optional <see cref="IDictionary{String, String}"/> that contains Name Value pairs representing user defined metadata for the deployment.</param>
        /// <param name="token">An optional <see cref="CancellationToken"/>.</param>
        /// <returns>A <see cref="Task"/> which returns a string representing the operation Id for this operation.</returns>
        /// <remarks>ChangeDeploymentConfigurationAsync is a long-running asynchronous operation. When the Task representing ChangeDeploymentConfigurationAsync is complete,
        /// without throwing an exception, this indicates that the operation as been accepted by the server, but has not completed. To track progress of
        /// the long-running operation use the operation Id returned from the ChangeDeploymentConfigurationAsync <see cref="Task"/> in calls to <see cref="GetOperationStatusAsync"/>
        /// until it returns either <see cref="OperationStatus.Succeeded"/> or <see cref="OperationStatus.Failed"/>.</remarks>
        public Task<string> ChangeDeploymentConfigurationAsync(string cloudServiceName, DeploymentSlot slot, string configFilePath, bool treatWarningsAsError = false, UpgradeType mode = UpgradeType.Auto, IDictionary<string, string> extendedProperties = null, CancellationToken token = default(CancellationToken))
        {
            Validation.ValidateStringArg(cloudServiceName, "cloudServiceName");

            //this validates the other parameters...
            ChangeDeploymentConfigurationInfo info = ChangeDeploymentConfigurationInfo.Create(configFilePath, treatWarningsAsError, mode, extendedProperties);

            HttpRequestMessage message = CreateBaseMessage(HttpMethod.Post, CreateTargetUri(UriFormatStrings.DeploymentSlotChangeConfig, cloudServiceName, slot.ToString()), info);

            return StartSendTask(message, token);
        }
开发者ID:tquinn86,项目名称:azure-sdk-for-net,代码行数:28,代码来源:AzureHttpClient.CloudServiceOperations.cs

示例15: GetRoleInstanceCount

        public Task<int> GetRoleInstanceCount(string serviceName, string roleName, DeploymentSlot deploymentSlot, CancellationToken cancellationToken)
        {
            var client = HttpClientFactory.Create(_subscriptionId, _certificate);
            var completionSource = new TaskCompletionSource<int>();

            DoGetDeploymentConfiguration(client, serviceName, deploymentSlot, cancellationToken).ContinuePropagateWith(
                completionSource, cancellationToken,
                queryTask => completionSource.TrySetResult(Int32.Parse(GetInstanceCountConfigElement(queryTask.Result, roleName).Value)));

            completionSource.Task.ContinueRaiseSystemEventOnFault(_observer, EventForFailedOperation);

            return completionSource.Task;
        }
开发者ID:TeamKnowledge,项目名称:lokad-cloud-provisioning,代码行数:13,代码来源:AzureProvisioning.cs


注:本文中的DeploymentSlot类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。