/// <summary>
        /// Converts from an API object to a PowerShell object
        /// </summary>
        /// <param name="s">The object to transform</param>
        /// <returns>The converted edition Service Level Objective capability model</returns>
        private ServiceObjectiveCapabilityModel CreateSupportedSLOModel(Management.Sql.Models.ServiceObjectiveCapability s)
        {
            ServiceObjectiveCapabilityModel slo = new ServiceObjectiveCapabilityModel();

            slo.Id = s.Id;
            slo.ServiceObjectiveName = s.Name;
            slo.Status            = s.Status;
            slo.SupportedMaxSizes = s.SupportedMaxSizes.Select(m => { return(CreateSupportedMaxSizeModel(m)); }).ToList();

            return(slo);
        }
示例#2
0
        /// <summary>
        /// Converts from an API object to a PowerShell object
        /// </summary>
        /// <param name="s">The object to transform</param>
        /// <returns>The converted edition Service Level Objective capability model</returns>
        private ServiceObjectiveCapabilityModel CreateSupportedSLOModel(Management.Sql.Models.ServiceObjectiveCapability s)
        {
            ServiceObjectiveCapabilityModel slo = new ServiceObjectiveCapabilityModel();

            slo.Id = s.Id;
            slo.ServiceObjectiveName = s.Name;
            slo.Status = s.Status.ToString();

            // Vcore service objectives don't have supported max sizes, they have max size ranges
            if (s.SupportedMaxSizes != null)
            {
                slo.SupportedMaxSizes = s.SupportedMaxSizes.Select(CreateSupportedMaxSizeModel).ToList();
            }

            return(slo);
        }
示例#3
0
 /// <summary>
 /// Gets the string formatting of the service objective object
 /// </summary>
 /// <param name="baseString">The prefix before the service objective information</param>
 /// <param name="objective">The service objective information to append</param>
 /// <returns>The formatted string containing the service objective information</returns>
 private string GetServiceObjectiveInformation(string baseString, ServiceObjectiveCapabilityModel objective)
 {
     return(string.Format("{0} -> Service Objective: {1} ({2})", baseString, objective.ServiceObjectiveName, objective.Status));
 }