public void ServiceImpactedChildren()
        {
            //Assumes that service 217 has an active relationship
            Startup.LoadSettings();
            var Impact = new ImpactedServiceKeyWeb();
            var key    = new ServiceKeyWeb();

            key.ServiceID     = 217;
            key.Date          = DateTime.Now;
            key.Attributes    = new AttributeInstanceWeb[1];
            key.ChildServices = new ServiceNamedCollectionWeb[0];
            key.IsValid       = true;
            var attr = new AttributeInstanceWeb();

            attr.Name = "CoS Allocation Type";
            attr.Type = "Text";
            var value = new AttributeChoiceWeb();

            value.Value              = "Multiple COS";
            attr.Value               = value;
            key.Attributes[0]        = attr;
            Impact.Key               = key;
            Impact.ChangedAttributes = new List <string> {
                "Peak Information Rate", "eBGP Remote Peer ASN"
            };
            var url = FscApplication.Current.Settings.FscUrls.FSCMediation + MediationEndPoints.serviceImpactedChildren;
            var Imp = ApiClient.Post <List <long>, ImpactedServiceKeyWeb>
                          (HttpTargetType.FSCMediation, "FSC Mediation Service Impacted children", url, Impact, ApiClient.ContentType.Json, ApiClient.HeaderType.FSCMediation);

            Assert.IsNotNull(Imp);
            Assert.IsTrue(Imp.Count > 0);
        }
Exemple #2
0
 public ObjectResult ImpactedRelatoinships(ImpactedServiceKeyWeb postData)
 {
     return(WebFunction.Execute <ImpactedServiceKeyWeb, ServiceRelationshipWeb[]>(this, postData, (si) =>
     {
         var key = new ServiceKey(si.Key);
         var rel = ServiceRelationships.GetImpactedRelationhips(key, si.ChangedAttributes).ToList().ToArray();
         return new WebResult <ServiceRelationshipWeb[]>(rel.Select(i => i.ToWeb()).ToArray());
     }));
 }
Exemple #3
0
 public ObjectResult ImpactAttributes(ImpactedServiceKeyWeb postData)
 {
     return(WebFunction.Execute <ImpactedServiceKeyWeb, ImpactAttributes>(this, postData, (k) =>
     {
         var key = new ServiceKey(k.Key);
         var impactAttributes = ServiceAttributes.GetImpactAttributes(key, k.ChangedAttributes);
         return new WebResult <ImpactAttributes>(impactAttributes);
     }));
 }
Exemple #4
0
 public ObjectResult ImpactedChildren(ImpactedServiceKeyWeb postData)
 {
     return(WebFunction.Execute <ImpactedServiceKeyWeb, List <long> >(this, postData, (k) =>
     {
         var key = new ServiceKey(k.Key);
         var children = ServiceHierarchy.GetImpactedChildren(key, k.ChangedAttributes);
         return new WebResult <List <long> >(children);
     }));
 }
        public void ServiceImpacts()
        {
            //Assumes that service 217 has no impacts
            Startup.LoadSettings();
            var Impact = new ImpactedServiceKeyWeb();
            var key    = new ServiceKeyWeb();

            key.ServiceID            = 217;
            key.Date                 = DateTime.Now;
            key.Attributes           = new AttributeInstanceWeb[0];
            key.ChildServices        = new ServiceNamedCollectionWeb[0];
            key.IsValid              = true;
            Impact.Key               = key;
            Impact.ChangedAttributes = new List <string> {
                "Peak Information Rate", "eBGP Remote Peer ASN"
            };
            var url = FscApplication.Current.Settings.FscUrls.FSCMediation + MediationEndPoints.serviceImpacts;
            var Imp = ApiClient.Post <ImpactAttributes, ImpactedServiceKeyWeb>
                          (HttpTargetType.FSCMediation, "FSC Mediation Service Impacts", url, Impact, ApiClient.ContentType.Json, ApiClient.HeaderType.FSCMediation);

            Assert.IsNotNull(Imp);
            Assert.IsTrue(Imp.Impacts.Count == 0);
        }