Validating REGION against hardcoded region names instead of dynamic provider-specific regions
Observed behavior
When attempting to create subprojects, the storage_location
parameter is restricted to a hardcoded list of values (GCP values?).
These values are hardcoded here, in services/subproject/parser.ts
:
https://community.opengroup.org/osdu/platform/domain-data-mgmt-services/seismic/seismic-dms-suite/seismic-store-service/-/blob/master/src/services/subproject/parser.ts#L25-31
When attempting to pass an AWS-specific region, this is the error code received:
[400] [seismic-store-service] The storage_location body field US-EAST-1 is not valid. It must be one of ASIA, EU, US, NORTHAMERICA-NORTHEAST1, US-CENTRAL1, US-EAST1, US-EAST4, US-WEST1, SOUTHAMERICA-EAST1, EUROPE-WEST1, EUROPE-WEST2, EUROPE-WEST3, EUROPE-WEST4, ASIA-EAST1, ASIA-NORTHEAST1, ASIA-SOUTH1, ASIA-SOUTHEAST1, AUSTRALIA-SOUTHEAST1
Expected behavior
Subproject creation should validate the user-provided region against cloud provider's regions dynamically.
Potential solutions
This might already be addressed in @DiegoMolteni's upcoming updates to make the Seismic service more abstracted and generic. If not, can we work to abstract parser.ts
to have cloud provider specific implementations?