Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
raven-administration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
raven
raven-administration
Commits
2831fc62
Commit
2831fc62
authored
10 months ago
by
Christoffer Stoll
Browse files
Options
Downloads
Patches
Plain Diff
userguid for api import
parent
e52303ef
No related branches found
No related tags found
1 merge request
!20
Development
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
guides/import_export.md
+0
-3
0 additions, 3 deletions
guides/import_export.md
guides/import_via_api.md
+70
-0
70 additions, 0 deletions
guides/import_via_api.md
with
70 additions
and
3 deletions
guides/import_export.md
deleted
100644 → 0
+
0
−
3
View file @
e52303ef
# IMPORT AND EXPORT
Guide on how to import or export data
This diff is collapsed.
Click to expand it.
guides/import_via_api.md
0 → 100644
+
70
−
0
View file @
2831fc62
# Import via API
You can import data with csv files into the Raven database.
Examples of csv file can be found in the
[
csv_examples folder
](
/csv_examples
)
## Authentication
Before importing data you will need to retrieve a bearer token.
```
json
POST
api/auth/signin
BODY
{
"username"
:
"username"
,
"password"
:
"password"
}
```
Keep in mind, that the user needs to have access to
<g>
management
</g>
and
<g>
all networks
</g>
This can configured within the Raven website
# Importing
Set the bearer token as authorization
Attach the csv file as
<g>
form-data
</g>
with the key
<g>
file
</g>
### Authorities
[
Example
](
/csv_examples/responsible_authorities.csv
)
```
yaml
# Endpoint
POST api/imports/authorities
# CSV headers
id,name,organisation,address,locator,postcode,email,phone,website,is_responsible_reporter
```
### Networks
[
Example
](
/csv_examples/networks.csv
)
```
yaml
# Endpoint
POST api/imports/networks
# CSV headers
id,name,media_monitored,responsible_authority_id,organisational,begin_position,end_position,aggregation_timezone
```
### Stations
[
Example
](
/csv_examples/stations.csv
)
```
yaml
# Endpoint
POST api/imports/stations
# CSV headers
id,national_station_code,name,network_id,measurement_regime,city,eoi_code,municipality,geom,mobile,area_classification,distance_junction,traffic_volume,heavy_duty_fraction,street_width,height_facades,begin_position,end_position
```
### Sampling points
[
Example
](
/csv_examples/sampling_points.csv
)
```
yaml
# Endpoint
POST api/imports/sampling_points
# CSV headers
id,station_id,assessment_type,station_classification,industrial_emissions,distance_source,mobile,used_aqd,media_monitored,measurement_regime,main_emission_sources,traffic_emissions,heating_emissions,industrial_emissions,change_aei_stations,logger_id,pollutant,begin_position,end_position,concentration,timestep
```
<style>
r { color: #BF616A }
g { color: #A3BE8C }
</style>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment