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


C# CloudServiceProject.SetRoleVMSize方法代码示例

本文整理汇总了C#中Microsoft.WindowsAzure.Commands.Utilities.CloudService.CloudServiceProject.SetRoleVMSize方法的典型用法代码示例。如果您正苦于以下问题:C# CloudServiceProject.SetRoleVMSize方法的具体用法?C# CloudServiceProject.SetRoleVMSize怎么用?C# CloudServiceProject.SetRoleVMSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.WindowsAzure.Commands.Utilities.CloudService.CloudServiceProject的用法示例。


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

示例1: SetAzureVMSizeProcessTestsNodeRoleNameDoesNotExistServiceContainsWebRoleFail

        public void SetAzureVMSizeProcessTestsNodeRoleNameDoesNotExistServiceContainsWebRoleFail()
        {
            string roleName = "WebRole1";
            string invalidRoleName = "foo";

            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                CloudServiceProject service = new CloudServiceProject(files.RootPath, serviceName, null);
                service.AddWebRole(Test.Utilities.Common.Data.NodeWebRoleScaffoldingPath, roleName, 1);
                Testing.AssertThrows<ArgumentException>(() => service.SetRoleVMSize(service.Paths, invalidRoleName, "Large"), string.Format(Resources.RoleNotFoundMessage, invalidRoleName));
            }
        }
开发者ID:Indhukrishna,项目名称:azure-powershell,代码行数:12,代码来源:SetAzureVMSizeTests.cs

示例2: SetAzureVMSizeProcessTestsNullRoleNameFail

 public void SetAzureVMSizeProcessTestsNullRoleNameFail()
 {
     using (FileSystemHelper files = new FileSystemHelper(this))
     {
         CloudServiceProject service = new CloudServiceProject(files.RootPath, serviceName, null);
         Testing.AssertThrows<ArgumentException>(() => service.SetRoleVMSize(service.Paths, null, "Large"), string.Format(Resources.InvalidOrEmptyArgumentMessage, Resources.RoleName));
     }
 }
开发者ID:Indhukrishna,项目名称:azure-powershell,代码行数:8,代码来源:SetAzureVMSizeTests.cs

示例3: SetAzureVMSizeProcessTestsRoleNameDoesNotExistFail

        public void SetAzureVMSizeProcessTestsRoleNameDoesNotExistFail()
        {
            string roleName = "WebRole1";

            using (FileSystemHelper files = new FileSystemHelper(this))
            {
                CloudServiceProject service = new CloudServiceProject(files.RootPath, serviceName, null);
                Testing.AssertThrows<ArgumentException>(() => service.SetRoleVMSize(service.Paths, roleName, "Medium"), string.Format(Resources.RoleNotFoundMessage, roleName));
            }
        }
开发者ID:Indhukrishna,项目名称:azure-powershell,代码行数:10,代码来源:SetAzureVMSizeTests.cs

示例4: SetAzureVMSizeProcess

        /// <summary>
        /// Sets the VM size of the role.
        /// </summary>
        /// <param name="roleName">The role name</param>
        /// <param name="vmSize">The vm size</param>
        /// <param name="rootPath">The service root path</param>
        /// <returns>Role after updating VM size</returns>
        public RoleSettings SetAzureVMSizeProcess(string roleName, string vmSize, string rootPath)
        {
            CloudServiceProject service = new CloudServiceProject(rootPath, null);
            service.SetRoleVMSize(service.Paths, roleName, vmSize);

            if (PassThru)
            {
                SafeWriteOutputPSObject(typeof(RoleSettings).FullName, Parameters.RoleName, roleName);
            }

            return service.Components.GetCloudConfigRole(roleName);
        }
开发者ID:FrankSiegemund,项目名称:azure-powershell,代码行数:19,代码来源:SetAzureServiceProjectRole.cs


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