public class JVultrClient
extends java.lang.Object
| Constructor and Description |
|---|
JVultrClient(java.lang.String apiKey)
Create a new JVultrClient Instance to communicate with Vultr API
|
| Modifier and Type | Method and Description |
|---|---|
JVultrDns |
createDns(java.lang.String domain,
java.lang.String ip) |
void |
createRecord(java.lang.String domain,
java.lang.String subdomain,
JVultrDnsRecord.Type type,
java.lang.String data,
java.lang.Integer ttl,
java.lang.Integer priority) |
JVultrScript |
createScript(java.lang.String name,
java.lang.String script,
JVultrScript.Type type)
Create new startup script
Vultr API Doc
|
JVultrServer |
createServer(int regionId,
int planId,
int osId) |
JVultrServer |
createServer(int regionId,
int planId,
int osId,
java.lang.String ipxeChainUrl,
java.lang.Integer isoId,
java.lang.Integer scriptId,
java.lang.String snapshotId,
java.lang.Boolean enableIpv6,
java.lang.Boolean enablePrivateNetwork,
java.lang.String label,
java.lang.Integer sshKeyIds,
java.lang.Boolean autoBackups,
java.lang.Integer appId,
java.lang.String userData,
java.lang.Boolean notifyActivate,
java.lang.Boolean ddosProtection,
int subID,
java.lang.String host)
Create a new Vultr Server
Vultr API Doc
|
JVultrServer |
createServer(JVultrRegion region,
JVultrPlan plan,
JVultrOS os) |
JVultrServer |
createServer(JVultrRegion region,
JVultrPlan plan,
JVultrOS os,
java.lang.String ipxeChainUrl,
JVultrISO iso,
JVultrScript script,
JVultrSnapshot snapshot,
java.lang.Boolean enableIpv6,
java.lang.Boolean enablePrivateNetwork,
java.lang.String label,
java.lang.Integer sshKey,
java.lang.Boolean autoBackups,
JVultrApplication app,
java.lang.String userData,
java.lang.Boolean notifyActivate,
java.lang.Boolean ddosProtection,
int floating_SUBID,
java.lang.String host) |
void |
createSnapshot(int id) |
void |
createSnapshot(JVultrServer server) |
void |
deleteDns(java.lang.String domain) |
void |
deleteRecord(java.lang.String domain,
int id) |
void |
destroyScript(int id)
Delete script represented by this id
Vultr API Doc
|
void |
destroyServer(int id) |
void |
destroyServer(JVultrServer server) |
void |
destroySnapshot(JVultrSnapshot snapshot) |
void |
destroySnapshot(java.lang.String id) |
JVultrAccountInfo |
getAccountInfo()
Retrieve information about the current account
Vultr API Doc
|
java.util.List<JVultrDnsRecord> |
getDNSRecords(JVultrDns dns) |
java.util.List<JVultrDnsRecord> |
getDNSRecords(java.lang.String domain) |
java.util.List<JVultrDns> |
getDNSs()
List all domains associated with the current account
Vultr API Doc
|
java.util.HashMap<java.lang.Integer,JVultrISO> |
getISOs()
List all ISOs currently available on this account
Vultr API Doc
|
java.util.HashMap<java.lang.String,JVultrOS> |
getOsChangeListFor(JVultrServer server)
Retrieves a list of operating systems to which this server can be changed.
|
java.util.HashMap<java.lang.Integer,JVultrPlan> |
getPlans()
Retrieve a list of all active plan
Use this method only if you have special plans available
Vultr API Doc
|
java.util.HashMap<java.lang.Integer,JVultrScript> |
getScripts()
List all ISOs currently available on this account
Vultr API Doc
|
java.util.HashMap<java.lang.Integer,JVultrServer> |
getSevers()
List all active or pending virtual machines on the current account.
|
java.util.HashMap<java.lang.String,JVultrSnapshot> |
getSnapshots()
List all snapshots on the current account
Vultr API Doc
|
java.util.List<JVultrPlan> |
getUpgradePlanList(int serverId) |
JVultrUserData |
getUserData(int server)
Retrieves the user data for this server.
|
void |
updateRecord(java.lang.String domain,
int id) |
void |
updateScript(int id,
java.lang.String name,
java.lang.String script)
Update existing startup script
Vultr API Doc
|
void |
updateScript(JVultrScript script)
Update an existing startup script
Vultr API Doc
|
public JVultrClient(java.lang.String apiKey)
apiKey - the JVultr apiKey available in vultr Members Area
public JVultrAccountInfo getAccountInfo() throws JVultrException
JVultrException - if an error OccurredJVultrAccountInfopublic java.util.HashMap<java.lang.String,JVultrSnapshot> getSnapshots() throws JVultrException
JVultrException - if an error OccurredJVultrSnapshotpublic java.util.HashMap<java.lang.Integer,JVultrISO> getISOs() throws JVultrException
JVultrException - if an error OccurredJVultrISOpublic java.util.HashMap<java.lang.Integer,JVultrScript> getScripts() throws JVultrException
JVultrException - if an error OccurredJVultrScriptpublic void destroyScript(int id)
throws JVultrException
id - Vultr script idJVultrException - if an error Occurredpublic JVultrScript createScript(java.lang.String name, java.lang.String script, JVultrScript.Type type) throws JVultrException
name - Script namescript - Script contenttype - Script typeJVultrException - if an error Occurredpublic void updateScript(int id,
@Optional
java.lang.String name,
@Optional
java.lang.String script)
throws JVultrException
id - id of the Vultr startup scriptname - if not null new name for the scriptscript - if not null new content of the scriptJVultrException - if an error Occurredpublic void updateScript(JVultrScript script) throws JVultrException
script - script to be updatedJVultrException - if an error OccurredJVultrScriptpublic java.util.HashMap<java.lang.String,JVultrOS> getOsChangeListFor(JVultrServer server) throws JVultrException
JVultrException - if an error OccurredJVultrScriptpublic java.util.HashMap<java.lang.Integer,JVultrPlan> getPlans() throws JVultrException
Use this method only if you have special plans available
JVultrException - if an error OccurredJVultrPlan,
JVultrAPI.getPlans()public java.util.HashMap<java.lang.Integer,JVultrServer> getSevers() throws JVultrException
JVultrException - if an error OccurredJVultrServerpublic JVultrUserData getUserData(int server) throws JVultrException
JVultrException - if an error OccurredJVultrUserDatapublic java.util.List<JVultrDns> getDNSs() throws JVultrException
JVultrException - if an error OccurredJVultrDnspublic java.util.List<JVultrPlan> getUpgradePlanList(int serverId) throws JVultrException
JVultrExceptionpublic java.util.List<JVultrDnsRecord> getDNSRecords(java.lang.String domain) throws JVultrException
JVultrExceptionpublic java.util.List<JVultrDnsRecord> getDNSRecords(JVultrDns dns) throws JVultrException
JVultrExceptionpublic JVultrDns createDns(java.lang.String domain, java.lang.String ip) throws JVultrException
JVultrExceptionpublic void deleteDns(java.lang.String domain)
throws JVultrException
JVultrExceptionpublic void createRecord(java.lang.String domain,
java.lang.String subdomain,
JVultrDnsRecord.Type type,
java.lang.String data,
@Optional
java.lang.Integer ttl,
@Optional
java.lang.Integer priority)
throws JVultrException
JVultrExceptionpublic void deleteRecord(java.lang.String domain,
int id)
throws JVultrException
JVultrExceptionpublic void updateRecord(java.lang.String domain,
int id)
throws JVultrException
JVultrExceptionpublic void destroySnapshot(java.lang.String id)
throws JVultrException
JVultrExceptionpublic void createSnapshot(int id)
throws JVultrException
JVultrExceptionpublic void destroySnapshot(JVultrSnapshot snapshot) throws JVultrException
JVultrExceptionpublic void createSnapshot(JVultrServer server) throws JVultrException
JVultrExceptionpublic JVultrServer createServer(int regionId, int planId, int osId, @Optional java.lang.String ipxeChainUrl, @Optional java.lang.Integer isoId, @Optional java.lang.Integer scriptId, @Optional java.lang.String snapshotId, @Optional java.lang.Boolean enableIpv6, @Optional java.lang.Boolean enablePrivateNetwork, @Optional java.lang.String label, @Optional java.lang.Integer sshKeyIds, @Optional java.lang.Boolean autoBackups, @Optional java.lang.Integer appId, @Optional java.lang.String userData, @Optional java.lang.Boolean notifyActivate, @Optional java.lang.Boolean ddosProtection, @Optional int subID, @Optional java.lang.String host) throws JVultrException
regionId - Region id to create this virtual machine in.planId - Plan id to use when creating this virtual machine.osId - Operating systems'id to use.ipxeChainUrl - If you've selected the 'custom' operating system, this can be set to chainload the specified URL on bootup, via iPXE.isoId - If you've selected the 'custom' operating system, this is the ID of a specific ISO to mount during the deployment.scriptId - If you've not selected a 'custom' operating system, this can be the script id of a startup script to execute on boot.snapshotId - If you've selected the 'snapshot' operating system, this should be the snapshot id.enableIpv6 - If true, an IPv6 subnet will be assigned to the machine (where available).enablePrivateNetwork - If true, private networking support will be added to the new server.label - This is a text label that will be shown in the control panel.sshKeyIds - List of SSH keys to apply to this server on install (only valid for Linux/FreeBSD).autoBackups - If yes, automatic backups will be enabled for this server (these have an extra charge associated with them).appId - If you've selected the 'application' operating system, this is the Application id to launch.userData - Base64 encoded cloud-init user-datanotifyActivate - If true, an activation email will be sent when the server is ready.ddosProtection - If true, DDOS protection will be enabled on the subscription (there is an additional charge for this).JVultrException - if an Error occuredJVultrServerpublic JVultrServer createServer(JVultrRegion region, JVultrPlan plan, JVultrOS os, @Optional java.lang.String ipxeChainUrl, @Optional JVultrISO iso, @Optional JVultrScript script, @Optional JVultrSnapshot snapshot, @Optional java.lang.Boolean enableIpv6, @Optional java.lang.Boolean enablePrivateNetwork, @Optional java.lang.String label, @Optional java.lang.Integer sshKey, @Optional java.lang.Boolean autoBackups, @Optional JVultrApplication app, @Optional java.lang.String userData, @Optional java.lang.Boolean notifyActivate, @Optional java.lang.Boolean ddosProtection, @Optional int floating_SUBID, @Optional java.lang.String host) throws JVultrException
JVultrExceptionpublic JVultrServer createServer(int regionId, int planId, int osId) throws JVultrException
JVultrExceptionpublic JVultrServer createServer(JVultrRegion region, JVultrPlan plan, JVultrOS os) throws JVultrException
JVultrExceptionpublic void destroyServer(int id)
throws JVultrException
JVultrExceptionpublic void destroyServer(JVultrServer server) throws JVultrException
JVultrException