Skip to content

Latest commit

 

History

History

InfluxDBStatus

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

InfluxDBStatus

This is an example how to check status of InfluxDB.

Prerequisites:

  • Docker
  • Cloned examples:
    git clone [email protected]:influxdata/influxdb-client-swift.git
    cd Examples/InfluxDBStatus

Sources:

How to test:

  1. Start InfluxDB:
    docker run --rm \
      --name influxdb_v2 \
      --detach \
      --publish 8086:8086 \
      influxdb:latest
  2. Configure your username, password, organization, bucket and token:
    docker run --rm \
       --link influxdb_v2 \
       curlimages/curl -s -i -X POST http://influxdb_v2:8086/api/v2/setup \
          -H 'accept: application/json' \
          -d '{"username": "my-user", "password": "my-password", "org": "my-org", "bucket": "my-bucket", "token": "my-token"}'
  3. Start SwiftCLI by:
     docker run --rm \
       --link influxdb_v2 \
       --privileged \
       --interactive \
       --tty \
       --volume $PWD/../..:/client \
       --workdir /client/Examples/InfluxDBStatus \
       swift:5.7 /bin/bash
  4. Check status of InfluxDB by:
    swift run influxdb-status --token my-token --url http://influxdb_v2:8086

Expected output

InfluxDB status: UP, version: v2.4.0, build: OSS