예제 #1
0
        public void GetAssetTypes()
        {
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
            var client  = new RestClient(XmlHelper.GetKey("read"));
            var request = _commonAPIFunctions.RequestBuilder(token);

            request.AddJsonBody(new { query = "query{assetTypes(language:\"en\") {description label id roles(language:\"en\") {description label id}}}" });

            _eomApiPoco.response = client.Execute(request);
        }
예제 #2
0
        public void LoadSOM()
        {
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
            var client  = new RestClient(XmlHelper.GetKey("mutation"));
            var request = _commonAPIFunctions.RequestBuilder(token);

            request.AddJsonBody(new { query = "mutation{loadSOM(customerId:\"" + XmlHelper.GetKey("CustomerID") + "\", customerType:\"hce-cb\")}" });

            _eomApiPoco.response = client.Execute(request);
        }
        public void AssignEnum(string pointId)
        {
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
            var client  = new RestClient(XmlHelper.GetKey("mutation"));
            var request = _commonAPIFunctions.RequestBuilder(token);

            Console.WriteLine("EomApiPoco.pointGUID[Int32.Parse(pointId)]-->{0}", EomApiPoco.pointGUID[Int32.Parse(pointId)]);
            string requestPayload = "mutation{ assignEnumsToPoint(point: \"" + EomApiPoco.pointGUID[Int32.Parse(pointId)] + "\", assignEnums:[\"" + XmlHelper.GetKey("EnumID") + "\"])}";

            Console.WriteLine("requestPayload-->{0}", requestPayload);
            request.AddJsonBody(new { query = "mutation{ assignEnumsToPoint(point: \"" + EomApiPoco.pointGUID[Int32.Parse(pointId)] + "\", assignEnums:[\"" + XmlHelper.GetKey("EnumID") + "\"])}" });
            _eomApiPoco.response = client.Execute(request);
        }
예제 #4
0
        public void CreatePoint(string name, string unit, string pointId, string label, string desc)
        {
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
            var client  = new RestClient(XmlHelper.GetKey("mutation"));
            var request = _commonAPIFunctions.RequestBuilder(token);

            request.AddJsonBody(new { query = "mutation{\n  createPoint(point: {\n  name:\"" + name + "\"\n  unit:\"" + unit + "\"\n  pointId:\"" + pointId + "\"   \n  labels:[{\n    value:\"" + label + "\"\n    language:\"EN\"\n  }]\n  descriptions:[{\n  value:\"" + desc + "\"\n  language:\"EN\"\n  }]\n  })\n}" });
            _eomApiPoco.response = client.Execute(request);
        }