本文整理汇总了C#中DeploymentSlot类的典型用法代码示例。如果您正苦于以下问题:C# DeploymentSlot类的具体用法?C# DeploymentSlot怎么用?C# DeploymentSlot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeploymentSlot类属于命名空间,在下文中一共展示了DeploymentSlot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: CreateDeploymentCommand
/// <summary>
/// Constructs a command to create a deployment to a particular cloud service
/// </summary>
/// <param name="serviceName">the name of the cloud service</param>
/// <param name="deploymentName">The name of the deployment</param>
/// <param name="packageUri">The blob store and endpoint address where the package has been uploaded to</param>
/// <param name="config">The base64 encoded config of .cscfg file</param>
/// <param name="slot">The deployment slot - can be production or staging</param>
/// <param name="startDeployment">an optional parameter which defaults to true as to whether the deployment should be started when complete</param>
/// <param name="treatWarningsAsErrors">an optional parameter set to false - any warnings (such as SLA or config violations) will be treated as an error and stop the deployment</param>
internal CreateDeploymentCommand(string serviceName, string deploymentName, string packageUri, string config,
DeploymentSlot slot, bool startDeployment = true,
bool treatWarningsAsErrors = false)
{
OperationId = "hostedservices";
ServiceType = "services";
Name = serviceName;
DeploymentSlot = slot;
DeploymentName = deploymentName;
PackageUri = packageUri;
Config = config;
HttpCommand = Name + "/deploymentslots/" + slot.ToString().ToLower();
StartDeploymentAutomatically = startDeployment;
TreatWarningsAsErrors = treatWarningsAsErrors;
}
开发者ID:RonnyA,项目名称:fluent-management,代码行数:25,代码来源:CreateDeploymentCommand.cs
示例17: VerifyDeploymentExists
private void VerifyDeploymentExists(HostedServiceGetDetailedResponse cloudService, DeploymentSlot slot)
{
bool exists = false;
if (cloudService.Deployments != null)
{
exists = cloudService.Deployments.Any(d => d.DeploymentSlot == slot );
}
if (!exists)
{
throw new Exception(string.Format(Resources.CannotFindDeployment, cloudService.ServiceName, slot));
}
}
开发者ID:ranjitk9,项目名称:azure-sdk-tools,代码行数:15,代码来源:CloudServiceClient.cs
示例18: GetAzureDeyploymentAsync
/// <summary>
/// Gets the AzureDeployment for a specifc slot on a cloud service.
/// </summary>
/// <param name="client">The <see cref="ComputeManagementClient"/> that is performing the operation.</param>
/// <param name="serviceName">The name of the cloud service.</param>
/// <param name="slot">The name of the Cloud Service slot.</param>
/// <returns>The cloud service deployment.</returns>
public static async Task<DeploymentGetResponse> GetAzureDeyploymentAsync(this ComputeManagementClient client, string serviceName, DeploymentSlot slot)
{
Contract.Requires(client != null);
try
{
return await client.Deployments.GetBySlotAsync(serviceName, slot);
}
catch (CloudException cex)
{
if (cex.Error.Code == "ResourceNotFound")
{
return null;
}
throw;
}
}
开发者ID:BenLBartle,项目名称:devopsflex,代码行数:25,代码来源:ComputeManagementClientExtensions.cs
示例19: CreateDeployment
/// <summary>
/// Create hosted service deployment
/// </summary>
/// <param name="hostedServiceName"></param>
/// <param name="input"></param>
/// <param name="deploymentSlot"></param>
/// <returns></returns>
public DeploymentGetResponse CreateDeployment(string hostedServiceName, DeploymentCreateParameters input,
DeploymentSlot deploymentSlot = DeploymentSlot.Production)
{
TestEasyLog.Instance.Info(string.Format("Creating Deployment... Name: '{0}', Label: '{1}'", input.Name, input.Label));
ComputeManagementClient.Deployments.CreateAsync(hostedServiceName,
deploymentSlot,
input,
new CancellationToken()).Wait();
var result = GetDeployment(hostedServiceName, input.Name);
Dependencies.TestResourcesCollector.Remember(
AzureResourceType.Deployment,
result.Name,
new DeploymentInfo { Deployment = result, HostedService = hostedServiceName });
return result;
}
开发者ID:zhiliangxu,项目名称:TestEasy,代码行数:26,代码来源:AzureCloudServiceManager.cs
示例20: WalkUpgradeDomainAsync
/// <summary>
/// Begins an asychronous operation to upgrade a particular domain in a manual deployment upgrade or configuration change.
/// </summary>
/// <param name="cloudServiceName">The name of the cloud service which contains the deployment to upgrade.</param>
/// <param name="slot">The <see cref="DeploymentSlot"/> which contains the deployment to upgrade.</param>
/// <param name="upgradeDomain">In integer representing the particular upgrade domain to upgrade.</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>WalkUpgradeDomainAsync is a long-running asynchronous operation. When the Task representing WalkUpgradeDomainAsync 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 WalkUpgradeDomainAsync <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> WalkUpgradeDomainAsync(string cloudServiceName, DeploymentSlot slot, int upgradeDomain, CancellationToken token = default(CancellationToken))
{
Validation.ValidateStringArg(cloudServiceName, "cloudServiceName");
WalkUpgradeDomainInfo info = WalkUpgradeDomainInfo.Create(upgradeDomain);
HttpRequestMessage message = CreateBaseMessage(HttpMethod.Post, CreateTargetUri(UriFormatStrings.DeploymentSlotWalkUpgradeDomain, cloudServiceName, slot.ToString()), info);
return StartSendTask(message, token);
}
开发者ID:tquinn86,项目名称:azure-sdk-for-net,代码行数:22,代码来源:AzureHttpClient.CloudServiceOperations.cs
注:本文中的DeploymentSlot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论