Skip to content

Repository files navigation

slingerdb-ruby

Quick install -

Require date and slingerdb
require'date'require'slingerdb'
Set up your slinger config with your api key
SlingerDB.config={:api_key=>"#{your_api_key}"}includeSlingerDB
Invoke the download method. This will download everything to your current working dir (Dir.pwd)
Download.all

Sample API response

#<SlingerDB::Download id=40763, user_id=670, device_id=246, name="Cookie Demo_2011_10_19.csv.gz", status="complete", prefix="device_246/2011/10/19/", cdr_count=1, share_key="bn1wczaemg5uei04ewds7so0zo7vurit4ea1ytl4", download_uri="https://slinger.icehook.com/downloads/40763/download", created_at="2013-02-20T21:50:37Z", updated_at="2013-02-20T21:50:45Z">

"Download" class methods

Download all files to local dir
Download.all
Check the status of the download to make sure it's complete
downloads=Download.alldownloads.eachdo |download|
ifdownload.complete?download.downloadendend
Define download path
path='/PathToFolder'downloads=Download.alldownloads.eachdo |download|
ifdownload.complete?download.download(path)endend

Devices

Get all devices
Device.all
Get a specific device
Device.find(<device_id>)

Call Detail Records

Create a CDR Download
Download.create!(<device_id>,Date.new(2012,05,16),Date.new(2012,05,16))# orDevice.find(222).create_downloads(Date.new(2012,05,16),Date.new(2012,05,16))

Downloads

Get all downloads
Download.all
Delete download
downloads=Download.allx=downloads.firstx.destroy!

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages