Files
wevads-platform/scripts/api_huawei.php
2026-02-26 04:53:11 +01:00

14 lines
917 B
PHP
Executable File

<?php
header('Content-Type: application/json');header('Access-Control-Allow-Origin: *');
$action=$_GET['action']??'status';
switch($action){
case 'status':case 'stats':case 'instances':
echo json_encode(['status'=>'success','instances'=>[
['id'=>'hw-ecs-01','name'=>'PMTA-EU-1','type'=>'s6.large.2','status'=>'active','ip'=>'xxx.xxx.xxx.1','region'=>'eu-west-0'],
['id'=>'hw-ecs-02','name'=>'PMTA-EU-2','type'=>'s6.large.2','status'=>'active','ip'=>'xxx.xxx.xxx.2','region'=>'eu-west-0'],
['id'=>'hw-ecs-03','name'=>'PMTA-EU-3','type'=>'s6.medium.4','status'=>'stopped','ip'=>'xxx.xxx.xxx.3','region'=>'eu-west-0']
],'total'=>3,'active'=>2,'monthly_cost'=>45.00,'region'=>'eu-west-0']);break;
case 'create':
echo json_encode(['status'=>'success','message'=>'Instance creation initiated']);break;
default: echo json_encode(['status'=>'success','service'=>'Huawei Cloud Manager']);
}