Code Monkey home page Code Monkey logo

hrobot-rs's People

Contributors

mathiaspius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hrobot-rs's Issues

Use type-specific IDs for Servers, Templates, etc.

These types should be easily constructible from u32 integers.

Should make the API much more intuitive since a function taking a TemplateId lets you search the docs for references to it and thereby ways of acquiring one/constructing

Automatically makes impossible errors like trying to fetch a server using a firewall template ID for instance, except when explicitly constructing a TemplateId using a server_number Id.

Use bytesize crate for any byte measurement

Places where byte sizes should be used:

  • Traffic Warnings are implicitly in MB, should be coerced into ByteSize.
  • Traffic limits are strings "5 TB" instead of Option<ByteSize> where None implies unlimited.

AsyncRobot should really have a username/password constructor

I just noticed that I've been relying solely on the AsyncRobot::default() functionality which uses AsyncRobot::from_env() under the hood for fetching username and password.

There is an AsyncRobot::new() constructor which takes username and password, but it also requires passing in a hyper client which is very cumbersome to construct.

It would be nice to have a simple AsyncRobot::from_credentials(username: &str, password: &str) constructor which handles the heavy client construction.

ip field in Server response can be null

I have a dedicated server without an IPv4 Address, so only IPv6 subnet, and in the response of e.g. get_server or list_servers, the ip field is null, which means serde can't deserialize the response.

It looks like this is undocumented behavior, at least the Robot API docs have no example for this.

The relevant piece of code:

/// IP Addresses associated with this server.
///
/// Includes both IPv4 and IPv6 but excludes associated subnets,
/// which are instead listed in [`subnets`](Server::subnets)
#[serde(rename = "ip", default)]
pub ips: Vec<String>,

This could be fixed by either wrapping the Vec in an Option (I tried that locally, would be a breaking change), or using a custom deserialization function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.