public async Task <ListResponse <UsageMetrics> > GetMetricsForPipelineModuleAsync(string instanceId, string pipelineModuleId, ListRequest request, EntityHeader org, EntityHeader user) { await AuthorizeOrgAccessAsync(user, org, typeof(UsageMetrics), Core.Validation.Actions.Read, "PipelineModule"); var instance = await _deploymentInstanceRepo.GetInstanceAsync(instanceId); if (instance.LogStorage.Value == LogStorage.Local) { var proxy = _proxyFactory.Create <IUsageMetricsRepo>(new ProxySettings { OrganizationId = org.Id, InstanceId = instanceId }); return(await proxy.GetMetricsForPipelineModuleAsync(pipelineModuleId, request)); } else { return(await _metricsRepo.GetMetricsForPipelineModuleAsync(pipelineModuleId, request)); } }
public async Task <ListResponse <UsageMetrics> > GetMetricsForPipelineModuleAsync(string pipelineModuleId, ListRequest request, EntityHeader org, EntityHeader user) { await AuthorizeOrgAccessAsync(user, org, typeof(UsageMetrics), Core.Validation.Actions.Read, "PipelineModule"); return(await _metricsRepo.GetMetricsForPipelineModuleAsync(pipelineModuleId, request)); }