Giter Club home page Giter Club logo

Comments (25)

yassirh avatar yassirh commented on August 17, 2024

Maybe the api has changed... i will look into it

from client.

joneslloyd avatar joneslloyd commented on August 17, 2024

Thank you!

from client.

yassirh avatar yassirh commented on August 17, 2024

What version are you using ?

from client.

joneslloyd avatar joneslloyd commented on August 17, 2024

Hello,

I'm using the latest version but the error persists. Thanks for getting back to me.

from client.

yassirh avatar yassirh commented on August 17, 2024

Can you try version 0.2 ?

from client.

joneslloyd avatar joneslloyd commented on August 17, 2024

Hello - I tried that and it still doesn't work - same error actually.

from client.

eddier avatar eddier commented on August 17, 2024

Hi there - same issue with the latest as well.

from client.

yassirh avatar yassirh commented on August 17, 2024

Can you please share the code you are using?

from client.

luutruong avatar luutruong commented on August 17, 2024

Same for me: Property "DigitalOceanV2\Entity\Droplet::size" does not exist.

from client.

yassirh avatar yassirh commented on August 17, 2024

@nobitakun It is fixed on the master branch... i will release it soon

from client.

eddier avatar eddier commented on August 17, 2024

Thanks for the fix! I assume you don't need the sample code anymore but it was failing with the sample snippet on the project page.

from client.

yassirh avatar yassirh commented on August 17, 2024

@eddier Which sample?

from client.

eddier avatar eddier commented on August 17, 2024

Getting a droplet by ID - I assume it is a changed json key that causes the problem? Example usage would be:
$adapter = new BuzzAdapter("token");
$digitalOcean = new DigitalOceanV2($adapter);
$droplet = $digitalOcean->droplet();
$droplet2 = $droplet->getById("dropletId");

from client.

yassirh avatar yassirh commented on August 17, 2024

@eddier Yes! the api is still in beta so they often change things and it breaks this library

from client.

eddier avatar eddier commented on August 17, 2024

Understandable - thanks for the quick turn around on the fix!

from client.

yassirh avatar yassirh commented on August 17, 2024

@eddier no problem

from client.

joneslloyd avatar joneslloyd commented on August 17, 2024

Hi,

My original error (first post here) is still occurring

from client.

yassirh avatar yassirh commented on August 17, 2024

@joneslloyd can you please tell me what version of the library you are using, what adapter and maybe a snippet?

from client.

joneslloyd avatar joneslloyd commented on August 17, 2024

Hello, I am using the latest version (the version available when you click "Download zip" on the right here: https://github.com/toin0u/DigitalOceanV2).

My adaptor is BuzzAdaptor, and the code causing the error is:

$DOToken = $addon_settings["digitalocean_token"];

    if(empty($DOToken)){
        return false;
    }
    try {
        $adapter = new BuzzAdapter($DOToken);
        $do = new DigitalOceanV2($adapter);
        $image = $do->image();
        $images = $image->getAll();
        return true;
    } catch (Exception $e) {
        $GFDO = new GFDigitalOcean;
        $GFDO->log_debug( "Get all images error: " . print_r( $e, true ) );
        return false;
    }

from client.

matif avatar matif commented on August 17, 2024

I am also using the https://github.com/toin0u/DigitalOceanV2 library, I am using the BuzzAdaptor, and getting the error while queering all droplets, images and create droplet.

Create Droplet error is: Property "DigitalOceanV2\Entity\Droplet::sizeSlug" should exist.
Create Droplet call: $droplet->create($hostname, $selected_region, $selected_size, $distribution, $backups, $ipv6, $privateNetworking, $sshKeys);
Get All droplets error is: Property "DigitalOceanV2\Entity\Image::minSize" should exist.
Get All Droplet call: $droplet->getAll();
Get All images error is: Operation timed out after 5007 milliseconds with 0 bytes received
Get All images call: $images->getAll();

@yassirh can you help me to figure it out?

Thanks in advance.

from client.

stsibel avatar stsibel commented on August 17, 2024

@matif you can quickly fix sizeSlug error by adding $sizeSlug property to Droplet Class. The same fix for every other property Digital Ocean keep adding to their API. Can someone explain me, what is the point in dynamically mapping all the properties from api to each Entity using AbstractEntity->build() method and checking that those properties should exist in __set() method of the same class? Especially if you know that those properties will for sure change with API growth. Wouldn't be better just simple let end developer decide what properties he want be simply parsing JSON response?

from client.

joneslloyd avatar joneslloyd commented on August 17, 2024

@stsibel I've tried what you've suggested for my error, but it's not doing anything. I get a BuzzAdaptor timeout error.

from client.

stsibel avatar stsibel commented on August 17, 2024

@joneslloyd I would need to see your code to tell you what's wrong

from client.

joneslloyd avatar joneslloyd commented on August 17, 2024

Hi @stsibel - my code is just as I posted above that's causing the error:

$DOToken = $addon_settings["digitalocean_token"];

    if(empty($DOToken)){
        return false;
    }
    try {
        $adapter = new BuzzAdapter($DOToken);
        $do = new DigitalOceanV2($adapter);
        $image = $do->image();
        $images = $image->getAll();
        return true;
    } catch (Exception $e) {
        $GFDO = new GFDigitalOcean;
        $GFDO->log_debug( "Get all images error: " . print_r( $e, true ) );
        return false;
    }

from client.

yassirh avatar yassirh commented on August 17, 2024

Fixed in version 0.3

from client.

Related Issues (20)

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.