Get Virtualizor

List User Plans

Virtualizor allows creation plans for normal user, admin user and cloud user. User Plans help facilitate creation of the users. For cloud users, plans allows you to set the limits of the parameters of the VPS and the number of the other users that the cloud user can create.

Use the List User Plans API to list all the plans of the user added by the. The list will contain all the information of the user plan which is listed according to the plan ID. To filter or limit the size of the list pass in one or more query parameter.

HTTP Request

https://hostname:4085/index.php?act=user_plans

Parameters

NameMethodValueDescriptionRequired
actGETuser_plansThe act will list the user plansYes
pageGETIntIf not specified, then only first 50 records are returnedNo
reslenGETIntNumber of records to be returned, default is 50No
plannamePOSTtextFilter the list according to plan nameNo
ptypePOSTtextFilter the list according to plan type, for valid values refer the table belowNo

Plan Type

( openvz | xen | kvm | xcp | lxc | vzo | vzk )

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $page = 1;
    $reslen = 20;
    $post = array();

    $output = $admin->list_user_plans($page, $reslen, $post);

    print_r(json_encode($output));
?>

Output

{
    "title": "Plans",
    "plans": {
        "1": {
            "uplid": "1",
            "plan_name": "New Plan",
            "type": "0",
            "aclid": "0",
            "inhouse_billing": "0",
            "max_cost": "0",
            "num_vs": "0",
            "num_users": "0",
            "space": "0",
            "ram": "0",
            "burst": "0",
            "bandwidth": "0",
            "cpu": "0",
            "cores": "4",
            "cpu_percent": "0",
            "num_cores": "0",
            "num_ipv4": "0",
            "num_ipv6": "0",
            "num_ipv6_subnet": "0",
            "allowed_virts": "",
            "network_speed": "0",
            "upload_speed": "-1",
            "sg": "",
            "mg": "",
            "dnsplid": "0",
            "service_period": "1",
            "band_suspend": "0",
            "date_created": "1534518872"
        }
         },
    "timenow": 1537470364,
    "time_taken": "0.136"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list