本文整理汇总了C#中Deployment类的典型用法代码示例。如果您正苦于以下问题:C# Deployment类的具体用法?C# Deployment怎么用?C# Deployment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Deployment类属于命名空间,在下文中一共展示了Deployment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SummaryInfo
/// <summary>
/// Creates a new instance of the <see cref="SummaryInfo"/> class copying values
/// from the <see cref="Deployment.WindowsInstaller.SummaryInfo"/> object.
/// </summary>
/// <param name="info">The <see cref="Deployment.WindowsInstaller.SummaryInfo"/> from which to copy values.</param>
/// <exception cref="ArgumentNullException">The parameter <paramref name="info"/> is null.</exception>
internal SummaryInfo(Deployment.WindowsInstaller.SummaryInfo info)
{
if (null == info)
{
throw new ArgumentNullException("info");
}
this.Author = info.Author;
this.CharacterCount = info.CharacterCount;
this.CodePage = info.CodePage;
this.Comments = info.Comments;
this.CreateTime = info.CreateTime;
this.CreatingApp = info.CreatingApp;
this.Keywords = info.Keywords;
this.LastPrintTime = info.LastPrintTime;
this.LastSavedBy = info.LastSavedBy;
this.LastSaveTime = info.LastSaveTime;
this.PageCount = info.PageCount;
this.RevisionNumber = info.RevisionNumber;
this.Security = info.Security;
this.Subject = info.Subject;
this.Template = info.Template;
this.Title = info.Title;
this.WordCount = info.WordCount;
}
开发者ID:heaths,项目名称:psmsi,代码行数:31,代码来源:SummaryInfo.cs
示例2: DeploymentStatusClientTests
public DeploymentStatusClientTests()
{
var github = Helper.GetAuthenticatedClient();
_deploymentsClient = github.Repository.Deployment;
_context = github.CreateRepositoryContext("public-repo").Result;
var blob = new NewBlob
{
Content = "Hello World!",
Encoding = EncodingType.Utf8
};
var blobResult = github.Git.Blob.Create(_context.RepositoryOwner, _context.RepositoryName, blob).Result;
var newTree = new NewTree();
newTree.Tree.Add(new NewTreeItem
{
Type = TreeType.Blob,
Mode = FileMode.File,
Path = "README.md",
Sha = blobResult.Sha
});
var treeResult = github.Git.Tree.Create(_context.RepositoryOwner, _context.RepositoryName, newTree).Result;
var newCommit = new NewCommit("test-commit", treeResult.Sha);
var commit = github.Git.Commit.Create(_context.RepositoryOwner, _context.RepositoryName, newCommit).Result;
var newDeployment = new NewDeployment(commit.Sha) { AutoMerge = false };
_deployment = _deploymentsClient.Create(_context.RepositoryOwner, _context.RepositoryName, newDeployment).Result;
}
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:32,代码来源:DeploymentStatusClientTests.cs
示例3: NameSpecifiedAndRoleInstanceListDoesNotHaveMatchingRoleInstanceInDeployment
public void NameSpecifiedAndRoleInstanceListDoesNotHaveMatchingRoleInstanceInDeployment()
{
var deployment = new Deployment
{
Url = AnyUrl(),
RoleInstanceList = new RoleInstanceList
{
new RoleInstance()
}
};
var winRmUri = new GetAzureWinRMUriStub(deployment)
{
Name = AnyString(),
CommandRuntime = mockCommandRuntime
};
try
{
winRmUri.ExecuteCommandBody();
Assert.Fail("Should never reach here.");
}
catch (ArgumentOutOfRangeException)
{
}
Assert.AreEqual(0, mockCommandRuntime.OutputPipeline.Count, "Nothing should be written to output pipeline");
}
开发者ID:Viachaslau,项目名称:azure-sdk-tools,代码行数:25,代码来源:GetAzureWinRMUriTests.cs
示例4: UpdateDeploymentSlofIfEmpty
Deployment UpdateDeploymentSlofIfEmpty(Deployment deployment)
{
if (string.IsNullOrEmpty(deployment.DeploymentSlot))
{
deployment.DeploymentSlot = this.Slot;
}
return deployment;
}
开发者ID:Viachaslau,项目名称:azure-sdk-tools,代码行数:8,代码来源:GetAzureDeployment.cs
示例5: DeployRelease
public static Deployment DeployRelease(this IOctopusSession session, Release release, DeploymentEnvironment environment, bool forceRedeploymentOfExistingPackages = false)
{
var deployment = new Deployment();
deployment.EnvironmentId = environment.Id;
deployment.ReleaseId = release.Id;
deployment.ForceRedeployment = forceRedeploymentOfExistingPackages;
return session.Create(release.Link("Deployments"), deployment);
}
开发者ID:robertbird,项目名称:Octopus-Tools,代码行数:9,代码来源:DeploymentExtensions.cs
示例6: KickItOutThereAlready
public static void KickItOutThereAlready(Deployment deployment, DeploymentArguments args)
{
_inspector = new DropkickDeploymentInspector(args.ServerMappings);
if (args.Role != "ALL") _inspector.RolesToGet(args.Role.Split(','));
var plan = _inspector.GetPlan(deployment);
//HOW TO PLUG IN args.Role
//TODO: should be able to block here
_actions[args.Command](plan);
}
开发者ID:GorelH,项目名称:dropkick,代码行数:12,代码来源:DeploymentPlanDispatcher.cs
示例7: KickItOutThereAlready
public static DeploymentResult KickItOutThereAlready(Deployment deployment, DeploymentArguments args)
{
_inspector = new DropkickDeploymentInspector(args.ServerMappings);
if (args.Role != "ALL") _inspector.RolesToGet(args.Role.Split(','));
var plan = _inspector.GetPlan(deployment);
plan.AbortOnError = args.AbortOnError;
//HOW TO PLUG IN args.Role
//TODO: should be able to block here
return plan.Run(args.Command);
}
开发者ID:Allon-Guralnek,项目名称:dropkick,代码行数:13,代码来源:DeploymentPlanDispatcher.cs
示例8: NoUrlInDeployment
//[TestMethod]
public void NoUrlInDeployment()
{
var deployment = new Deployment();
var winRmUri = new GetAzureWinRMUriStub(deployment)
{
CommandRuntime = mockCommandRuntime
};
try
{
winRmUri.ExecuteCommandBody();
Assert.Fail("Should throw argument out of range exception");
}
catch (ArgumentOutOfRangeException)
{
}
}
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:17,代码来源:GetAzureWinRMUriTests.cs
示例9: SelectTargetPortalDialog
public SelectTargetPortalDialog(Deployment deployment)
{
InitializeComponent();
var targetPortals = deployment.Targets
.SelectMany(target => target.Portals.Select(portal => new TargetPortalInfo(target, portal)))
.ToList();
cboTargetPortals.DataSource = targetPortals;
//default to last deployed target portal
if (_lastDeployedPortal != null)
{
var portalFromList = targetPortals.FirstOrDefault(portal => portal.TargetPortal == _lastDeployedPortal);
if (portalFromList != null)
cboTargetPortals.SelectedItem = portalFromList;
}
}
开发者ID:jboyce,项目名称:SLXToolsContrib,代码行数:18,代码来源:SelectTargetPortalDialog.cs
示例10: DeploymentStatusClientTests
public DeploymentStatusClientTests()
{
_gitHubClient = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
_deploymentsClient = _gitHubClient.Repository.Deployment;
var newRepository = new NewRepository
{
Name = Helper.MakeNameWithTimestamp("public-repo"),
AutoInit = true
};
_repository = _gitHubClient.Repository.Create(newRepository).Result;
_repositoryOwner = _repository.Owner.Login;
var blob = new NewBlob
{
Content = "Hello World!",
Encoding = EncodingType.Utf8
};
var blobResult = _gitHubClient.GitDatabase.Blob.Create(_repositoryOwner, _repository.Name, blob).Result;
var newTree = new NewTree();
newTree.Tree.Add(new NewTreeItem
{
Type = TreeType.Blob,
Mode = FileMode.File,
Path = "README.md",
Sha = blobResult.Sha
});
var treeResult = _gitHubClient.GitDatabase.Tree.Create(_repositoryOwner, _repository.Name, newTree).Result;
var newCommit = new NewCommit("test-commit", treeResult.Sha);
_commit = _gitHubClient.GitDatabase.Commit.Create(_repositoryOwner, _repository.Name, newCommit).Result;
var newDeployment = new NewDeployment { Ref = _commit.Sha };
_deployment = _deploymentsClient.Create(_repositoryOwner, _repository.Name, newDeployment).Result;
}
开发者ID:Therzok,项目名称:octokit.net,代码行数:42,代码来源:DeploymentStatusClientTests.cs
示例11: NameSpecifiedAndNoRoleInstanceListInDeployment
public void NameSpecifiedAndNoRoleInstanceListInDeployment()
{
var deployment = new Deployment
{
Url = AnyUrl()
};
var winRmUri = new GetAzureWinRMUriStub(deployment)
{
CommandRuntime = mockCommandRuntime,
Name = AnyString()
};
try
{
winRmUri.ExecuteCommandBody();
Assert.Fail("Should throw argument out of range exception");
}
catch (ArgumentOutOfRangeException)
{
}
}
开发者ID:Viachaslau,项目名称:azure-sdk-tools,代码行数:20,代码来源:GetAzureWinRMUriTests.cs
示例12: DeploymentInfoContext
public DeploymentInfoContext(Deployment innerDeployment)
{
this.innerDeployment = innerDeployment;
if (this.innerDeployment.RoleInstanceList != null)
{
this.RoleInstanceList = new List<AzureDeploymentCmdlets.Concrete.RoleInstance>();
foreach (var roleInstance in this.innerDeployment.RoleInstanceList)
{
this.RoleInstanceList.Add(new AzureDeploymentCmdlets.Concrete.RoleInstance(roleInstance));
}
}
if (!string.IsNullOrEmpty(this.innerDeployment.Configuration))
{
string xmlString = ServiceManagementHelper.DecodeFromBase64String(this.innerDeployment.Configuration);
XDocument doc = null;
using (var stringReader = new StringReader(xmlString))
{
XmlReader reader = XmlReader.Create(stringReader);
doc = XDocument.Load(reader);
}
this.OSVersion = doc.Root.Attribute("osVersion") != null ?
doc.Root.Attribute("osVersion").Value :
string.Empty;
this.RolesConfiguration = new Dictionary<string, RoleConfiguration>();
var roles = doc.Root.Descendants(this.ns + "Role");
foreach (var role in roles)
{
this.RolesConfiguration.Add(role.Attribute("name").Value, new RoleConfiguration(role));
}
}
}
开发者ID:calexan,项目名称:azure-sdk-tools,代码行数:38,代码来源:DeploymentInfoContext.cs
示例13: DeploymentStatusClientTests
public DeploymentStatusClientTests()
{
var gitHubClient = Helper.GetAuthenticatedClient();
_deploymentsClient = gitHubClient.Repository.Deployment;
var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo"))
{
AutoInit = true
};
_repository = gitHubClient.Repository.Create(newRepository).Result;
_repositoryOwner = _repository.Owner.Login;
var blob = new NewBlob
{
Content = "Hello World!",
Encoding = EncodingType.Utf8
};
var blobResult = gitHubClient.GitDatabase.Blob.Create(_repositoryOwner, _repository.Name, blob).Result;
var newTree = new NewTree();
newTree.Tree.Add(new NewTreeItem
{
Type = TreeType.Blob,
Mode = FileMode.File,
Path = "README.md",
Sha = blobResult.Sha
});
var treeResult = gitHubClient.GitDatabase.Tree.Create(_repositoryOwner, _repository.Name, newTree).Result;
var newCommit = new NewCommit("test-commit", treeResult.Sha);
var commit = gitHubClient.GitDatabase.Commit.Create(_repositoryOwner, _repository.Name, newCommit).Result;
var newDeployment = new NewDeployment(commit.Sha) { AutoMerge = false };
_deployment = _deploymentsClient.Create(_repositoryOwner, _repository.Name, newDeployment).Result;
}
开发者ID:cH40z-Lord,项目名称:octokit.net,代码行数:37,代码来源:DeploymentStatusClientTests.cs
示例14: GetStatus
public string GetStatus(string serviceName, string slot)
{
Deployment deployment = new Deployment();
try
{
InvokeInOperationContext(() =>
{
deployment = this.RetryCall<Deployment>(s => this.Channel.GetDeploymentBySlot(s, serviceName, slot));
});
}
catch (ServiceManagementClientException ex)
{
if(ex.HttpStatus == HttpStatusCode.NotFound)
{
throw new EndpointNotFoundException(string.Format(Resources.ServiceSlotDoesNotExist, slot, serviceName));
}
}
return deployment.Status;
}
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:21,代码来源:GetDeploymentStatus.cs
示例15: NewAzureVMProcess
public void NewAzureVMProcess()
{
SubscriptionData currentSubscription = this.GetCurrentSubscription();
CloudStorageAccount currentStorage = null;
try
{
currentStorage = currentSubscription.GetCurrentStorageAccount(Channel);
}
catch (EndpointNotFoundException) // couldn't access
{
throw new ArgumentException("CurrentStorageAccount is not accessible. Ensure the current storage account is accessible and in the same location or affinity group as your cloud service.");
}
if (currentStorage == null) // not set
{
throw new ArgumentException("CurrentStorageAccount is not set. Use Set-AzureSubscription subname -CurrentStorageAccount storageaccount to set it.");
}
var vm = new PersistentVMRole
{
AvailabilitySetName = AvailabilitySetName,
ConfigurationSets = new Collection<ConfigurationSet>(),
DataVirtualHardDisks = new Collection<DataVirtualHardDisk>(),
RoleName = String.IsNullOrEmpty(Name) ? ServiceName : Name, // default like the portal
RoleSize = String.IsNullOrEmpty(InstanceSize) ? null : InstanceSize,
RoleType = "PersistentVMRole",
Label = ServiceManagementHelper.EncodeToBase64String(ServiceName)
};
vm.OSVirtualHardDisk = new OSVirtualHardDisk()
{
DiskName = null,
SourceImageName = ImageName,
MediaLink = string.IsNullOrEmpty(MediaLocation) ? null : new Uri(MediaLocation),
HostCaching = HostCaching
};
if (vm.OSVirtualHardDisk.MediaLink == null && String.IsNullOrEmpty(vm.OSVirtualHardDisk.DiskName))
{
DateTime dtCreated = DateTime.Now;
string vhdname = String.Format("{0}-{1}-{2}-{3}-{4}-{5}.vhd", this.ServiceName, vm.RoleName, dtCreated.Year, dtCreated.Month, dtCreated.Day, dtCreated.Millisecond);
string blobEndpoint = currentStorage.BlobEndpoint.AbsoluteUri;
if (blobEndpoint.EndsWith("/") == false)
blobEndpoint += "/";
vm.OSVirtualHardDisk.MediaLink = new Uri(blobEndpoint + "vhds/" + vhdname);
}
NetworkConfigurationSet netConfig = new NetworkConfigurationSet();
netConfig.InputEndpoints = new Collection<InputEndpoint>();
if (SubnetNames != null)
{
netConfig.SubnetNames = new SubnetNamesCollection();
foreach (string subnet in SubnetNames)
{
netConfig.SubnetNames.Add(subnet);
}
}
if (ParameterSetName.Equals("Windows", StringComparison.OrdinalIgnoreCase))
{
WindowsProvisioningConfigurationSet windowsConfig = new WindowsProvisioningConfigurationSet
{
AdminPassword = Password,
ComputerName = string.IsNullOrEmpty(Name) ? ServiceName : Name,
EnableAutomaticUpdates = true,
ResetPasswordOnFirstLogon = false,
StoredCertificateSettings = Certificates
};
InputEndpoint rdpEndpoint = new InputEndpoint { LocalPort = 3389, Protocol = "tcp", Name = "RemoteDesktop" };
netConfig.InputEndpoints.Add(rdpEndpoint);
vm.ConfigurationSets.Add(windowsConfig);
vm.ConfigurationSets.Add(netConfig);
}
else
{
LinuxProvisioningConfigurationSet linuxConfig = new LinuxProvisioningConfigurationSet();
linuxConfig.HostName = string.IsNullOrEmpty(this.Name) ? this.ServiceName : this.Name;
linuxConfig.UserName = this.LinuxUser;
linuxConfig.UserPassword = this.Password;
linuxConfig.DisableSshPasswordAuthentication = false;
if (this.SSHKeyPairs != null && this.SSHKeyPairs.Count > 0 || this.SSHPublicKeys != null && this.SSHPublicKeys.Count > 0)
{
linuxConfig.SSH = new LinuxProvisioningConfigurationSet.SSHSettings();
linuxConfig.SSH.PublicKeys = this.SSHPublicKeys;
linuxConfig.SSH.KeyPairs = this.SSHKeyPairs;
}
InputEndpoint rdpEndpoint = new InputEndpoint();
rdpEndpoint.LocalPort = 22;
rdpEndpoint.Protocol = "tcp";
rdpEndpoint.Name = "SSH";
netConfig.InputEndpoints.Add(rdpEndpoint);
vm.ConfigurationSets.Add(linuxConfig);
vm.ConfigurationSets.Add(netConfig);
}
string CreateCloudServiceOperationID = String.Empty;
string CreateDeploymentOperationID = String.Empty;
//.........这里部分代码省略.........
开发者ID:bielawb,项目名称:azure-sdk-tools,代码行数:101,代码来源:NewAzureQuickVM.cs
示例16: VerifyDeployment
/// <summary>
/// Verify a deployment exists
/// </summary>
/// <param name="serviceName"></param>
/// <param name="slot"></param>
private void VerifyDeployment()
{
try
{
SafeWriteObjectWithTimestamp(Resources.PublishStartingMessage);
SafeWriteObjectWithTimestamp(Resources.PublishInitializingMessage);
Dictionary<string, RoleInstance> roleInstanceSnapshot = new Dictionary<string, RoleInstance>();
// Continue polling for deployment until all of the roles
// indicate they're ready
Deployment deployment = new Deployment();
do
{
deployment = RetryCall(subscription =>
Channel.GetDeploymentBySlot(
subscription,
_hostedServiceName,
_deploymentSettings.ServiceSettings.Slot));
// The goal of this loop is to output a message whenever the status of a role
// instance CHANGES. To do that, we have to remember the last status of all role instances
// and that's what the roleInstanceSnapshot array is for
foreach (RoleInstance currentInstance in deployment.RoleInstanceList)
{
// We only care about these three statuses, ignore other intermediate statuses
if (String.Equals(currentInstance.InstanceStatus, RoleInstanceStatus.Busy) ||
String.Equals(currentInstance.InstanceStatus, RoleInstanceStatus.Ready) ||
String.Equals(currentInstance.InstanceStatus, RoleInstanceStatus.Initializing))
{
bool createdOrChanged = false;
// InstanceName is unique and concatenates the role name and instance name
if (roleInstanceSnapshot.ContainsKey(currentInstance.InstanceName))
{
// If we already have a snapshot of that role instance, update it
RoleInstance previousInstance = roleInstanceSnapshot[currentInstance.InstanceName];
if (!String.Equals(previousInstance.InstanceStatus, currentInstance.InstanceStatus))
{
// If the instance status changed, we need to output a message
previousInstance.InstanceStatus = currentInstance.InstanceStatus;
createdOrChanged = true;
}
}
else
{
// If this is the first time we run through, we also need to output a message
roleInstanceSnapshot[currentInstance.InstanceName] = currentInstance;
createdOrChanged = true;
}
if (createdOrChanged)
{
string statusResource;
switch (currentInstance.InstanceStatus)
{
case RoleInstanceStatus.Busy:
statusResource = Resources.PublishInstanceStatusBusy;
break;
case RoleInstanceStatus.Ready:
statusResource = Resources.PublishInstanceStatusReady;
break;
default:
statusResource = Resources.PublishInstanceStatusCreating;
break;
}
SafeWriteObjectWithTimestamp(String.Format(Resources.PublishInstanceStatusMessage,
currentInstance.InstanceName, currentInstance.RoleName, statusResource));
}
}
}
// If a deployment has many roles to initialize, this
// thread must throttle requests so the Azure portal
// doesn't reply with a "too many requests" error
Thread.Sleep(int.Parse(Resources.StandardRetryDelayInMs));
}
while (deployment.RoleInstanceList.Any(
r => r.InstanceStatus != RoleInstanceStatus.Ready));
if (CanGenerateUrlForDeploymentSlot())
{
SafeWriteObjectWithTimestamp(
Resources.PublishCreatedWebsiteMessage,
string.Format(Resources.ServiceUrl, _hostedServiceName));
}
else
{
SafeWriteObjectWithTimestamp(
Resources.PublishCreatedWebsiteLaunchNotSupportedMessage);
}
//.........这里部分代码省略.........
开发者ID:calexan,项目名称:azure-sdk-tools,代码行数:101,代码来源:PublishAzureService.cs
示例17: NewAzureVMProcess
public void NewAzureVMProcess()
{
SubscriptionData currentSubscription = this.GetCurrentSubscription();
CloudStorageAccount currentStorage = null;
try
{
currentStorage = CloudStorageAccountFactory.GetCurrentCloudStorageAccount(Channel, currentSubscription);
}
catch (ServiceManagementClientException) // couldn't access
{
throw new ArgumentException("CurrentStorageAccount is not accessible. Ensure the current storage account is accessible and in the same location or affinity group as your cloud service.");
}
if (currentStorage == null) // not set
{
throw new ArgumentException("CurrentStorageAccount is not set. Use Set-AzureSubscription subname -CurrentStorageAccount storage account to set it.");
}
Operation lastOperation = null;
using (new OperationContextScope(Channel.ToContextChannel()))
{
try
{
if (this.ParameterSetName.Equals("CreateService", StringComparison.OrdinalIgnoreCase) == true)
{
var chsi = new CreateHostedServiceInput
{
AffinityGroup = this.AffinityGroup,
Location = this.Location,
ServiceName = this.ServiceName,
Description = this.ServiceDescription ??
String.Format("Implicitly created hosted service{0}",DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd HH:mm")),
Label = this.ServiceLabel ?? this.ServiceName
};
ExecuteClientAction(chsi, CommandRuntime + " - Create Cloud Service", s => this.Channel.CreateHostedService(s, chsi));
}
}
catch (ServiceManagementClientException ex)
{
this.WriteErrorDetails(ex);
return;
}
}
if (lastOperation != null && string.Compare(lastOperation.Status, OperationState.Failed, StringComparison.OrdinalIgnoreCase) == 0)
{
return;
}
foreach (var vm in VMs)
{
var configuration = vm.ConfigurationSets.OfType<WindowsProvisioningConfigurationSet>().FirstOrDefault();
if (configuration != null)
{
if (vm.WinRMCertificate != null)
{
if(!CertUtils.HasExportablePrivateKey(vm.WinRMCertificate))
{
throw new ArgumentException("WinRMCertificate needs to have an exportable private key.");
}
var operationDescription = string.Format("{0} - Uploading WinRMCertificate: {1}", CommandRuntime, vm.WinRMCertificate.Thumbprint);
var certificateFile = CertUtils.Create(vm.WinRMCertificate);
ExecuteClientActionInOCS(null, operationDescription, s => this.Channel.AddCertificates(s, this.ServiceName, certificateFile));
}
var certificateFilesWithThumbprint = from c in vm.X509Certificates
select new
{
c.Thumbprint,
CertificateFile = CertUtils.Create(c, vm.NoExportPrivateKey)
};
foreach (var current in certificateFilesWithThumbprint.ToList())
{
var operationDescription = string.Format("{0} - Uploading Certificate: {1}", CommandRuntime, current.Thumbprint);
ExecuteClientActionInOCS(null, operationDescription, s => this.Channel.AddCertificates(s, this.ServiceName, current.CertificateFile));
}
}
}
var persistentVMs = this.VMs.Select(vm => CreatePersistenVMRole(vm, currentStorage)).ToList();
// If the current deployment doesn't exist set it create it
if (CurrentDeployment == null)
{
using (new OperationContextScope(Channel.ToContextChannel()))
{
try
{
var deployment = new Deployment
{
DeploymentSlot = "Production",
Name = this.DeploymentName ?? this.ServiceName,
Label = this.DeploymentLabel ?? this.ServiceName,
RoleList = new RoleList(new List<Role> { persistentVMs[0] }),
VirtualNetworkName = this.VNetName
};
if (this.DnsSettings != null)
{
//.........这里部分代码省略.........
开发者ID:bryanhunter,项目名称:azure-sdk-tools,代码行数:101,代码来源:NewAzureVM.cs
示例18: AddToDeployment
public void AddToDeployment(Deployment deployment)
{
base.AddObject("Deployment", deployment);
}
开发者ID:peterschen,项目名称:SMAStudio,代码行数:4,代码来源:Reference.cs
示例19: VerifyDeployment
private void VerifyDeployment(PublishContext context)
{
try
{
WriteVerboseWithTimestamp(Resources.PublishInitializingMessage);
Dictionary<string, RoleInstance> roleInstanceSnapshot = new Dictionary<string, RoleInstance>();
// Continue polling for deployment until all of the roles
// indicate they're ready
Deployment deployment = new Deployment();
do
{
deployment = ServiceManagementChannel.GetDeploymentBySlot(
subscriptionId,
context.ServiceName,
context.ServiceSettings.Slot);
// The goal of this loop is to output a message whenever the status of a role
// instance CHANGES. To do that, we have to remember the last status of all role instances
// and that's what the roleInstanceSnapshot array is for
foreach (RoleInstance currentInstance in deployment.RoleInstanceList)
{
// We only care about these three statuses, ignore other intermediate statuses
if (string.Equals(currentInstance.InstanceStatus, RoleInstanceStatus.BusyRole) ||
string.Equals(currentInstance.InstanceStatus, RoleInstanceStatus.ReadyRole) ||
string.Equals(currentInstance.InstanceStatus, RoleInstanceStatus.CreatingRole))
{
bool createdOrChanged = false;
// InstanceName is unique and concatenates the role name and instance name
if (roleInstanceSnapshot.ContainsKey(currentInstance.InstanceName))
{
// If we already have a snapshot of that role instance, update it
RoleInstance previousInstance = roleInstanceSnapshot[currentInstance.InstanceName];
if (!string.Equals(previousInstance.InstanceStatus, currentInstance.InstanceStatus))
{
// If the instance status changed, we need to output a message
previousInstance.InstanceStatus = currentInstance.InstanceStatus;
createdOrChanged = true;
}
}
else
{
// If this is the first time we run through, we also need to output a message
roleInstanceSnapshot[currentInstance.InstanceName] = currentInstance;
createdOrChanged = true;
}
if (createdOrChanged)
{
string statusResource;
switch (currentInstance.InstanceStatus)
{
case RoleInstanceStatus.BusyRole:
statusResource = Resources.PublishInstanceStatusBusy;
break;
case RoleInstanceStatus.ReadyRole:
statusResource = Resources.PublishInstanceStatusReady;
break;
default:
statusResource = Resources.PublishInstanceStatusCreating;
break;
}
WriteVerboseWithTimestamp(
Resources.PublishInstanceStatusMessage,
currentInstance.InstanceName,
currentInstance.RoleName,
statusResource);
}
}
}
// If a deployment has many roles to initialize, this
// thread must throttle requests so the Azure portal
// doesn't reply with a "too many requests" error
Thread.Sleep(SleepDuration);
}
while (deployment.RoleInstanceList.Any(r => r.InstanceStatus != RoleInstanceStatus.ReadyRole));
WriteVerboseWithTimestamp(Resources.PublishCreatedWebsiteMessage, deployment.Url);
}
catch (ServiceManagementClientException)
{
throw new InvalidOperationException(
string.Format(Resources.CannotFindDeployment, context.ServiceName, context.ServiceSettings.Slot));
}
}
开发者ID:xmbms,项目名称:azure-sdk-tools,代码行数:92,代码来源:CloudServiceClient.cs
示例20: GetAzureWinRMUriStub
public GetAzureWinRMUriStub(Deployment currentDeployment)
{
this.CurrentDeployment = currentDeployment;
}
开发者ID:Viachaslau,项目名称:azure-sdk-tools,代码行数:4,代码来源:GetAzureWinRMUriTests.cs
注:本文中的Deployment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论