Ejemplo n.º 1
0
        /// <name>get</name>
        /// <summary>
        /// Gets meta-information of the current API.
        /// </summary>
        /// <returns cref="ApiInfo">If successful, this method returns a <see cref="ApiInfo"/> resource in the response body.</returns>
        public JObject Get()
        {
            var apiInfo = new ApiInfo
            {
                ApiVersion = Version.ApiVersion,
                ServerTimestamp = _timestampRepository.GetCurrentTimestamp(),
                WebSocketServerUrl = ConfigurationManager.AppSettings["WebSocketServerUrl"]
            };

            return Mapper.Map(apiInfo);
        }
        public JObject Get()
        {
            var webSocketEndpoint = DeviceHiveConfiguration.WebSocketEndpoint;
            var apiInfo = new ApiInfo
            {
                ApiVersion = Version.ApiVersion,
                ServerTimestamp = _timestampRepository.GetCurrentTimestamp(),
                WebSocketServerUrl = webSocketEndpoint.Enabled ? webSocketEndpoint.Url : null,
            };

            return Mapper.Map(apiInfo);
        }
        public void ServerInfo()
        {
            var restEndpoint = DeviceHiveConfiguration.RestEndpoint;
            var apiInfo = new ApiInfo
            {
                ApiVersion = DeviceHive.Core.Version.ApiVersion,
                ServerTimestamp = DataContext.Timestamp.GetCurrentTimestamp(),
                RestServerUrl = restEndpoint.Uri,
            };

            SendResponse(new JProperty("info", GetMapper<ApiInfo>().Map(apiInfo)));
        }