Virak Cloud API

Introduction

The Virak Cloud API is a comprehensive RESTful API that empowers developers to programmatically manage and interact with cloud infrastructure resources. This API provides secure, scalable endpoints for managing virtual instances, networks, Kubernetes clusters, object storage, DNS records, and more. Built with enterprise-grade security and reliability, the Virak Cloud API enables seamless automation and integration with your existing workflows and applications.

Welcome to the Virak Cloud API documentation.

For detailed guides and advanced documentation, visit the VirakCloud Documentation.

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Datacenter

Zone List

GET
https://public-api.virakcloud.com
/zones
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zones';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "string",
            "name": "string",
            "location": "string",
            "active": true
        },
        {
            "id": "string",
            "name": "string",
            "location": "string",
            "active": true
        }
    ]
}

Zone Active Services

GET
https://public-api.virakcloud.com
/zone/{zoneId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "Instance": true,
    "DataVolume": true,
    "Network": true,
    "ObjectStorage": true,
    "K8s": false
}

Customer Resource

GET
https://public-api.virakcloud.com
/zone/{zoneId}/resources
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/resources';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "instance_resource_collected": {
        "memory": {
            "collected": 0,
            "total": 40960
        },
        "cpunumber": {
            "collected": 0,
            "total": 40
        },
        "datavolume": {
            "collected": 10,
            "total": 200
        },
        "vmlimit": {
            "collected": 0,
            "total": 20
        }
    }
}

User

User Profile

GET
https://public-api.virakcloud.com
/user/profile
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/profile';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:

Token validation

GET
https://public-api.virakcloud.com
/user/token
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/token';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
[Empty response]

Token Abilities

GET
https://public-api.virakcloud.com
/user/token-abilities
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/token-abilities';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{"abilities": ["ability1", "ability2", ...]}

SSH-Key


SSH key list

GET
https://public-api.virakcloud.com
/user/ssh-key
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/ssh-key';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "userData": [
        {
            "id": "placeholder_id_1",
            "display_name": "User One",
            "datakey": "ssh-authorized-keys",
            "datavalue": "ssh-rsa AAAA...== user1@example.com",
            "created_at": "2024-01-01T00:00:00.000000Z"
        },
        {
            "id": "placeholder_id_2",
            "display_name": "User Two",
            "datakey": "ssh-authorized-keys",
            "datavalue": "ssh-rsa AAAA...== user2@example.com",
            "created_at": "2024-01-02T00:00:00.000000Z"
        }
    ]
}

Add new SSH Keys

POST
https://public-api.virakcloud.com
/user/ssh-key
requires authentication

Note: This function runs asynchronously in the background. The response will be:

{
   "data": {
       "success": true
   }
 }

To check the status of the created ssh Key, use the SSH key list endpoint.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/ssh-key';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'My SSH Key',
            'ssh_key' => 'ssh-rsa AAAA...== user@example.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Delete SSH Key

DELETE
https://public-api.virakcloud.com
/user/ssh-key/{sshKeyId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

sshKeyId
string
required
Example:
2kpyeAKXgXpjAfFyehshb887Rn
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/ssh-key/2kpyeAKXgXpjAfFyehshb887Rn';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Finance


Wallets Balance

GET
https://public-api.virakcloud.com
/user/finance/wallet
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/finance/wallet';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "name": "WALLET_NAME_PLACEHOLDER",
        "track": "TRACK_PLACEHOLDER",
        "type": "TYPE_PLACEHOLDER",
        "balance": 0,
        "balance_limit": 0,
        "is_blocked": false,
        "max_cost": 0,
        "remaining_hours": 0,
        "updated_at": "DATE_PLACEHOLDER"
    }
}

Cost Documents Yearly

GET
https://public-api.virakcloud.com
/user/finance/documents
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/finance/documents';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'year' => 1402,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "dateFrom": "DATE_FROM_PLACEHOLDER",
            "dateTo": "DATE_TO_PLACEHOLDER",
            "Instance": 0,
            "NetworkNetflow": 0,
            "InstanceSnapshot": 0,
            "InstanceDataVolumes": 0,
            "SupportOfferings": 0,
            "NetworkInternetPublicAddressV4": 0,
            "NetworkDevice": 0,
            "InstanceNetworkSecondaryIpAddressV4": 0,
            "BucketSize": 0,
            "BucketDownloadTraffic": 0,
            "BucketUploadTraffic": 0,
            "KubernetesNode": 0
        }
    ]
}

Payment List

GET
https://public-api.virakcloud.com
/user/finance/payments
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/user/finance/payments';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": []
}

Instance

An Instance represents a virtual machine (VM) or compute resource provisioned in a specific zone. Instances are the core compute units in the cloud platform, allowing users to run applications, host services, and manage workloads. Each instance is created from a template or image, has its own resources (CPU, memory, disk), and can be managed through various lifecycle operations.

Key Concepts:

  • Instance: A virtual machine or compute resource, including its configuration, status, and metadata.
  • Zone: A physical or logical location where instances are provisioned. Each instance belongs to a zone.
  • VM Image: The template or image used to create the instance, defining its operating system and base software.
  • Service Offering: Defines the hardware resources (CPU, memory, disk, network) allocated to the instance.
  • Volume: Persistent storage that can be attached to or detached from an instance.
  • Snapshot: A point-in-time backup of an instance's volume, which can be created, deleted, or reverted.
  • Status: The current state of the instance (e.g., 'Running', 'Stopped', 'Starting', 'Stopping', 'Error').
  • Metadata: Custom key-value data associated with the instance.

Instance Functionalities:

  • List all instances in a zone for the authenticated user.
  • Create, delete, and manage snapshots for instances.
  • Attach, detach, create, and delete volumes for instances.
  • Retrieve detailed information about each instance, including configuration, status, and related resources.

Instance Statuses:

  • Running: Instance is active and operational.
  • Stopped: Instance is powered off.
  • Starting: Instance is in the process of starting up.
  • Stopping: Instance is in the process of shutting down.
  • Error: Instance encountered an error during an operation.

Index

GET
https://public-api.virakcloud.com
/zone/{zoneId}/instance
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "string",
            "name": "string",
            "created": true,
            "template_id": null,
            "vm_image": {
                "id": "string",
                "type": "string",
                "name": "string",
                "is_available": true,
                "display_text": "string",
                "name_orginal": "string",
                "ready_to_use_app": false,
                "ready_to_use_app_name": null,
                "ready_to_use_app_version": null,
                "os_type": "string",
                "os_name": "string",
                "os_version": "string",
                "hardware_requirement": {
                    "cpunumber": 1,
                    "cpuspeed": 500,
                    "memory": 500,
                    "rootdisksize": 25
                },
                "category": "string"
            },
            "zone": {
                "id": "string",
                "name": "string",
                "location": "string",
                "is_public": true,
                "is_featured": true,
                "is_ready": true
            },
            "service_offering": {
                "id": "string",
                "name": "string",
                "has_image_requirement": null,
                "is_available": true,
                "is_public": true,
                "suggested": false,
                "category": "string",
                "hourly_price": {
                    "up": 0,
                    "down": 0
                },
                "hourly_price_no_discount": {
                    "up": 0,
                    "down": 0
                },
                "description": null,
                "hardware": {
                    "cpu_core": 1,
                    "memory_mb": 512,
                    "cpu_speed_MHz": 1000,
                    "root_disk_size_gB": 30,
                    "network_rate": 200,
                    "disk_iops": 2500
                }
            },
            "disk_offering_id": null,
            "service_offering_id": "string",
            "status": "string",
            "instance_status": "string",
            "password": "string",
            "username": "string",
            "created_at": 1234567890,
            "updated_at": 1234567890,
            "metadata": [],
            "kubernetes_cluster_id": null,
            "data_volumes": [],
            "snapshot": []
        }
    ]
}

List Instance Service Offerings

GET
https://public-api.virakcloud.com
/zone/{zoneId}/instance/service-offerings
requires authentication

List all available instance service offerings for the specified zone. Returned data is anonymized for documentation purposes.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/service-offerings';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "instance_service_offering_id_1",
            "name": "Instance Type A",
            "has_image_requirement": null,
            "is_available": true,
            "is_public": true,
            "suggested": false,
            "category": "CPU",
            "hourly_price": {
                "up": 10000,
                "down": 10000
            },
            "hourly_price_no_discount": {
                "up": 15000,
                "down": 15000
            },
            "description": "CPU: 1 Core </br> Ram: 1 GB </br> Storage: 25 GB",
            "hardware": {
                "cpu_core": 1,
                "memory_mb": 1024,
                "cpu_speed_MHz": 1000,
                "root_disk_size_gB": 25,
                "network_rate": 200,
                "disk_iops": 2500
            }
        },
        {
            "id": "instance_service_offering_id_2",
            "name": "Instance Type B",
            "has_image_requirement": null,
            "is_available": true,
            "is_public": true,
            "suggested": true,
            "category": "MEMORY",
            "hourly_price": {
                "up": 20000,
                "down": 20000
            },
            "hourly_price_no_discount": {
                "up": 25000,
                "down": 25000
            },
            "description": "CPU: 2 Core </br> Ram: 4 GB </br> Storage: 50 GB",
            "hardware": {
                "cpu_core": 2,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2000,
                "root_disk_size_gB": 50,
                "network_rate": 400,
                "disk_iops": 5000
            }
        }
    ]
}

List Instance VM Image Service Offerings

GET
https://public-api.virakcloud.com
/zone/{zoneId}/instance/vm-images
requires authentication

List all available VM image service offerings for the specified zone. Returned data is anonymized for documentation purposes.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/vm-images';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "vm_image_id_1",
            "type": "TEMPLATE",
            "name": "Linux Template A",
            "is_available": true,
            "display_text": "Linux Template A",
            "name_orginal": "linux OS A",
            "ready_to_use_app": true,
            "ready_to_use_app_name": "AppA",
            "ready_to_use_app_version": "1.0",
            "os_type": "linux",
            "os_name": "LinuxOS",
            "os_version": "1.0",
            "hardware_requirement": {
                "cpunumber": 1,
                "cpuspeed": 1000,
                "memory": 1024,
                "rootdisksize": 25
            },
            "category": "GENERAL"
        },
        {
            "id": "vm_image_id_2",
            "type": "TEMPLATE",
            "name": "Windows Template B",
            "is_available": true,
            "display_text": "Windows Template B",
            "name_orginal": "windows OS B",
            "ready_to_use_app": false,
            "ready_to_use_app_name": null,
            "ready_to_use_app_version": null,
            "os_type": "windows",
            "os_name": "WindowsOS",
            "os_version": "2.0",
            "hardware_requirement": {
                "cpunumber": 2,
                "cpuspeed": 2000,
                "memory": 2048,
                "rootdisksize": 50
            },
            "category": "GENERAL"
        }
    ]
}

Create Instance

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance
requires authentication

Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the created instance, use the List Instance endpoint and review the status field.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'service_offering_id' => '01H9ZCNF46W6C1EM45T21B6M0G',
            'vm_image_id' => '01H9ZCNF46W6C1EM45T21B6M0H',
            'network_ids' => [
                '01H9ZCNF46W6C1EM45T21B6M0N',
            ],
            'name' => 'my-instance',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Rebuild Instance

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/{instanceId}/rebuild
requires authentication

Rebuild an instance with a new VM image.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/01H9ZCNF46W6C1EM45T21B6M0I/rebuild';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'vm_image_id' => '01H9ZCNF46W6C1EM45T21B6M0H',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Start Instance

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/{instanceId}/start
requires authentication

Start a stopped instance.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/01H9ZCNF46W6C1EM45T21B6M0I/start';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Stop Instance

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/{instanceId}/stop
requires authentication

Stop a running instance.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/01H9ZCNF46W6C1EM45T21B6M0I/stop';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'forced' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Reboot Instance

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/{instanceId}/reboot
requires authentication

Reboot a running instance.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/01H9ZCNF46W6C1EM45T21B6M0I/reboot';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Snapshots


Create Snapshot

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/{instanceId}/snapshot
requires authentication

Note: This function creates a snapshot for a specific instance.

{
  "data": {
      "id": "string",
      "name": "string",
      "status": "string",
      "created_at": 1234567890
  }
}

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/01H9ZCNF46W6C1EM45T21B6M0I/snapshot';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V6',
            'name' => 'my-snapshot',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01H9ZCNF46W6C1EM45T21B6M0S",
        "name": "my-snapshot",
        "status": "CREATING",
        "created_at": 1712345678
    }
}

Delete Snapshot

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/instance/{instanceId}/snapshot/{snapshotId}
requires authentication

Note: This function deletes a snapshot for a specific instance.

{
  "data": {
      "success": true
  }
}

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I
snapshotId
ulid
required

The ID of the snapshot.

Example:
01H9ZCNF46W6C1EM45T21B6M0S
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/01H9ZCNF46W6C1EM45T21B6M0I/snapshot/01H9ZCNF46W6C1EM45T21B6M0S';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Revert Snapshot

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/{instanceId}/snapshot/revert
requires authentication

Note: This function reverts an instance to a specific snapshot.

{
  "data": {
      "success": true
  }
}

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I
snapshotId
ulid
required

The ID of the snapshot.

Example:
01H9ZCNF46W6C1EM45T21B6M0S
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/01H9ZCNF46W6C1EM45T21B6M0I/snapshot/revert';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Volumes


List Volume Service Offerings

GET
https://public-api.virakcloud.com
/zone/{zoneId}/instance/volumes/service-offering
requires authentication

List all volume service offerings available in the specified zone for the authenticated user.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/volumes/service-offering';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "size": "0",
            "price": "200",
            "name": "CustomeDiskOfferingAlborz",
            "description": "CustomeDiskOfferingAlborz",
            "is_public": true,
            "is_featured": false
        }
    ]
}

List Volumes

GET
https://public-api.virakcloud.com
/zone/{zoneId}/instance/volumes
requires authentication

List all volumes for the authenticated user in the specified zone.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/volumes';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "01H9ZCNF46W6C1EM45T21B6M0V",
            "name": "volume-1",
            "size": 50,
            "status": "available"
        }
    ]
}

Create Volume

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/volumes
requires authentication

Create a new volume in the specified zone.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/volumes';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'service_offering_id' => '01H9ZCNF46W6C1EM45T21B6M0G',
            'size' => 50,
            'name' => 'my-volume',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01H9ZCNF46W6C1EM45T21B6M0V",
        "name": "my-volume",
        "size": 50,
        "status": "CREATING"
    }
}

Delete Volume

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/instance/volumes/{volumeId}
requires authentication

Delete a volume by its ID.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
volumeId
ulid
required

The ID of the volume.

Example:
01H9ZCNF46W6C1EM45T21B6M0V
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/volumes/01H9ZCNF46W6C1EM45T21B6M0V';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Detach Volume

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/volumes/{volumeId}/detach
requires authentication

Detach a volume from an instance.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
volumeId
ulid
required

The ID of the volume.

Example:
01H9ZCNF46W6C1EM45T21B6M0V

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/volumes/01H9ZCNF46W6C1EM45T21B6M0V/detach';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_id' => '01H9ZCNF46W6C1EM45T21B6M0I',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Attach Volume

POST
https://public-api.virakcloud.com
/zone/{zoneId}/instance/volumes/{volumeId}/attach/{instanceId}
requires authentication

Attach a volume to an instance.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
volumeId
ulid
required

The ID of the volume.

Example:
01H9ZCNF46W6C1EM45T21B6M0V
instanceId
ulid
required

The ID of the instance.

Example:
01H9ZCNF46W6C1EM45T21B6M0I
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/instance/volumes/01H9ZCNF46W6C1EM45T21B6M0V/attach/01H9ZCNF46W6C1EM45T21B6M0I';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Network

The Firewall API provides a way to manage and enforce network security rules for your infrastructure. It allows you to control the flow of incoming (ingress) and outgoing (egress) traffic based on IP addresses, protocols, and ports.

Key Concepts:

  • Firewall Rule: A specific directive that allows or denies traffic. Each rule targets a specific protocol and can define source/destination IPs and port ranges.
  • Traffic Type:
    • Ingress: Traffic coming into your network.
    • Egress: Traffic going out from your network.
  • Protocol: The network protocol the rule applies to. Common protocols include:
    • TCP (Transmission Control Protocol): Used for reliable, ordered, and error-checked delivery of a stream of octets (e.g., web browsing, email).
    • UDP (User Datagram Protocol): A simpler, connectionless protocol used when speed is prioritized over reliability (e.g., video streaming, DNS).
    • ICMP (Internet Control Message Protocol): Used by network devices to send error messages and operational information (e.g., ping).
  • CIDR (Classless Inter-Domain Routing): A method for allocating IP addresses and for IP routing. It's used to specify a range of IP addresses (e.g., 192.168.1.0/24). Use 0.0.0.0/0 for all IPv4 addresses.

Networks


Create L2 Network

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/l2
requires authentication

Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the created network, use the List Network endpoint.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/l2';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'network_offering_id' => '01H9ZCNF46W6C1EM45T21B6M0G',
            'name' => 'my-l2-network',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}
{
    "message": "The network offering id field is required.",
    "errors": {
        "network_offering_id": [
            "The network offering id field is required."
        ]
    }
}

Create L3 Network

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/l3
requires authentication

Creates a new Layer 3 (L3) network in the specified zone. For network_offering_id, use the ID of a service offering with type Isolated.

Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }
To check the status of the created network, use the List Networks endpoint and review the status field.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/l3';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'network_offering_id' => '01H9ZCNF46W6C1EM45T21B6M0G',
            'name' => 'my-l3-network',
            'getaway' => '192.168.1.1',
            'netmask' => '255.255.255.0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}
{
    "message": "The getaway field is required.",
    "errors": {
        "getaway": [
            "The getaway field is required."
        ]
    }
}

List Networks

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network
requires authentication

Retrieves a list of all networks in the specified zone for the authenticated customer.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "network_id_1",
            "name": "network-1",
            "status": "Implemented",
            "ip_config": [],
            "ip_config_v6": [],
            "network_offering": {
                "id": "offering_id_1",
                "name": "Offering1",
                "displayname": "Offering1",
                "displayname_fa": "Offering1",
                "hourly_started_price": 0,
                "traffic_transfer_overprice": 0,
                "traffic_transfer_plan": 1000,
                "networkrate": 200,
                "type": "Shared",
                "description": "",
                "internet_protocol": "IPv4"
            },
            "instance_network": []
        },
        {
            "id": "network_id_2",
            "name": "network-2",
            "status": "Implemented",
            "ip_config": {
                "gateway": "10.0.0.1",
                "netmask": "255.255.255.0"
            },
            "ip_config_v6": {
                "gateway_v6": null,
                "netmask_v6": null,
                "route_gateway_v6": null,
                "route_subnet_v6": null
            },
            "network_offering": {
                "id": "offering_id_2",
                "name": "Offering2",
                "displayname": "Offering2",
                "displayname_fa": "Offering2",
                "hourly_started_price": 10,
                "traffic_transfer_overprice": 1,
                "traffic_transfer_plan": 1000,
                "networkrate": 250,
                "type": "Isolated",
                "description": "Offering2",
                "internet_protocol": "IPv4"
            },
            "instance_network": [
                {
                    "id": "instance_network_id_1",
                    "ipaddress": "10.0.0.52",
                    "ipaddress_v6": null,
                    "macaddress": "02:01:04:5e:00:04",
                    "is_default": true,
                    "created_at": "2025-06-29T09:00:00.000000Z",
                    "secondary_ips": []
                }
            ]
        }
    ]
}

Show Network

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}
requires authentication

Retrieves details of a specific network by its ID in the specified zone.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "network_id_anon",
        "name": "network-anonymous",
        "status": "Allocated",
        "ip_config": {
            "gateway": "192.0.2.1",
            "netmask": "255.255.255.0"
        },
        "ip_config_v6": {
            "gateway_v6": null,
            "netmask_v6": null,
            "route_gateway_v6": null,
            "route_subnet_v6": null
        },
        "network_offering": {
            "id": "offering_id_anon",
            "name": "OfferingAnon",
            "displayname": "OfferingAnon",
            "displayname_fa": "OfferingAnon",
            "hourly_started_price": 0,
            "traffic_transfer_overprice": 0,
            "traffic_transfer_plan": 1000,
            "networkrate": 100,
            "type": "Isolated",
            "description": "Anonymous offering",
            "internet_protocol": "IPv4"
        },
        "instance_network": []
    }
}

Delete Network

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}
requires authentication

Deletes a specific network by its ID in the specified zone.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Instance

Manage instance connections to networks, including connecting, disconnecting, and listing connected instances.


Connect Instance to a network

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/instance/connect
requires authentication

Requires appropriate network:instance:connect ability for API token Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
tempora
networkId
ulid
required

The ID of the network.

Example:
exercitationem

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/tempora/network/exercitationem/instance/connect';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V7',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Disconnect Instance to a network

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/instance/disconnect
requires authentication

Requires appropriate network:instance:disconnect ability for API token Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
veritatis
networkId
ulid
required

The ID of the network.

Example:
voluptas

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/veritatis/network/voluptas/instance/disconnect';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_network_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V7',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

connected instances of network

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/instance
requires authentication

Requires appropriate network:instance:show ability for API token

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
cumque
networkId
ulid
required

The ID of the network.

Example:
impedit

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/cumque/network/impedit/instance';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V7',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "instance_network_id",
            "instance_id": "instance_id",
            "instance_name": "instance_name",
            "ipaddress": "ip_address_v4",
            "ipaddress_v6": "ip_address_v6",
            "macaddress": "mac_address",
            "is_default": true,
            "created_at": 1234567890,
            "network": {
                "id": "network_id",
                "name": "network_name",
                "ip_config": [],
                "ip_config_v6": []
            },
            "network_offering": {
                "id": "network_offering_id",
                "name": "network_offering_name",
                "displayname": "network_offering_displayname",
                "displayname_fa": "network_offering_displayname_fa",
                "hourly_started_price": 0,
                "traffic_price_per_gig": 0,
                "traffic_transfer_free_gig": 1000,
                "networkrate": 200,
                "type": "network_type",
                "description": "network_description",
                "internet_protocol": "internet_protocol"
            },
            "secondary_ips": []
        }
    ]
}

Firewall Rules


List IPv4 Firewall Rules

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/firewall/ipv4
requires authentication

Retrieves a list of all IPv4 firewall rules associated with a specific network.

  • id: Unique identifier for the firewall rule.
  • network_public_ip_id: The public IP address associated with the rule (if any).
  • protocol: Network protocol (e.g., TCP, UDP, ICMP).
  • traffic_type: Direction of traffic (Ingress for incoming, Egress for outgoing).
  • ip_source: Source IP or CIDR range.
  • ip_destination: Destination IP or CIDR range.
  • port_start: Starting port (for TCP/UDP protocols).
  • port_end: Ending port (for TCP/UDP protocols).
  • icmp_code: ICMP code (for ICMP protocol).
  • icmp_type: ICMP type (for ICMP protocol).
  • status: Current status of the rule (e.g., Active).
  • created_at: Timestamp when the rule was created.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network to fetch rules for.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/firewall/ipv4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "firewall-rule-id",
            "network_public_ip_id": "ip-public-id",
            "protocol": "ICMP",
            "traffic_type": "Ingress",
            "ip_source": "0.0.0.0/0",
            "ip_destination": "192.168.61.58",
            "port_start": null,
            "port_end": null,
            "icmp_code": null,
            "icmp_type": null,
            "status": "Active",
            "created_at": "2025-06-30T13:15:35.000000Z"
        },
        {
            "id": "firewall-rule-id",
            "network_public_ip_id": null,
            "protocol": "UDP",
            "traffic_type": "Egress",
            "ip_source": "192.168.1.0/24",
            "ip_destination": "0.0.0.0/0",
            "port_start": "0",
            "port_end": "65535",
            "icmp_code": null,
            "icmp_type": null,
            "status": "Active",
            "created_at": "2025-06-30T13:15:29.000000Z"
        }
    ]
}
{
    "message": "The network id field is required.",
    "errors": {
        "network_id": [
            "The network id field is required."
        ]
    }
}

Create IPv4 Firewall Rule

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/firewall/ipv4
requires authentication

Creates a new firewall rule for IPv4 traffic on a given network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network to fetch rules for.

Example:
01H9ZCNF46W6C1EM45T21B6M0G

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/firewall/ipv4';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'traffic_type' => 'Ingress',
            'protocol_type' => 'TCP',
            'public_ip_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V8',
            'ip_source' => '192.168.1.10',
            'ip_destination' => '10.0.0.5',
            'port_start' => 80,
            'port_end' => 81,
            'icmp_code' => 0,
            'icmp_type' => 8,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}
{
    "message": "The network id field is required."
}
{
    "message": "The traffic type field is required."
}
{
    "message": "The protocol type field is required."
}
{
    "message": "The ip source must be a valid CIDR address."
}

Delete IPv4 Firewall Rule

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/firewall/ipv4/{ruleId}
requires authentication

Deletes a specific IPv4 firewall rule by its ID.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network to fetch rules for.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
ruleId
ulid
required

The ID of the firewall rule to delete.

Example:
01H9ZCPF46W6C1EM45T21B6M0H
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/firewall/ipv4/01H9ZCPF46W6C1EM45T21B6M0H';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

List IPv6 Firewall Rules

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/firewall/ipv6
requires authentication

Retrieves a list of all IPv6 firewall rules associated with a specific network.

  • id: Unique identifier for the firewall rule.
  • protocol: Network protocol (e.g., TCP, UDP, ICMP).
  • traffic_type: Direction of traffic (Ingress for incoming, Egress for outgoing).
  • ip_source: Source IPv6 or CIDR range.
  • ip_destination: Destination IPv6 or CIDR range.
  • port_start: Starting port (for TCP/UDP protocols).
  • port_end: Ending port (for TCP/UDP protocols).
  • icmp_code: ICMP code (for ICMP protocol).
  • icmp_type: ICMP type (for ICMP protocol).
  • status: Current status of the rule (e.g., Active).
  • created_at: Timestamp when the rule was created.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network to fetch rules for.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/firewall/ipv6';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "firewall-rule-id-1",
            "protocol": "ICMP",
            "traffic_type": "Ingress",
            "ip_source": "::/0",
            "ip_destination": "::/0",
            "port_start": null,
            "port_end": null,
            "icmp_code": null,
            "icmp_type": null,
            "status": "Active",
            "created_at": "2025-06-30T14:35:07.000000Z"
        }
    ]
}
{
    "message": "The network id field is required.",
    "errors": {
        "network_id": [
            "The network id field is required."
        ]
    }
}

Create IPv6 Firewall Rule

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/firewall/ipv6
requires authentication

Creates a new firewall rule for IPv6 traffic on a given network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network to fetch rules for.

Example:
01H9ZCNF46W6C1EM45T21B6M0G

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/firewall/ipv6';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'traffic_type' => 'Ingress',
            'protocol_type' => 'TCP',
            'ip_source' => '2001:db8::1',
            'ip_destination' => '2001:db8::2',
            'port_start' => 80,
            'port_end' => 81,
            'icmp_code' => 0,
            'icmp_type' => 128,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Delete IPv6 Firewall Rule

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/firewall/ipv6/{ruleId}
requires authentication

Deletes a specific IPv6 firewall rule by its ID.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network to fetch rules for.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
ruleId
ulid
required

The ID of the firewall rule to delete.

Example:
01H9ZCPF46W6C1EM45T21B6M0H
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/firewall/ipv6/01H9ZCPF46W6C1EM45T21B6M0H';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}
{
    "message": "The id field is required."
}

Public IP


List Public IP Instances

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/public-ip
requires authentication

List all public IPs associated with a network in a zone.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/public-ip';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "01JZYQKPXBKGC08BNV5Z23BRE2",
            "network_id": "01H9ZCNF46W6C1EM45T21B6M0G",
            "ipaddress": "192.168.1.71",
            "is_sourcenat": true,
            "created_at": 1752304311,
            "staticnat_enable": false,
            "staticnat": []
        },
        {
            "id": "01JZYQQA8V0EYT80J02N717NBW",
            "network_id": "01H9ZCNF46W6C1EM45T21B6M0G",
            "ipaddress": "192.168.1.60",
            "is_sourcenat": false,
            "created_at": 1752304429,
            "staticnat_enable": false,
            "staticnat": []
        }
    ]
}

Associate Public IP

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/public-ip
requires authentication

Associate a new public IP address to a network. Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the created public ip, use the List Public IPs endpoint and review.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
doloremque
networkId
ulid
required

The ID of the network.

Example:
dolorem
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/doloremque/network/dolorem/public-ip';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Disassociate Public IP

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/public-ip/{networkPublicIpId}
requires authentication

Disassociate a public IP address from a network. Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the created public ip, use the List Public IPs endpoint and review.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
illum
networkId
ulid
required

The ID of the network.

Example:
repellat
networkPublicIpId
ulid
required

The ID of the public IP.

Example:
non
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/illum/network/repellat/public-ip/non';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Enable Static NAT

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/public-ip/{networkPublicIpId}/static-nat
requires authentication

Enable static NAT for a public IP. Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the created public ip, use the List Public IPs endpoint and review.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
sapiente
networkId
ulid
required

The ID of the network.

Example:
velit
networkPublicIpId
ulid
required

The ID of the public IP.

Example:
at

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/sapiente/network/velit/public-ip/at/static-nat';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_id' => 'ut',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Disable Static NAT

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/public-ip/{networkPublicIpId}/static-nat
requires authentication

Disable static NAT for a public IP. Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the created public ip, use the List Public IPs endpoint and review.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
culpa
networkId
ulid
required

The ID of the network.

Example:
tenetur
networkPublicIpId
ulid
required

The ID of the public IP.

Example:
quis
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/culpa/network/tenetur/public-ip/quis/static-nat';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Port Forward


List Port Forward Rules

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/port-forward/{networkPublicIpId}
requires authentication

Get a list of port forward rules for a network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required

The zone ULID.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
networkId
string
required

The network ULID.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
networkPublicIpId
ulid
required

The ID of the public IP.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/network/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/port-forward/01HZYKJ8QK8ZJ6K8J6K8J6K8J6';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'public_ip_id' => 'culpa',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "01jz0pkxe7phb41cchw1hpk6dt",
            "instance_ipaddress": "192.168.1.103",
            "network_public_ip": {
                "id": "01jz0m8znysysxak6vhk8zfy9m",
                "network_id": "01jz0m6cwk2m7jz67x5krjwgct",
                "ipaddress": "193.246.200.17",
                "is_sourcenat": true,
                "created_at": "2025-06-30T14:36:21.000000Z",
                "staticnat": []
            },
            "network": {
                "id": "01jz0m6cwk2m7jz67x5krjwgct",
                "name": "test-for-firewall-ipv6",
                "status": "Implementing",
                "ip_config": {
                    "gateway": "192.168.1.1",
                    "netmask": "255.255.255.0"
                },
                "ip_config_v6": {
                    "gateway_v6": "2a04:acc0:18:61d8::1",
                    "netmask_v6": "2a04:acc0:18:61d8::/64",
                    "route_gateway_v6": "2001:470:1f08:a27:1c00:fcff:fe00:75",
                    "route_subnet_v6": "2a04:acc0:18:61d8::/64"
                },
                "network_offering": {
                    "id": "01he2s0n9ywg5yepr7vezjqtkf",
                    "name": "ipv6",
                    "displayname": "روتر مجازی با آیپی ورژن ۶",
                    "displayname_fa": "ipv6",
                    "hourly_started_price": 10000,
                    "traffic_transfer_overprice": 1000,
                    "traffic_transfer_plan": 1,
                    "networkrate": 250,
                    "type": "Isolated",
                    "description": "",
                    "internet_protocol": "DualStack"
                }
            },
            "instance": {
                "id": "01jz0m8z7ge1m0yqmnjyyvnpn4",
                "instance_cs_id": "b28049a1-5f13-4950-b6e5-c5c926e10cc9",
                "ipaddress": "192.168.1.103",
                "ipaddress_v6": "2a04:acc0:18:61d8:0:70ff:fe04:1",
                "macaddress": "02:00:70:04:00:01",
                "is_default": false,
                "created_at": "2025-06-30T14:36:20.000000Z",
                "secondary_ips": []
            },
            "protocol": "TCP",
            "port_start_public": 1,
            "port_end_public": 2,
            "port_start_private": 1,
            "port_end_private": 2,
            "status": "Active",
            "created_at": "2025-06-30T15:17:16.000000Z"
        }
    ]
}

Add Port Forward Rule

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/port-forward/{networkPublicIpId}
requires authentication

Add a new port forward rule to a network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required

The zone ULID.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
networkId
string
required

The network ULID.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
networkPublicIpId
ulid
required

The ID of the public IP.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/network/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/port-forward/01HZYKJ8QK8ZJ6K8J6K8J6K8J6';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'network_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V7',
            'public_ip_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V8',
            'protocol_type' => 'TCP',
            'instance_id' => '01HZYKJ8QK8ZJ6K8J6K8J6K8J6',
            'port_start_public' => 8080,
            'port_start_private' => 80,
            'port_end_public' => 10,
            'port_end_private' => 10,
            'instance_network_secondary_ip_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V9',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "success": true,
    "data": {
        "rule_id": "01HZYKJ8QK8ZJ6K8J6K8J6K8J6"
    }
}

Delete Port Forward Rule

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/port-forward/{networkPublicIpId}/{portforwardId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required

The zone ULID.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
networkId
string
required

The network ULID.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
networkPublicIpId
ulid
required

The ID of the public IP.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
portforwardId
string
required

The port forward rule ULID.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/network/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/port-forward/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/01HZYKJ8QK8ZJ6K8J6K8J6K8J6';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

VPN

VPN (Virtual Private Network) allows secure, encrypted connections over public networks. In this API, VPN endpoints enable users to manage VPN access for their networks.

Concept of VPN
VPNs provide privacy and security by tunneling traffic between endpoints. This is useful for remote access, secure communication, and bypassing network restrictions.
Usage

  • Enable or disable VPN for a specific network zone.
  • Update VPN credentials.
  • Retrieve current VPN credentials.
Credentials
The `show` endpoint returns L2TP VPN credentials for the specified network and zone.


VPN Detail

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/vpn
requires authentication

By Default L2TP/IPsec VPN is disable for all networks. You can use the credentials to connect to the VPN server. The credentials include an IP address, username, password, and pre-shared key (PSK).

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/vpn';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "ipaddress": "192.168.1.2",
        "username": "",
        "password": "",
        "presharedkey": "",
        "status": "Deactive"
    }
}

Enable VPN

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/vpn/enable
requires authentication

Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the enabled vpn and its credentials, use the VPN Details endpoint.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/vpn/enable';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Disable VPN

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/vpn/disable
requires authentication

Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the disabled vpn, use the VPN Details endpoint.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/vpn/disable';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Update VPN Credentials

PUT
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/vpn
requires authentication

Note: This function runs asynchronously in the background. The response will be:

{
    "data": {
        "success": true
    }
  }

To check the status of the new vpn credentials, use the VPN Details endpoint.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/vpn';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

LoadBalance

Load balancing distributes incoming network traffic across multiple servers to ensure no single server becomes overwhelmed, improving responsiveness and availability.


List Load Balancing Rules

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/load-balancer
requires authentication

Retrieves all load balancing rules for a network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/load-balancer';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "rule_id",
            "name": "lb-rule",
            "algorithm": "roundrobin",
            "public_port": 80,
            "private_port": 8080,
            "status": "Active"
        }
    ]
}

Add Load Balancing Rule

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/load-balancer/rule
requires authentication

Creates a new load balancing rule for a network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/load-balancer/rule';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'public_ip_id' => '01HZYKJ8QK8ZJ6K8J6K8J6K8J6',
            'name' => 'web-lb',
            'algorithm' => 'roundrobin',
            'public_port' => 80,
            'private_port' => 8080,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Delete Load Balancing Rule

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/load-balancer/rule/{loadBalanceRuleId}
requires authentication

Deletes a load balancing rule by its ID.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
loadBalanceRuleId
ulid
required

The ID of the load balancing rule.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/load-balancer/rule/01HZYKJ8QK8ZJ6K8J6K8J6K8J6';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

Assign Load Balancing Rule

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/load-balancer/rule/{loadBalanceRuleId}/assign
requires authentication

Assigns instances to a load balancing rule.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
loadBalanceRuleId
ulid
required

The ID of the load balancing rule.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/load-balancer/rule/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/assign';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_network_ids' => '["01HZYKJ8QK8ZJ6K8J6K8J6K8J6"]',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

De-Assign Load Balancing Rule

POST
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/load-balancer/rule/{loadBalanceRuleId}/de-assign
requires authentication

Removes an instance from a load balancing rule.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
loadBalanceRuleId
ulid
required

The ID of the load balancing rule.

Example:
01HZYKJ8QK8ZJ6K8J6K8J6K8J6

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/load-balancer/rule/01HZYKJ8QK8ZJ6K8J6K8J6K8J6/de-assign';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'instance_network_id' => '01HZYKJ8QK8ZJ6K8J6K8J6K8J6',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}

HAProxy Live Report

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/ha/live
requires authentication

Retrieves live HAProxy statistics for the network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/ha/live';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "updated_at": 1752566580,
        "rules": []
    }
}

HAProxy Log Report

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/{networkId}/ha/log
requires authentication

Retrieves HAProxy logs for the network.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
networkId
ulid
required

The ID of the network.

Example:
01H9ZCNF46W6C1EM45T21B6M0G
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/01H9ZCNF46W6C1EM45T21B6M0G/ha/log';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": []
}

Offerings


List Network Offering

GET
https://public-api.virakcloud.com
/zone/{zoneId}/network/service-offering
requires authentication


Response fields:

  • id: Unique identifier of the network offering.
  • name: Internal name of the network offering.
  • displayname: Display name (EN).
  • displayname_fa: Display name (FA).
  • hourly_started_price: Cost per hour in Toman.
  • traffic_transfer_overprice: Price of each extra gigabyte of traffic (Toman).
  • traffic_transfer_free_gig: Free network transfer in gigabytes.
  • networkrate: Network bandwidth in megabits per second (Mbps).
  • type: Network type. Shared (default network), L2 (Layer 2 switch network), or Isolated (Layer 3 switch network).
  • description: Description of the network offering.
  • internet_protocol: Can be DualStack (IPv6 & IPv4) or IPv4.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/network/service-offering';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "offering_id_1",
            "name": "OfferingL2",
            "displayname": "Offering L2",
            "displayname_fa": "آفرینگ L2",
            "hourly_started_price": 5,
            "traffic_transfer_overprice": 0,
            "traffic_transfer_plan": 500,
            "networkrate": 100,
            "type": "L2",
            "description": "L2 network offering",
            "internet_protocol": "IPv4"
        },
        {
            "id": "offering_id_2",
            "name": "OfferingIsolated",
            "displayname": "Offering Isolated",
            "displayname_fa": "آفرینگ ایزوله",
            "hourly_started_price": 8,
            "traffic_transfer_overprice": 2,
            "traffic_transfer_plan": 800,
            "networkrate": 200,
            "type": "Isolated",
            "description": "Isolated network offering",
            "internet_protocol": "DualStack"
        }
    ]
}

Kubernetes

Kubernetes is an open-source platform designed for managing containerized workloads and services. It provides a powerful and flexible way to deploy, scale, and manage applications across a cluster of machines. Think of it as an operating system for your cloud-native applications.

Key Concepts:

  • Containers: Applications are packaged into containers, which are lightweight, standalone, and executable packages that include everything needed to run a piece of software (code, runtime, system tools, libraries, settings).
  • Nodes: A Kubernetes cluster consists of a set of worker machines, called nodes, that run containerized applications. Every cluster has at least one worker node.
  • Control Plane: The control plane manages the worker nodes and the Pods in the cluster. In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault-tolerance and high availability.
  • Pods: Pods are the smallest deployable units of computing that you can create and manage in Kubernetes. A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage/network resources, and a specification for how to run the containers.

Cluster Statuses:

Each cluster can be in one of the following statuses, indicating its current operational state:

  • Pending: The cluster is being created and is not yet ready for use.
  • Deleting: The cluster is in the process of being deleted.
  • Deleted: The cluster has been successfully deleted.
  • Started: The cluster is running and ready to accept workloads.
  • Stopped: The cluster has been stopped and is not currently running.
  • Failed: An error occurred in the cluster, and it is not operational.
  • Alert: An issue has been detected with the cluster that requires attention.
  • Stopping: The cluster is in the process of being stopped.
  • Starting: The cluster is in the process of starting up.
  • Running: The cluster is operational and running normally.
  • Upgrading: The cluster's Kubernetes version is being upgraded.
  • Scaling: The number of nodes in the cluster is being adjusted.
  • UpdateServiceOffering: The service offering (e.g., hardware configuration) of the cluster is being changed.
  • Suspend: The cluster is in suspend state.
  • Suspending: The cluster is in suspending process.
  • UnSuspending: The cluster is in UnSuspending process.

Cluster


Index

GET
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "01F8MECHZX3TBDSZ7XRADM79XE",
            "name": "example-cluster",
            "description": "This is a test cluster",
            "zone_id": "zone-id",
            "status": "Running",
            "kubernetes_version": {
                "id": "k8s-version-id",
                "version": "1.26.14",
                "enabled": true,
                "min_cpu": 2,
                "min_memory": 2048
            },
            "service_offering": {
                "id": "service-offering-id",
                "name": "service-offering-name",
                "hourly_price": {
                    "up": 100,
                    "down": 100
                },
                "hardware": {
                    "cpu_core": 4,
                    "memory_mb": 4096,
                    "cpu_speed_MHz": 2300,
                    "root_disk_size_gB": 50,
                    "network_rate": 980,
                    "disk_iops": 2500
                }
            },
            "ssh_key": "ssh-ed25519 ...",
            "ha_enabled": false,
            "cluster_size": 1,
            "created_at": 1737794395,
            "updated_at": 1737794395
        }
    ]
}

Create

POST
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes
requires authentication

Note: This function runs asynchronously in the background. The response will be:

{
   "data": {
       "success": true
   }
 }

To check the status of the created cluster, use the List Cluster endpoint and review the status field.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'my-k8s-cluster',
            'kubernetes_version_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V6',
            'service_offering_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V7',
            'ha_enabled' => false,
            'sshkey_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V7',
            'network_id' => '01F8MECHZX3RZ8Y6B8Q5F1E3V5',
            'description' => 'This is a test Kubernetes cluster.',
            'cluster_size' => 3,
            'private_registry' => [
                'username' => 'my-username',
                'password' => 'my-password',
                'url' => 'https://my-private-registry.com',
            ],
            'ha_config' => [
                'controller_nodes' => 3,
                'external_loadbalancer_ip' => '192.0.2.1',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}
{
    "message": "The name field is required.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}
{
    "message": "The kubernetes version id field is required.",
    "errors": {
        "kubernetes_version_id": [
            "The kubernetes version id field is required."
        ]
    }
}
{
    "message": "The service offering id field is required.",
    "errors": {
        "service_offering_id": [
            "The service offering id field is required."
        ]
    }
}
{
    "message": "The ha enabled field is required.",
    "errors": {
        "ha_enabled": [
            "The ha enabled field is required."
        ]
    }
}
{
    "message": "The ssh key field is required.",
    "errors": {
        "ssh_key": [
            "The ssh key field is required."
        ]
    }
}
{
    "message": "The network id field is required.",
    "errors": {
        "network_id": [
            "The network id field is required."
        ]
    }
}
{
    "message": "The selected kubernetes version id is invalid.",
    "errors": {
        "kubernetes_version_id": [
            "The selected kubernetes version id is invalid."
        ]
    }
}
{
    "message": "The selected service offering id is invalid.",
    "errors": {
        "service_offering_id": [
            "The selected service offering id is invalid."
        ]
    }
}
{
    "message": "The selected network id is invalid.",
    "errors": {
        "network_id": [
            "The selected network id is invalid."
        ]
    }
}
{
    "message": "The kubernetes version id field is required.",
    "errors": {
        "kubernetes_version_id": [
            "The required CPU (cpu core) exceeds the customer's limit (in core count)."
        ]
    }
}
{
    "message": "The kubernetes version id field is required.",
    "errors": {
        "kubernetes_version_id": [
            "The required memory (memory MB) exceeds the customer's limit (in MB)."
        ]
    }
}
{
    "message": "The kubernetes version id field is required.",
    "errors": {
        "kubernetes_version_id": [
            "The required primary storage (disk GB) exceeds the customer's limit (in GB)."
        ]
    }
}
{ "message": "The kubernetes version id field is required.", "errors": { "kubernetes_version_id": [ "The required VMs (vms) exceeds the customer's limit (VM number).

Show

GET
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "name": "example-cluster",
        "description": "This is a test cluster",
        "zone_id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "status": "Running",
        "kubernetes_version": {
            "id": "k8s-version-id",
            "version": "1.26.14",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        },
        "service_offering": {
            "id": "service-offering-id",
            "name": "service-offering-name",
            "is_public": true,
            "is_available": true,
            "hourly_price": {
                "up": 100,
                "down": 100
            },
            "hardware": {
                "cpu_core": 4,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2300,
                "root_disk_size_gB": 50,
                "network_rate": 980,
                "disk_iops": 2500
            }
        },
        "ssh_key": "ssh-ed25519 ...",
        "ha_enabled": false,
        "cluster_size": 1,
        "created_at": 1737794395,
        "updated_at": 1737794395
    }
}

Events

GET
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}/events
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE/events';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'system',
            'from' => 1707653422,
            'to' => 1707653999,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
        "data": [
            {
                "product_model": "App\Models\KubernetesCluster",
                "product_id": "01F8MECHZX3TBDSZ7XRADM79XE",
                "product_source": "k8s",
                "type": "customer",
                "content": "A kubernetes cluster event occurred.",
                "created_at": 1739256828
            },
        ],
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 10,
            "per_page": 20,
            "to": 20,
            "total": 200
        }
}

Update

PUT
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'magni',
            'description' => 'Aut modi quae corrupti praesentium.',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "name": "example-cluster",
        "description": "This is a test cluster",
        "zone_id": "zone-id",
        "status": "Running",
        "kubernetes_version": {
            "id": "k8s-version-id",
            "version": "1.26.14",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        },
        "service_offering": {
            "id": "service-offering-id",
            "name": "service-offering-name",
            "is_public": true,
            "is_available": true,
            "hourly_price": {
                "up": 100,
                "down": 100
            },
            "hardware": {
                "cpu_core": 4,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2300,
                "root_disk_size_gB": 50,
                "network_rate": 980,
                "disk_iops": 2500
            }
        },
        "ssh_key": "ssh-ed25519 ...",
        "ha_enabled": false,
        "cluster_size": 1,
        "created_at": 1737794395,
        "updated_at": 1737794395
    }
}
{
    "message": "The name field must be a string.",
    "errors": {
        "name": [
            "The name field must be a string."
        ]
    }
}
{
    "message": "The description field must be a string.",
    "errors": {
        "description": [
            "The description field must be a string."
        ]
    }
}

Delete

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "message": "Kubernetes cluster deleted successfully"
}

Start

POST
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}/start
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE/start';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "name": "example-cluster",
        "description": "This is a test cluster",
        "zone_id": "zone-id",
        "status": "Starting",
        "kubernetes_version": {
            "id": "k8s-version-id",
            "version": "1.26.14",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        },
        "service_offering": {
            "id": "service-offering-id",
            "name": "service-offering-name",
            "is_public": true,
            "is_available": true,
            "hourly_price": {
                "up": 100,
                "down": 100
            },
            "hardware": {
                "cpu_core": 4,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2300,
                "root_disk_size_gB": 50,
                "network_rate": 980,
                "disk_iops": 2500
            }
        },
        "ssh_key": "ssh-ed25519 ...",
        "ha_enabled": false,
        "cluster_size": 1,
        "created_at": 1737794395,
        "updated_at": 1737794395
    }
}

Stop

POST
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}/stop
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE/stop';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "name": "example-cluster",
        "description": "This is a test cluster",
        "zone_id": "zone-id",
        "status": "Running",
        "kubernetes_version": {
            "id": "k8s-version-id",
            "version": "1.26.14",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        },
        "service_offering": {
            "id": "service-offering-id",
            "name": "service-offering-name",
            "is_public": true,
            "is_available": true,
            "hourly_price": {
                "up": 100,
                "down": 100
            },
            "hardware": {
                "cpu_core": 4,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2300,
                "root_disk_size_gB": 50,
                "network_rate": 980,
                "disk_iops": 2500
            }
        },
        "ssh_key": "ssh-ed25519 ...",
        "ha_enabled": false,
        "cluster_size": 1,
        "created_at": 1737794395,
        "updated_at": 1737794395
    }
}

Scale

POST
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}/scale
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE/scale';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'auto_scaling' => false,
            'cluster_size' => 3,
            'min_cluster_size' => 1,
            'max_cluster_size' => 5,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "name": "example-cluster",
        "description": "This is a test cluster",
        "zone_id": "zone-id",
        "status": "Scaling",
        "kubernetes_version": {
            "id": "k8s-version-id",
            "version": "1.26.14",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        },
        "service_offering": {
            "id": "service-offering-id",
            "name": "service-offering-name",
            "is_public": true,
            "is_available": true,
            "hourly_price": {
                "up": 100,
                "down": 100
            },
            "hardware": {
                "cpu_core": 4,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2300,
                "root_disk_size_gB": 50,
                "network_rate": 980,
                "disk_iops": 2500
            }
        },
        "ssh_key": "ssh-ed25519 ...",
        "ha_enabled": false,
        "cluster_size": 1,
        "created_at": 1737794395,
        "updated_at": 1737794395
    }
}
{
    "message": "The auto scaling field is required.",
    "errors": {
        "auto_scaling": [
            "The auto scaling field is required."
        ]
    }
}
{
    "message": "The auto scaling field must be true or false.",
    "errors": {
        "auto_scaling": [
            "The auto scaling field must be true or false."
        ]
    }
}
{
    "message": "The cluster size field is required when auto scaling is false.",
    "errors": {
        "cluster_size": [
            "The cluster size field is required when auto scaling is false."
        ]
    }
}
{
    "message": "The cluster size must be an integer.",
    "errors": {
        "cluster_size": [
            "The cluster size must be an integer."
        ]
    }
}
{
    "message": "The min cluster size field is required when auto scaling is true.",
    "errors": {
        "min_cluster_size": [
            "The min cluster size field is required when auto scaling is true."
        ]
    }
}
{
    "message": "The min cluster size must be an integer.",
    "errors": {
        "min_cluster_size": [
            "The min cluster size must be an integer."
        ]
    }
}
{
    "message": "The max cluster size field is required when auto scaling is true.",
    "errors": {
        "max_cluster_size": [
            "The max cluster size field is required when auto scaling is true."
        ]
    }
}
{
    "message": "The max cluster size must be an integer.",
    "errors": {
        "max_cluster_size": [
            "The max cluster size must be an integer."
        ]
    }
}

Update Service Offering

POST
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}/service-offering
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE/service-offering';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'service_offering_id' => '01F8MECHZX3TBDSZ7XRADM79XE',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "name": "example-cluster",
        "description": "This is a test cluster",
        "zone_id": "zone-id",
        "status": "Running",
        "kubernetes_version": {
            "id": "k8s-version-id",
            "version": "1.26.14",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        },
        "service_offering": {
            "id": "service-offering-id",
            "name": "service-offering-name",
            "is_public": true,
            "is_available": true,
            "hourly_price": {
                "up": 100,
                "down": 100
            },
            "hardware": {
                "cpu_core": 4,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2300,
                "root_disk_size_gB": 50,
                "network_rate": 980,
                "disk_iops": 2500
            }
        },
        "ssh_key": "ssh-ed25519 ...",
        "ha_enabled": false,
        "cluster_size": 1,
        "created_at": 1737794395,
        "updated_at": 1737794395
    }
}

Upgrade Version

POST
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/{clusterId}/upgrade
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
clusterId
ulid
required

The ID of the cluster.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/01F8MECHZX3TBDSZ7XRADM79XE/upgrade';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'new_kubernetes_version_id' => '01F8MECHZX3TBDSZ7XRADM79XE',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "01F8MECHZX3TBDSZ7XRADM79XE",
        "name": "example-cluster",
        "description": "This is a test cluster",
        "zone_id": "zone-id",
        "status": "Running",
        "kubernetes_version": {
            "id": "k8s-version-id",
            "version": "1.26.14",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        },
        "service_offering": {
            "id": "service-offering-id",
            "name": "service-offering-name",
            "is_public": true,
            "is_available": true,
            "hourly_price": {
                "up": 100,
                "down": 100
            },
            "hardware": {
                "cpu_core": 4,
                "memory_mb": 4096,
                "cpu_speed_MHz": 2300,
                "root_disk_size_gB": 50,
                "network_rate": 980,
                "disk_iops": 2500
            }
        },
        "ssh_key": "ssh-ed25519 ...",
        "ha_enabled": false,
        "cluster_size": 1,
        "created_at": 1737794395,
        "updated_at": 1737794395
    }
}

Kubernetes Service Events

GET
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/events
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/events';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'system',
            'from' => 1707653422,
            'to' => 1707653999,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
        "data": [
            {
                "product_model": "App\Models\KubernetesCluster",
                "product_id": "01F8MECHZX3TBDSZ7XRADM79XE",
                "product_source": "k8s",
                "type": "customer",
                "content": "A kubernetes cluster event occurred.",
                "created_at": 1739256828
            },
        ],
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 10,
            "per_page": 20,
            "to": 20,
            "total": 200
        }
}

Kubernetes Versions


List Kubernetes Versions

GET
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/versions
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/versions';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "01jetc3f8f218krnm9hwh46j8d",
            "version": "1.30.3",
            "enabled": true,
            "min_cpu": 2,
            "min_memory": 2048
        }
    ]
}

Service Offerings


List Service Offerings

GET
https://public-api.virakcloud.com
/zone/{zoneId}/kubernetes/service-offerings
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/kubernetes/service-offerings';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
        "data": [
            {
                "id": "01hytvspdx8rzae97ba2qc8fvs",
                "name": "n04-04-050-980-v3",
                "is_public": true,
                "is_available": true,
                "hourly_price": {
                    "up": 100,
                    "down": 100
                },
                "hourly_price_no_discount": {
                    "up": 100,
                    "down": 100
                },
                "description": null,
                "hardware": {
                    "cpu_core": 4,
                    "memory_mb": 4096,
                    "cpu_speed_MHz": 2300,
                    "root_disk_size_gB": 50,
                    "network_rate": 980,
                    "disk_iops": 2500
                }
            },
            // Additional service offerings...
        ]
    }

Object Storage

Object storage is a data storage architecture that manages data as objects, as opposed to other storage architectures like file systems which manage data as a file hierarchy, and block storage which manages data as blocks within sectors and tracks. Each object typically includes the data itself, a variable amount of metadata, and a globally unique identifier.

Key Concepts:

  • Buckets: Buckets are containers for storing objects. A bucket is similar to a folder in a file system, except that buckets cannot be nested.
  • Objects: Objects are the fundamental entities stored in object storage. An object consists of data (any sequence of bytes) and metadata (information about the object, such as its name, size, and content type).
  • Access Keys & Secret Keys: Object storage is typically accessed using an access key and a secret key, which are similar to a username and password. These keys are used to authenticate requests to the object storage service.
  • Policies: Bucket policies define who has access to a bucket and what actions they can perform. Common policies include "Private" (only the owner has access) and "Public Read" (anyone can read the objects in the bucket).
  • URL: Each bucket has url.
  • Status: The current status of the bucket (e.g., 'Active', 'Creating', 'Deleting', 'Failed').
  • Tier: storage tier (e.g., 'Standard', 'Infrequent Access', 'Archive').

Bucket Statuses:

  • Active: Bucket is ready.
  • Creating: Bucket is creating.
  • Deleting: Bucket is deleting.
  • Failed: Bucket creation failed.

Object Storage Events

GET
https://public-api.virakcloud.com
/zone/{zoneId}/object-storage/events
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required
Example:
ad

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/ad/object-storage/events';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'system',
            'from' => 1707653422,
            'to' => 1707653999,
            'page' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
        "data": [
            {
                "product_model": "App\Models\Bucket",
                "product_id": "01F8MECHZX3TBDSZ7XRADM79XE",
                "product_source": "k8s",
                "type": "customer",
                "content": "A bucket cluster event occurred.",
                "created_at": 1739256828
            },
        ],
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 10,
            "per_page": 20,
            "to": 20,
            "total": 200
        }
}

Index

GET
https://public-api.virakcloud.com
/zone/{zoneId}/object-storage/buckets
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
string
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/object-storage/buckets';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "id": "string",
            "name": "string",
            "url": "string",
            "access_key": "string|null",
            "secret_key": "string|null",
            "status": "string",
            "policy": "string",
            "size": "integer",
            "created_at": "integer",
            "updated_at": "integer",
            "tier": "string|null",
            "is_failed": "boolean"
        }
    ]
}

Create (Async)

POST
https://public-api.virakcloud.com
/zone/{zoneId}/object-storage/buckets
requires authentication


Note: This endpoint works asynchronously. To check the result, use the bucket list endpoint to see the status of your bucket.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/object-storage/buckets';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => 'my-new-bucket',
            'policy' => 'Private',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "success": true
    }
}
{
    "message": "The name field is required.",
    "errors": {
        "name": [
            "The name field is required."
        ]
    }
}

Show

GET
https://public-api.virakcloud.com
/zone/{zoneId}/object-storage/buckets/{bucketId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
bucketId
ulid
required

The ID of the bucket.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/object-storage/buckets/01F8MECHZX3TBDSZ7XRADM79XE';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "string",
        "name": "string",
        "url": "string",
        "access_key": "string|null",
        "secret_key": "string|null",
        "status": "string",
        "policy": "string",
        "size": "integer",
        "created_at": "integer",
        "updated_at": "integer",
        "tier": "string|null",
        "is_failed": "boolean",
        "message": "string|null"
    }
}

Bucket Events

GET
https://public-api.virakcloud.com
/zone/{zoneId}/object-storage/buckets/{bucketId}/events
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
bucketId
ulid
required

The ID of the bucket.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/object-storage/buckets/01F8MECHZX3TBDSZ7XRADM79XE/events';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'system',
            'from' => 1707653422,
            'to' => 1707653999,
            'page' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
        "data": [
            {
                "product_model": "App\Models\Bucket",
                "product_id": "01F8MECHZX3TBDSZ7XRADM79XE",
                "product_source": "k8s",
                "type": "customer",
                "content": "A bucket cluster event occurred.",
                "created_at": 1739256828
            },
        ],
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 10,
            "per_page": 20,
            "to": 20,
            "total": 200
        }
}

Update (Async)

PUT
https://public-api.virakcloud.com
/zone/{zoneId}/object-storage/buckets/{bucketId}
requires authentication


Note: This endpoint works asynchronously. After calling this endpoint, the bucket will be in the Updating status. Shortly after, the status will change to Active once the update is complete. Use the bucket list or show endpoint to check the current status.

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
bucketId
ulid
required

The ID of the bucket.

Example:
01F8MECHZX3TBDSZ7XRADM79XE

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/object-storage/buckets/01F8MECHZX3TBDSZ7XRADM79XE';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'policy' => 'Public',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "id": "string",
        "name": "string",
        "url": "string",
        "access_key": "string|null",
        "secret_key": "string|null",
        "status": "string",
        "policy": "string",
        "size": "integer",
        "created_at": "integer",
        "updated_at": "integer",
        "tier": "string|null",
        "is_failed": "boolean"
    }
}
{
    "message": "The policy field is required.",
    "errors": {
        "policy": [
            "The policy field is required."
        ]
    }
}

Delete

DELETE
https://public-api.virakcloud.com
/zone/{zoneId}/object-storage/buckets/{bucketId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

zoneId
ulid
required

The ID of the zone.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
bucketId
ulid
required

The ID of the bucket.

Example:
01F8MECHZX3TBDSZ7XRADM79XE
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/zone/01F8MECHZX3TBDSZ7XRADM79XE/object-storage/buckets/01F8MECHZX3TBDSZ7XRADM79XE';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
[Empty response]

DNS

A DNS Domain (or DNS Zone) is a distinct part of the domain namespace for which administrative responsibility has been delegated. Think of it as a container for DNS records for a specific domain and its subdomains (if any). Managing a DNS Domain involves creating, updating, and deleting DNS records within that domain.

Key Concepts:

  • Domain: A portion of the DNS namespace (e.g., example.com) that is managed as a single unit. A domain contains all the DNS records for that domain name and potentially its subdomains. This is also commonly referred to as a "zone".
  • Domain Name: The domain name associated with the DNS Domain (e.g., example.com).
  • Status: The current status of the DNS Domain (e.g., 'Active', 'Pending', 'Error').
  • DNS Info: Information about the DNS servers responsible for the domain. This often includes:
    • virak_dns: The nameservers provided by the service (e.g., ns1.virak.cloud, ns2.virak.cloud). These are the nameservers you should point your domain to at your registrar.
    • domain_dns: The current nameservers configured for the domain (as detected by the system). This might be different from `virak_dns` if the domain hasn't been pointed to our nameservers yet, or if the change hasn't fully propagated.
  • TLD (Top-Level Domain): The last part of a domain name (e.g., .com, .org, .net). Valid TLDs are required when creating a DNS Domain.

Domain Management

This API allows you to manage DNS Domains. You can create, list, retrieve details about, and delete domains. When you create a domain, you'll receive the `virak_dns` nameservers. You'll need to update your domain's nameserver settings at your domain registrar to point to these nameservers. This delegates authority for your domain's DNS to our service.

Domain


Index

GET
https://public-api.virakcloud.com
/dns/domains
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "domain": "string",
            "status": "string",
            "dns_info": {
                "virak_dns": [
                    "string|null"
                ],
                "domain_dns": [
                    "string"
                ]
            }
        },
        {
            "domain": "string",
            "status": "string",
            "dns_info": {
                "virak_dns": [
                    "string|null"
                ],
                "domain_dns": [
                    "string"
                ]
            }
        }
    ]
}

Create

POST
https://public-api.virakcloud.com
/dns/domains
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'domain' => 'domain.com',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "message": "success"
}
{
    "message": "The domain field is required.",
    "errors": {
        "domain": [
            "The domain field is required."
        ]
    }
}
{
    "message": "The domain must be valid TLD.",
    "errors": {
        "domain": [
            "The domain must be valid TLD."
        ]
    }
}
{
    "message": "The domain must be valid domain.",
    "errors": {
        "domain": [
            "The domain must be valid domain."
        ]
    }
}
{
    "message": "The domain field is invalid.",
    "errors": {
        "domain": [
            "The customer has reached the maximum limit of pending domains."
        ]
    }
}
{
    "message": "Not Allowed Domain",
    "errors": {
        "domain": [
            "The zone is not allowed."
        ]
    }
}
{
    "message": "Not Allowed Domain (TLD)",
    "errors": {
        "domain": [
            "The TLD of the zone is not allowed."
        ]
    }
}

Show

GET
https://public-api.virakcloud.com
/dns/domains/{domain}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

domain
string
required

Customer's Domain.

Example:
domain.com
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains/domain.com';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "domain": "string",
        "status": "string",
        "dns_info": {
            "virak_dns": [
                "string|null"
            ],
            "domain_dns": [
                "string"
            ]
        }
    }
}
{
    "message": "The domain field is required.",
    "errors": {
        "domain": [
            "The domain field is required."
        ]
    }
}
{
    "message": "The domain field is invalid.",
    "errors": {
        "domain": [
            "The domain field is invalid."
        ]
    }
}

Delete

DELETE
https://public-api.virakcloud.com
/dns/domains/{domain}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

domain
string
required

Customer's Domain.

Example:
domain.com
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains/domain.com';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "message": "success"
}
{
    "message": "The domain field is required.",
    "errors": {
        "domain": [
            "The domain field is required."
        ]
    }
}
{
    "message": "The domain field is invalid.",
    "errors": {
        "domain": [
            "The domain field is invalid."
        ]
    }
}

Show

GET
https://public-api.virakcloud.com
/dns/domains/{domain}/records
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

domain
string
required

Customer's Domain.

Example:
domain.com
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains/domain.com/records';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": {
        "domain": "string",
        "status": "string",
        "dns_info": {
            "virak_dns": [
                "string|null"
            ],
            "domain_dns": [
                "string"
            ]
        }
    }
}
{
    "message": "The domain field is required.",
    "errors": {
        "domain": [
            "The domain field is required."
        ]
    }
}
{
    "message": "The domain field is invalid.",
    "errors": {
        "domain": [
            "The domain field is invalid."
        ]
    }
}

Record


Create

POST
https://public-api.virakcloud.com
/dns/domains/{domain}/records
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

domain
string
required

Customer's Domain.

Example:
domain.com

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains/domain.com/records';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'record' => 'www.domain.com',
            'type' => 'A',
            'ttl' => 3600,
            'content' => '8.8.8.8',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "message": "success"
}
{
    "message": "The domain field is required.",
    "errors": {
        "zone": [
            "The domain field is required."
        ]
    }
}
{
    "message": "The domain must be a string.",
    "errors": {
        "zone": [
            "The domain must be a string."
        ]
    }
}
{
    "message": "The selected domain is invalid.",
    "errors": {
        "zone": [
            "The selected domain is invalid."
        ]
    }
}
{
    "message": "The type field is required.",
    "errors": {
        "type": [
            "The type field is required."
        ]
    }
}
{
    "message": "The selected type is invalid.",
    "errors": {
        "type": [
            "The selected type is invalid."
        ]
    }
}
{
    "message": "The record field is required.",
    "errors": {
        "record": [
            "The record field is required."
        ]
    }
}
{
    "message": "The record must be a string.",
    "errors": {
        "record": [
            "The record must be a string."
        ]
    }
}
{
    "message": "The ttl field is required.",
    "errors": {
        "ttl": [
            "The ttl field is required."
        ]
    }
}
{
    "message": "The ttl must be an integer.",
    "errors": {
        "ttl": [
            "The ttl must be an integer."
        ]
    }
}

Update

PUT
https://public-api.virakcloud.com
/dns/domains/{domain}/records/{record}/{type}/{contentId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

domain
string
required

Customer's Domain.

Example:
domain.com
record
string
required

Record.

Example:
blog.domain.com
type
string
required

DNS record type

Example:
A
contentId
ulid
required

Record Content Id

Example:
01JJ1W1R241GRQYQ28703F8DSH

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains/domain.com/records/blog.domain.com/A/01JJ1W1R241GRQYQ28703F8DSH';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'ttl' => 3600,
            'content' => '8.8.8.8.8',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "message": "success"
}
{
    "message": "The domain field is required.",
    "errors": {
        "domain": [
            "The domain field is required."
        ]
    }
}
{
    "message": "The domain must be a string.",
    "errors": {
        "domain": [
            "The domain must be a string."
        ]
    }
}
{
    "message": "The selected domain is invalid.",
    "errors": {
        "domain": [
            "The selected domain is invalid."
        ]
    }
}
{
    "message": "The type field is required.",
    "errors": {
        "type": [
            "The type field is required."
        ]
    }
}
{
    "message": "The selected type is invalid.",
    "errors": {
        "type": [
            "The selected type is invalid."
        ]
    }
}
{
    "message": "The record field is required.",
    "errors": {
        "record": [
            "The record field is required."
        ]
    }
}
{
    "message": "The record must be a string.",
    "errors": {
        "record": [
            "The record must be a string."
        ]
    }
}
{
    "message": "The selected record is invalid.",
    "errors": {
        "record": [
            "The selected record is invalid."
        ]
    }
}
{
    "message": "The ttl field is required.",
    "errors": {
        "ttl": [
            "The ttl field is required."
        ]
    }
}
{
    "message": "The ttl must be an integer.",
    "errors": {
        "ttl": [
            "The ttl must be an integer."
        ]
    }
}
{
    "message": "The contentId field is required.",
    "errors": {
        "contentId": [
            "The contentId field is required."
        ]
    }
}
{
    "message": "The contentId must be a valid ULID.",
    "errors": {
        "contentId": [
            "The contentId must be a valid ULID."
        ]
    }
}
{
    "message": "The selected contentId is invalid.",
    "errors": {
        "contentId": [
            "The selected contentId is invalid."
        ]
    }
}

Delete

DELETE
https://public-api.virakcloud.com
/dns/domains/{domain}/records/{record}/{type}/{contentId}
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

URL Parameters

domain
string
required

Customer's Domain.

Example:
domain.com
record
string
required

Record.

Example:
domain.com
type
string
required

Record type

Example:
A
contentId
string
required

Record Content Id

Example:
01JJ1W1R241GRQYQ28703F8DSH
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/domains/domain.com/records/domain.com/A/01JJ1W1R241GRQYQ28703F8DSH';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "message": "success"
}
{
    "message": "The domain field is required.",
    "errors": {
        "domain": [
            "The domain field is required."
        ]
    }
}
{
    "message": "The domain must be a string.",
    "errors": {
        "domain": [
            "The domain must be a string."
        ]
    }
}
{
    "message": "The selected domain is invalid.",
    "errors": {
        "domain": [
            "The selected domain is invalid."
        ]
    }
}
{
    "message": "The type field is required.",
    "errors": {
        "type": [
            "The type field is required."
        ]
    }
}
{
    "message": "The selected type is invalid.",
    "errors": {
        "type": [
            "The selected type is invalid."
        ]
    }
}
{
    "message": "The record field is required.",
    "errors": {
        "record": [
            "The record field is required."
        ]
    }
}
{
    "message": "The record must be a string.",
    "errors": {
        "record": [
            "The record must be a string."
        ]
    }
}
{
    "message": "The selected record is invalid.",
    "errors": {
        "record": [
            "The selected record is invalid."
        ]
    }
}
{
    "message": "The contentId field is required.",
    "errors": {
        "contentId": [
            "The contentId field is required."
        ]
    }
}
{
    "message": "The contentId must be a valid ULID.",
    "errors": {
        "contentId": [
            "The contentId must be a valid ULID."
        ]
    }
}
{
    "message": "The selected contentId is invalid.",
    "errors": {
        "contentId": [
            "The selected contentId is invalid."
        ]
    }
}

DNS Events

GET
https://public-api.virakcloud.com
/dns/events
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/dns/events';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'system',
            'from' => 1707653422,
            'to' => 1707653999,
            'page' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
    "data": [
        {
            "product_model": "App\Models\Zone",
            "product_id": "01jz2ty8m3vd3m5g3n3r1dhfy2",
            "product_source": "dns",
            "type": "system",
            "content": "دامنه domain.ir غیر فعال شد.",
            "created_at": 1752006606
        }
    ],
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Event Management

APIs for managing customer events

List Customer Events

GET
https://public-api.virakcloud.com
/events
requires authentication

Headers

Authorization
Example:
Bearer {YOUR_AUTH_KEY}
Content-Type
Example:
application/json
Accept
Example:
application/json

Body Parameters

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.virakcloud.com/events';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'type' => 'system',
            'from' => 1707653422,
            'to' => 1707653999,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response:
{
        "data": [
            {
                "product_model": "App\Models\Network",
                "product_id": "01F8MECHZX3TBDSZ7XRADM79XE",
                "product_source": "network",
                "type": "customer",
                "content": "A network event occurred.",
                "created_at": 1739256828
            },
            {
                "product_model": "App\Models\Instance",
                "product_id": "01F8MECHZX3TBDSZ7XRADM79XE",
                "product_source": "core",
                "type": "system",
                "content": "A system event occurred.",
                "created_at": 1739256683
            }
        ],
        "meta": {
            "current_page": 1,
            "from": 1,
            "last_page": 10,
            "per_page": 20,
            "to": 20,
            "total": 200
        }
}