DBRP mapping command does not work



curl -XPOST https://us-central1-1.gcp.cloud2.influxdata.com/api/v2/dbrps \
  -H "Authorization: Token YourAuthToken" \
  -H 'Content-type: application/json' \
  -d '{
        "organization": "example-org",
        "bucket_id": "12ab34cd56ef",
        "database": "example-db",
        "retention_policy": "example-rp",
        "default": true
      }'

as is explained on this page
https://v2.docs.influxdata.com/v2.0/reference/api/influxdb-1x/dbrp/


```but that just compains about invalid json structure...doesn't look particularly wrong to me, so wondering how to fix this?

Hello @cheyert,
Does any curl request work for you? For example, can you write data like so?

curl -XPOST "http://localhost:9999/api/v2/write?org=my-org&bucket=my-bucket&precision=s" \
  --header "Authorization: Token MYTOKEN" \
  --data-raw "mymeasurement,mytag=yay myfield=20"

Can you run
show databases and show retention policies to ensure that you have that database and retention policy?

I think we are mixing 2 instances…
the localhost link works for a local instance of InfluxDB, but I am trying to find out about databases in the cloud

I can get data out of influxDB cloud using flux queries in Grafana, but for one particular plugin (grafana worldmap ) this doesn’t seem to work. I can’t find any example.
I don’t know what the database name is that goes with my bucket, so I am trying to map these…so that I can perhaps use InfluxQL to get gps coordinates, as I know that works with a local instance of InfluxDB…just not InfluxDB cloud

I am also unable to get the DRBP mapping commands to work, although I am trying to use CLI.

influxdb:~$ influx v1 dbrp create -h
Create a database and retention policy mapping to an existing bucket

Usage:
influx v1 dbrp create [flags]

Flags:
-c, --active-config string Config name to use for command; Maps to env var $INFLUX_ACTIVE_CONFIG
–bucket-id ID The ID of the bucket to be mapped
–configs-path string Path to the influx CLI configurations; Maps to env var $INFLUX_CONFIGS_PATH (default “/home/kloen/.influxdbv2/configs”)
–db string The name of the database
–default Identify this retention policy as the default for the database
-h, --help Help for the create command
–hide-headers Hide the table headers; defaults false; Maps to env var $INFLUX_HIDE_HEADERS
–host string HTTP address of InfluxDB; Maps to env var $INFLUX_HOST
–json Output data as json; defaults false; Maps to env var $INFLUX_OUTPUT_JSON
-o, --org string The name of the organization; Maps to env var $INFLUX_ORG
–org-id string The ID of the organization; Maps to env var $INFLUX_ORG_ID
–rp string The name of the retention policy
–skip-verify Skip TLS certificate chain and host name verification.
-t, --token string Authentication token; Maps to env var $INFLUX_TOKEN

influxdb:~$ influx v1 drbp create --db mydabase --rp some_rp --bucket-id 1234567890123456 --default
Error: unknown flag: --db
See ‘influx v1 -h’ for help

influxdb:~$ influx v1 drbp create --rp some_rp --bucket-id 1234567890123456 --default
Error: unknown flag: --rp
See ‘influx v1 -h’ for help

influxdb:~$ influx v1 drbp create --bucket-id 1234567890123456 --default
Error: unknown flag: --bucket-id
See ‘influx v1 -h’ for help

Running InfluxDB2 v2.0.4 installed from official .deb package.

This is preventing us from being able to use all of our Grafana dashboards built on v1 over the last few years.