private async Task QueryApplicationsByIdAsync()
        {
            Skip.If(!_fixture.RegistrationOk);
            foreach (var application in _applicationTestSet)
            {
                var response = await _applicationsDatabase.QueryApplicationsByIdAsync(0, 0, null, null, 0, null, null, QueryApplicationState.Any);

                Assert.NotNull(response);
            }
        }
        public async Task <QueryApplicationsByIdResponseApiModel> QueryApplicationsByIdAsync(
            [FromBody] QueryApplicationsByIdApiModel query)
        {
            if (query == null)
            {
                // query all
                query = new QueryApplicationsByIdApiModel(0, 0, null, null, 0, null, null, null);
            }
            var result = await _applicationDatabase.QueryApplicationsByIdAsync(
                query.StartingRecordId,
                query.MaxRecordsToReturn,
                query.ApplicationName,
                query.ApplicationUri,
                (uint)query.ApplicationType,
                query.ProductUri,
                query.ServerCapabilities,
                (Types.QueryApplicationState?) query.ApplicationState
                );

            return(new QueryApplicationsByIdResponseApiModel(result));
        }
示例#3
0
        public async Task <StatusApiModel> GetStatusAsync()
        {
            bool   applicationOk;
            string applicationMessage = "Alive and well";

            try
            {
                var apps = await _applicationDatabase.QueryApplicationsByIdAsync(0, 1, null, null, 0, null, null, Types.QueryApplicationState.Any);

                applicationOk = apps != null;
            }
            catch (Exception ex)
            {
                applicationOk      = false;
                applicationMessage = ex.Message;
            }
            this._log.Information("Service status application database", new { Healthy = applicationOk, Message = applicationMessage });

            bool   kvOk;
            string kvMessage = "Alive and well";

            try
            {
                var groups = await _certificateGroups.GetCertificateGroupIds();

                kvOk      = groups.Length > 0;
                kvMessage = String.Join(",", groups);
            }
            catch (Exception ex)
            {
                kvOk      = false;
                kvMessage = ex.Message;
            }
            this._log.Information("Service status OpcVault", new { Healthy = kvOk, Message = kvMessage });

            return(new StatusApiModel(applicationOk, applicationMessage, kvOk, kvMessage));
        }