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.
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.
$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));
{
"data": [
{
"id": "string",
"name": "string",
"location": "string",
"active": true
},
{
"id": "string",
"name": "string",
"location": "string",
"active": true
}
]
}
The ID of the zone.
$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));
{
"Instance": true,
"DataVolume": true,
"Network": true,
"ObjectStorage": true,
"K8s": false
}
The ID of the zone.
$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));
{
"instance_resource_collected": {
"memory": {
"collected": 0,
"total": 40960
},
"cpunumber": {
"collected": 0,
"total": 40
},
"datavolume": {
"collected": 10,
"total": 200
},
"vmlimit": {
"collected": 0,
"total": 20
}
}
}
$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));
$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));
[Empty response]
$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));
{"abilities": ["ability1", "ability2", ...]}
$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));
{
"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"
}
]
}
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.
$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));
{
"data": {
"success": true
}
}
$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));
{
"data": {
"success": true
}
}
$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));
{
"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"
}
}
$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));
{
"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
}
]
}
$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));
{
"data": []
}
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 Functionalities:
Instance Statuses:
The ID of the zone.
$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));
{
"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 all available instance service offerings for the specified zone. Returned data is anonymized for documentation purposes.
The ID of the zone.
$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));
{
"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 all available VM image service offerings for the specified zone. Returned data is anonymized for documentation purposes.
The ID of the zone.
$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));
{
"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"
}
]
}
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.
The ID of the zone.
$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));
{
"data": {
"success": true
}
}
Rebuild an instance with a new VM image.
The ID of the zone.
The ID of the instance.
$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));
{
"data": {
"success": true
}
}
Start a stopped instance.
The ID of the zone.
The ID of the instance.
$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));
{
"data": {
"success": true
}
}
Stop a running instance.
The ID of the zone.
The ID of the instance.
$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));
{
"data": {
"success": true
}
}
Reboot a running instance.
The ID of the zone.
The ID of the instance.
$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));
{
"data": {
"success": true
}
}
Note: This function creates a snapshot for a specific instance.
{ "data": { "id": "string", "name": "string", "status": "string", "created_at": 1234567890 } }
The ID of the zone.
The ID of the instance.
$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));
{
"data": {
"id": "01H9ZCNF46W6C1EM45T21B6M0S",
"name": "my-snapshot",
"status": "CREATING",
"created_at": 1712345678
}
}
Note: This function deletes a snapshot for a specific instance.
{ "data": { "success": true } }
The ID of the zone.
The ID of the instance.
The ID of the snapshot.
$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));
{
"data": {
"success": true
}
}
Note: This function reverts an instance to a specific snapshot.
{ "data": { "success": true } }
The ID of the zone.
The ID of the instance.
The ID of the snapshot.
$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));
{
"data": {
"success": true
}
}
List all volume service offerings available in the specified zone for the authenticated user.
The ID of the zone.
$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));
{
"data": [
{
"size": "0",
"price": "200",
"name": "CustomeDiskOfferingAlborz",
"description": "CustomeDiskOfferingAlborz",
"is_public": true,
"is_featured": false
}
]
}
List all volumes for the authenticated user in the specified zone.
The ID of the zone.
$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));
{
"data": [
{
"id": "01H9ZCNF46W6C1EM45T21B6M0V",
"name": "volume-1",
"size": 50,
"status": "available"
}
]
}
Create a new volume in the specified zone.
The ID of the zone.
$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));
{
"data": {
"id": "01H9ZCNF46W6C1EM45T21B6M0V",
"name": "my-volume",
"size": 50,
"status": "CREATING"
}
}
Delete a volume by its ID.
The ID of the zone.
The ID of the volume.
$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));
{
"data": {
"success": true
}
}
Detach a volume from an instance.
The ID of the zone.
The ID of the volume.
$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));
{
"data": {
"success": true
}
}
Attach a volume to an instance.
The ID of the zone.
The ID of the volume.
The ID of the instance.
$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));
{
"data": {
"success": true
}
}
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:
192.168.1.0/24
). Use 0.0.0.0/0
for all IPv4 addresses.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.
The ID of the zone.
$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));
{
"data": {
"success": true
}
}
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.
The ID of the zone.
$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));
{
"data": {
"success": true
}
}
Retrieves a list of all networks in the specified zone for the authenticated customer.
The ID of the zone.
$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));
{
"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": []
}
]
}
]
}
Retrieves details of a specific network by its ID in the specified zone.
The ID of the zone.
The ID of the network.
$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));
{
"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": []
}
}
Deletes a specific network by its ID in the specified zone.
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
Manage instance connections to networks, including connecting, disconnecting, and listing connected instances.
Requires appropriate network:instance:connect ability for API token
Note: This function runs asynchronously in the background. The response will be:
{ "data": { "success": true } }
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
Requires appropriate network:instance:disconnect ability for API token
Note: This function runs asynchronously in the background. The response will be:
{ "data": { "success": true } }
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
Requires appropriate network:instance:show ability for API token
The ID of the zone.
The ID of the network.
$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));
{
"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": []
}
]
}
Retrieves a list of all IPv4 firewall rules associated with a specific network.
Ingress
for incoming, Egress
for outgoing).The ID of the zone.
The ID of the network to fetch rules for.
$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));
{
"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"
}
]
}
Creates a new firewall rule for IPv4 traffic on a given network.
The ID of the zone.
The ID of the network to fetch rules for.
$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));
{
"data": {
"success": true
}
}
Deletes a specific IPv4 firewall rule by its ID.
The ID of the zone.
The ID of the network to fetch rules for.
The ID of the firewall rule to delete.
$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));
{
"data": {
"success": true
}
}
Retrieves a list of all IPv6 firewall rules associated with a specific network.
Ingress
for incoming, Egress
for outgoing).The ID of the zone.
The ID of the network to fetch rules for.
$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));
{
"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"
}
]
}
Creates a new firewall rule for IPv6 traffic on a given network.
The ID of the zone.
The ID of the network to fetch rules for.
$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));
{
"data": {
"success": true
}
}
Deletes a specific IPv6 firewall rule by its ID.
The ID of the zone.
The ID of the network to fetch rules for.
The ID of the firewall rule to delete.
$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));
{
"data": {
"success": true
}
}
List all public IPs associated with a network in a zone.
The ID of the zone.
The ID of the network.
$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));
{
"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 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.
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
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.
The ID of the zone.
The ID of the network.
The ID of the public IP.
$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));
{
"data": {
"success": true
}
}
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.
The ID of the zone.
The ID of the network.
The ID of the public IP.
$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));
{
"data": {
"success": true
}
}
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.
The ID of the zone.
The ID of the network.
The ID of the public IP.
$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));
{
"data": {
"success": true
}
}
Get a list of port forward rules for a network.
The zone ULID.
The network ULID.
The ID of the public IP.
$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));
{
"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 a new port forward rule to a network.
The zone ULID.
The network ULID.
The ID of the public IP.
$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));
{
"success": true,
"data": {
"rule_id": "01HZYKJ8QK8ZJ6K8J6K8J6K8J6"
}
}
The zone ULID.
The network ULID.
The ID of the public IP.
The port forward rule ULID.
$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));
{
"data": {
"success": true
}
}
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
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).
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"ipaddress": "192.168.1.2",
"username": "",
"password": "",
"presharedkey": "",
"status": "Deactive"
}
}
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.
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
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.
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
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.
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
Load balancing distributes incoming network traffic across multiple servers to ensure no single server becomes overwhelmed, improving responsiveness and availability.
Retrieves all load balancing rules for a network.
The ID of the zone.
The ID of the network.
$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));
{
"data": [
{
"id": "rule_id",
"name": "lb-rule",
"algorithm": "roundrobin",
"public_port": 80,
"private_port": 8080,
"status": "Active"
}
]
}
Creates a new load balancing rule for a network.
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"success": true
}
}
Deletes a load balancing rule by its ID.
The ID of the zone.
The ID of the network.
The ID of the load balancing rule.
$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));
{
"data": {
"success": true
}
}
Assigns instances to a load balancing rule.
The ID of the zone.
The ID of the network.
The ID of the load balancing rule.
$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));
{
"data": {
"success": true
}
}
Removes an instance from a load balancing rule.
The ID of the zone.
The ID of the network.
The ID of the load balancing rule.
$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));
{
"data": {
"success": true
}
}
Retrieves live HAProxy statistics for the network.
The ID of the zone.
The ID of the network.
$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));
{
"data": {
"updated_at": 1752566580,
"rules": []
}
}
Retrieves HAProxy logs for the network.
The ID of the zone.
The ID of the network.
$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));
{
"data": []
}
Response fields:
The ID of the zone.
$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));
{
"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 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:
Cluster Statuses:
Each cluster can be in one of the following statuses, indicating its current operational state:
The ID of the zone.
$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));
{
"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
}
]
}
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.
The ID of the zone.
$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));
{
"data": {
"success": true
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"message": "Kubernetes cluster deleted successfully"
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
The ID of the cluster.
$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));
{
"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
}
}
The ID of the zone.
$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));
{
"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
}
}
The ID of the zone.
$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));
{
"data": [
{
"id": "01jetc3f8f218krnm9hwh46j8d",
"version": "1.30.3",
"enabled": true,
"min_cpu": 2,
"min_memory": 2048
}
]
}
The ID of the zone.
$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));
{
"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 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:
Bucket Statuses:
$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));
{
"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
}
}
The ID of the zone.
$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));
{
"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"
}
]
}
Note: This endpoint works asynchronously. To check the result, use the bucket list endpoint to see the status of your bucket.
The ID of the zone.
$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));
{
"data": {
"success": true
}
}
The ID of the zone.
The ID of the bucket.
$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));
{
"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"
}
}
The ID of the zone.
The ID of the bucket.
$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));
{
"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
}
}
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.
The ID of the zone.
The ID of the bucket.
$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));
{
"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"
}
}
The ID of the zone.
The ID of the bucket.
$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));
[Empty response]
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 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.
$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));
{
"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"
]
}
}
]
}
$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));
{
"message": "success"
}
Customer's Domain.
$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));
{
"data": {
"domain": "string",
"status": "string",
"dns_info": {
"virak_dns": [
"string|null"
],
"domain_dns": [
"string"
]
}
}
}
Customer's Domain.
$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));
{
"message": "success"
}
Customer's Domain.
$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));
{
"data": {
"domain": "string",
"status": "string",
"dns_info": {
"virak_dns": [
"string|null"
],
"domain_dns": [
"string"
]
}
}
}
Customer's Domain.
$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));
{
"message": "success"
}
Customer's Domain.
Record.
DNS record type
Record Content Id
$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));
{
"message": "success"
}
Customer's Domain.
Record.
Record type
Record Content Id
$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));
{
"message": "success"
}
$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));
{
"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
}
}
APIs for managing customer events
$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));
{
"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
}
}