Coder Social home page Coder Social logo

vultr-api-php-class's Introduction

Vultr API v2 PHP class wrapper

PHP class built for the Vultr API v2. Do all server actions along with Vultr account services like Block storage, backups, DNS, network, snapshots, Custom ISO's, saved ip addresses and much more.

Usage

Install with:

composer require corbpie/vultr-api-v2

Example usage:

<?php
require __DIR__ . '/vendor/autoload.php';

use Corbpie\VultrAPIv2\VultrAPI;

$vultr = new VultrAPI();

echo $vultr->listServers();//Lists all server instances for account

Current version

2.3 Feb 21 2024

Requires

  • PHP 8.2

Vultr API key obtained form your Vultr account menu.

Add your Vultr API key line 8: src/class.php

Examples

List all instances:

$vultr->listServers();

Create a server

$vultr->serverCreateDC(19);//Sydney Australia location
$vultr->serverCreatePlan(202);//(2048 MB RAM,55 GB SSD,2.00 TB BW)
$vultr->serverCreateType('ISO', 146817);//Deploy with my custom ISO id:146817
$vultr->serverCreateLabel('Created with API');//label instance as "Created with API"
echo $vultr->serverCreate();//Creates instance/server with parameters set above (returns subid)

See example.php for more.

TODO

  • A proper readme

vultr-api-php-class's People

Contributors

cp6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vultr-api-php-class's Issues

update instance problem

hi
sorry i have another problem with instanceUpdate function.
this response is 202, but No changes will be made.
i use this function to update an instance.
public function update($subid)
{
$this->vultr->setSubid($subid);
$values=[
"label"=>"label-test",
];
$ff=$this->vultr->instanceUpdate($values);
die(print_r($ff));
}

create server with snapshot

hi
I need create a server with snapshot
but get code 400
with os do not have any problem
please help me.
thank you.

Get new password after reinstall os

I changed reinstall to this for get new password.
return $this->doCurl("v2/instances/$this->instance_id/reinstall", 'POST', false, $this->apiKeyHeader(), $post)
But this returned the old password, how i can get new instance password after reinstall?

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.