//ShutdownVirtualMachineRoleAsync
        //RestartVirtualMachineRoleAsync
        //StartVirtualMachineRoleAsync
        //UpdateVirtualMachineRoleAsync
        public Task<string> CreateVirtualMachineDeploymentAsync(string cloudServiceName, string deploymentName, string deploymentLabel, PersistentVMRole vmRole, CancellationToken token = default(CancellationToken))
        {
            CreateVirtualMachineDeploymentInfo info = CreateVirtualMachineDeploymentInfo.Create(deploymentName, deploymentLabel, vmRole);

            HttpRequestMessage message = CreateBaseMessage(HttpMethod.Post, CreateTargetUri(UriFormatStrings.Deployments, cloudServiceName), info);

            return StartSendTask(message, token);
        }
コード例 #2
0
 internal static CreateVirtualMachineDeploymentInfo Create(string deploymentName, string deploymentLabel, PersistentVMRole vmRole)
 {
     //TODO: Validate params
     return new CreateVirtualMachineDeploymentInfo
     {
         Name = deploymentName,
         Label = deploymentLabel.EncodeBase64(),
         RoleList = new List<Role> { vmRole },
         _deploymentSlot = DeploymentSlot.Production
     };
 }