Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

API Breaking due to Change in DO behaviour.  #1

Description

@phaynes

The Digital Ocean API has changed requiring the use of private cloud network. The gateway returns "" as per below. Unfortunately, this causes the Droplet requests to fail with a parse error.

// Data returned from a Droplet request.
"networks": { "v4": [ { "ip_address": "10.116.0.3", "netmask": "255.255.240.0", "gateway": "<nil>", "type": "private" },

The following modification to droplet.rs allows the deserialization to "work", but more correctly the "" needs to be removed.
``
/// These exist in the networks field of a droplet.
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct NetworkV4 {
///pub gateway: Ipv4Addr,
pub gateway: String,
pub ip_address: Ipv4Addr,
pub netmask: Ipv4Addr,
/// Note: Since `type` is a keyword in Rust `kind` is used instead.
#[serde(rename = "type")]
pub kind: String
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions