Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Error on retrieving droplets #17

Open
kbknapp opened this issue Feb 4, 2016 · 2 comments
Open

Error on retrieving droplets #17

kbknapp opened this issue Feb 4, 2016 · 2 comments
Labels

Comments

@kbknapp
Copy link
Owner

kbknapp commented Feb 4, 2016

let auth_token = "my token";
 let domgr = DoManager::with_token(&auth_token);
 match domgr.droplets().retrieve() {
                  Ok(val) => "OK".to_string(),
                  Err(t) => t.to_string(),
              });

Returns error:

Error "expected value" at line 0 column 0

Likely due to upstream API change

@kbknapp kbknapp added the bug label Feb 4, 2016
@yberreby
Copy link
Collaborator

@kbknapp Works on my machine. Maybe your token was invalid, or is was a temporary DigitalOcean downtime?

extern crate doapi;
use doapi::DoManager;
use doapi::DoRequest;

fn main() {
    let auth_token = env!("DO_AUTH_TOKEN");
    let domgr = DoManager::with_token(&auth_token);
    match domgr.droplets().retrieve() {
        Ok(val) => "OK".to_string(),
        Err(t) => t.to_string(),
    };
}
❯ cargo run --example retrieve
   Compiling doapi v0.1.2 (file:///Users/yberreby/code/shared/doapi-rs)
examples/retrieve.rs:9:12: 9:15 warning: unused variable: `val`, #[warn(unused_variables)] on by default
examples/retrieve.rs:9         Ok(val) => "OK".to_string(),
                                  ^~~
     Running `target/debug/examples/retrieve`

@gallexme
Copy link

@yberreby
actually i reported the problem and @kbknapp made a issue from it,
gonna try again this evening, but im sure i used a read/write api token, but not sure enough^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants