示例#1
0
        internal string GetGatewayProject(M2MgoCloudAgentConfiguration config, UicProject project)
        {
            return(_userTokenWebApiWrapper.RetryWithTokenUpdate(config, () => {
                var request =
                    (HttpWebRequest)WebRequest.Create(config.BaseUrl + "api/gatewayProject/" +
                                                      project.CustomerForeignKey.ToString("D") + "/" +
                                                      config.SgetGatewayTypeId.ToString("D") + "/" + project.ProjectKey);
                request.Method = "GET";

                string executeRequest = _webApiRequestExecutor.ExecuteRequest(request, string.Empty, _userTokenWebApiWrapper.GetToken(), _logger);
                return executeRequest;
            }));
        }
        internal BlueprintDto[] SearchBlueprint(M2MgoCloudAgentConfiguration config, Guid domainId, string deviceTypePattern)
        {
            if (deviceTypePattern == null)
            {
                throw new ArgumentNullException("deviceTypePattern");
            }

            string result = _userTokenWebApiWrapper.RetryWithTokenUpdate(config, () =>
            {
                var request =
                    (HttpWebRequest)WebRequest.Create(config.BaseUrl + "api/devicetype/search/" +
                                                      domainId.ToString("D") + "/" + deviceTypePattern);
                request.Method = "GET";
                return(result = _webApiRequestExecutor.ExecuteRequest(request, string.Empty, _userTokenWebApiWrapper.GetToken(), _logger));
            });

            return(_serializer.Deserialize <BlueprintDto[]>(result));
        }