Code Monkey home page Code Monkey logo

Comments (12)

shoquebd avatar shoquebd commented on August 15, 2024

Hello

I have got the same problem here too. Old server ID's were numeric only like '123456' but new ID's using alphanumeric value like '4d6e-8bd8-289ea70a11e8'. Can we expect a new update of this very useful module soon? API V2 docs can be found here https://www.vultr.com/api/

Thanks

from whmcs-vultr.

meramsey avatar meramsey commented on August 15, 2024

i'm very interested in this as well as was just looking into the feasibility of this.

@ddymko
The real question is if they will accept PR/MR if we do go ahead and updated it to support API v2?

from whmcs-vultr.

digitalforex avatar digitalforex commented on August 15, 2024

Is v2.0.4 already built on API v2? Does anybody know?

from whmcs-vultr.

meramsey avatar meramsey commented on August 15, 2024

its definitely not v2 like it should be :(

If you want to help im trying to fork and port it to v2
https://github.com/whattheserver/whmcs-vultr/blob/master/servers/vultr/vendor/VultrAPI2.php

using the new reference.
https://www.vultr.com/api/#operation/update-instance

Unfortunately not everything is a 1:1 match function wise.

Feel free to help and submit MR/PR on it if interested.

I noticed a new VPS i created is using the new UUID and it does NOT work with the v1 API like they said it does.
image

from whmcs-vultr.

digitalforex avatar digitalforex commented on August 15, 2024

its definitely not v2 like it should be :(

If you want to help im trying to fork and port it to v2
https://github.com/whattheserver/whmcs-vultr/blob/master/servers/vultr/vendor/VultrAPI2.php

using the new reference.
https://www.vultr.com/api/#operation/update-instance

Unfortunately not everything is a 1:1 match function wise.

Feel free to help and submit MR/PR on it if interested.

I noticed a new VPS i created is using the new UUID and it does NOT work with the v1 API like they said it does.
image

Thanks for your help. Can we discuss details on skype or telegram? if yes, what is your ID?

from whmcs-vultr.

meramsey avatar meramsey commented on August 15, 2024

@digitalforex i have neither of those. I do have a discord or matrix id

Discord
onessa#8165

Matrix
@onessa:matrix.org

from whmcs-vultr.

digitalforex avatar digitalforex commented on August 15, 2024

I just sent you a friendship request on discord. You got it?

from whmcs-vultr.

meramsey avatar meramsey commented on August 15, 2024

so for anyone else having issues. You can use the v1 api list to get the sub_id which is the old style id to use in whmcs to regain controls of the new VPS's, but you cannot find the sub_id from the v2 api lol.

So you can reverse lookup the old style id from v1 api and manually enter it into the Virtual machine ID custom field so it works in the current plugin as a temporary measure for new server orders being received.

https://www.vultr.com/api/v1/#server_server_list

curl -H 'API-Key: YOURKEY' "https://api.vultr.com/v1/server/list"

Filter the output or paste into notepad editor find by the new uuid which is in v2_id field or hostname
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" "https://api.vultr.com/v1/server/list"
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" -G --data "label=server.domain.tld" "https://api.vultr.com/v1/server/list"
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" -G --data "main_ip=1.1.1.1" "https://api.vultr.com/v1/server/list"

new apiv2 is based on instances
https://www.vultr.com/api/#operation/list-instances

from whmcs-vultr.

Ocean-2021 avatar Ocean-2021 commented on August 15, 2024

Hello

I also use the Vultr module, but I have no programming experience what so ever. Will this be released as a new release once its been fixed. Is there anyone that can help me get my existing module working as it was fine up until the API change

I would really appreciate it

Thanks in advance

from whmcs-vultr.

taufiqshovon avatar taufiqshovon commented on August 15, 2024

so for anyone else having issues. You can use the v1 api list to get the sub_id which is the old style id to use in whmcs to regain controls of the new VPS's, but you cannot find the sub_id from the v2 api lol.

So you can reverse lookup the old style id from v1 api and manually enter it into the Virtual machine ID custom field so it works in the current plugin as a temporary measure for new server orders being received.

https://www.vultr.com/api/v1/#server_server_list

curl -H 'API-Key: YOURKEY' "https://api.vultr.com/v1/server/list"

Filter the output or paste into notepad editor find by the new uuid which is in v2_id field or hostname
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" "https://api.vultr.com/v1/server/list"
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" -G --data "label=server.domain.tld" "https://api.vultr.com/v1/server/list"
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" -G --data "main_ip=1.1.1.1" "https://api.vultr.com/v1/server/list"

new apiv2 is based on instances
https://www.vultr.com/api/#operation/list-instances

mate are you get's any solution for this problem?

from whmcs-vultr.

meramsey avatar meramsey commented on August 15, 2024

so for anyone else having issues. You can use the v1 api list to get the sub_id which is the old style id to use in whmcs to regain controls of the new VPS's, but you cannot find the sub_id from the v2 api lol.
So you can reverse lookup the old style id from v1 api and manually enter it into the Virtual machine ID custom field so it works in the current plugin as a temporary measure for new server orders being received.
https://www.vultr.com/api/v1/#server_server_list
curl -H 'API-Key: YOURKEY' "https://api.vultr.com/v1/server/list"
Filter the output or paste into notepad editor find by the new uuid which is in v2_id field or hostname
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" "https://api.vultr.com/v1/server/list"
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" -G --data "label=server.domain.tld" "https://api.vultr.com/v1/server/list"
apikey='YOURKEY'; curl -H "API-Key: ${apikey}" -G --data "main_ip=1.1.1.1" "https://api.vultr.com/v1/server/list"
new apiv2 is based on instances
https://www.vultr.com/api/#operation/list-instances

mate are you get's any solution for this problem?

Not got any help from anyone on the new module and been busy so have not had much time to work on it. What i posted above does let you identify the old style id to manually add any newly created servers to the existing module so the controls work.

if you want to help feel free to submit MR/PR on the fork of this repo with the API2
https://github.com/whattheserver/whmcs-vultr

It will require reworking alot of stuff so that the new api functions responses are usable in the existing one

from whmcs-vultr.

meramsey avatar meramsey commented on August 15, 2024

I made some more progress on the V2 API class and actually ran through all the methods manually to confirm they work with a test vps and domains for stuff. I also looked for obvious changes in the format of the responses and tried to normalize it back to what the current module expects despite being from v2 API. It's possible i missed something but I did find and fix alot of stuff i had missed on my first pass through in porting the class to v2.

meramsey@55a535a#diff-c6af820745a34805dc426e20720fa27ab8c92221f5716abdcfc47124f84e1486

The UI as some of you are probably aware is kinda long overdue for an upgrade being like bootstrap 3.2 and jquery old... So if someone comfortable with updating the UI aspect to the new bootstrap v4 style stuff built into whmcs 8.1.x that would be super helpful.

Things left to do.

  • Try swapping in the V2 API class for the V1 API class and see what's broken.
  • Code a function to read all the SUBIDs from old format customfields and then lookup their new v2_id and save that in the same spot as the subid...... Alternatively we could add a new custom field in the version bump for v2_id and that would leave the old value as a fallback till old v1 api is truly unusable but makes things messier in the database.
  • Update the UI (NOT my area of expertise but will be needed so )

from whmcs-vultr.

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.