Commit bf794078 authored by Diego Molteni's avatar Diego Molteni
Browse files

Merge branch 'dm3/various-fixes' into slb/dm3/various-fixes

parents 0e14b062 b00ddcea
...@@ -34,6 +34,9 @@ export class AzureInsightsLogger extends AbstractLogger { ...@@ -34,6 +34,9 @@ export class AzureInsightsLogger extends AbstractLogger {
.setUseDiskRetryCaching(true) .setUseDiskRetryCaching(true)
.setDistributedTracingMode(appinsights.DistributedTracingModes.AI_AND_W3C); .setDistributedTracingMode(appinsights.DistributedTracingModes.AI_AND_W3C);
appinsights.defaultClient.context.tags[
appinsights.defaultClient.context.keys.cloudRole] = 'seismic-dms';
appinsights.start(); appinsights.start();
} }
} }
......
...@@ -22,7 +22,8 @@ import { Locker } from './locker'; ...@@ -22,7 +22,8 @@ import { Locker } from './locker';
export class DatasetDAO { export class DatasetDAO {
public static async register(journalClient: IJournal | IJournalTransaction, datasetEntity: {key: object, data: DatasetModel}) { public static async register(
journalClient: IJournal | IJournalTransaction, datasetEntity: {key: object, data: DatasetModel}) {
datasetEntity.data.ctag = Utils.makeID(16); datasetEntity.data.ctag = Utils.makeID(16);
journalClient.save(datasetEntity); journalClient.save(datasetEntity);
} }
......
...@@ -534,8 +534,14 @@ export class DatasetHandler { ...@@ -534,8 +534,14 @@ export class DatasetHandler {
// mandatory field required if a new seismic metadata record is ingested (kind/data required) // mandatory field required if a new seismic metadata record is ingested (kind/data required)
Params.checkString(seismicmeta.kind, 'kind'); Params.checkString(seismicmeta.kind, 'kind');
Params.checkObject(seismicmeta.data, 'data'); Params.checkObject(seismicmeta.data, 'data');
seismicmeta.recordType =
seismicmeta.recordType ? ':' + seismicmeta.recordType + ':' : ':seismic3d:'; // {data-parititon(delfi)|auhtority(osdu)}.{source}.{entityType}.{semanticSchemaVersion}
if((seismicmeta.kind as string).split(':').length !== 4) {
throw (Error.make(Error.Status.BAD_REQUEST, 'The seismicmeta kind is in a wrong format'));
}
// (recortdType == entityType)
seismicmeta.recordType = ':' + (seismicmeta.kind as string).split(':')[2] + ':';
// if id is given, take it. otherwise generate // if id is given, take it. otherwise generate
if (!seismicmeta.id) { if (!seismicmeta.id) {
......
...@@ -62,7 +62,14 @@ export class DatasetParser { ...@@ -62,7 +62,14 @@ export class DatasetParser {
if (seismicmeta) { if (seismicmeta) {
Params.checkString(seismicmeta.kind, 'kind'); // mandatory string Params.checkString(seismicmeta.kind, 'kind'); // mandatory string
Params.checkObject(seismicmeta.data, 'data'); Params.checkObject(seismicmeta.data, 'data');
seismicmeta.recordType = seismicmeta.recordType ? ':' + seismicmeta.recordType + ':' : ':seismic3d:';
// {data-parititon(delfi)|auhtority(osdu)}.{source}.{entityType}.{semanticSchemaVersion}
if((seismicmeta.kind as string).split(':').length !== 4) {
throw (Error.make(Error.Status.BAD_REQUEST, 'The seismicmeta kind is in a wrong format'));
}
// (recortdType == entityType)
seismicmeta.recordType = ':' + (seismicmeta.kind as string).split(':')[2] + ':';
} }
return [dataset, seismicmeta]; return [dataset, seismicmeta];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment