TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
CainiaoWaybillCloudprintSimulationHeartbeatRequest req = new CainiaoWaybillCloudprintSimulationHeartbeatRequest();
CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformHeartBeatDTO obj1 = new CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformHeartBeatDTO();
obj1.setProxyIp("127.0.0.1");
obj1.setBusinessId("test");
List<CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTO> list3 = new ArrayList<CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTO>();
CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTO obj4 = new CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTO();
list3.add(obj4);
obj4.setAliveStatus("存活alive,死亡dead");
obj4.setPlatformCode("PDD,DOUYIN,JD,KUAISHOU");
obj1.setPlatformInfoList(list3);
CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformProxyPerformanceDTO obj5 = new CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformProxyPerformanceDTO();
obj5.setMemoryPercent(30L);
obj5.setCpuPercent(30L);
obj1.setProxyPerformance(obj5);
req.setCloudPrintPlatformHeartBeatDto(obj1);
CainiaoWaybillCloudprintSimulationHeartbeatResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
CainiaoWaybillCloudprintSimulationHeartbeatRequest req = new CainiaoWaybillCloudprintSimulationHeartbeatRequest();
CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformHeartBeatDTODomain obj1 = new CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformHeartBeatDTODomain();
obj1.ProxyIp = "127.0.0.1";
obj1.BusinessId = "test";
List<CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTODomain> list3 = new List<CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTODomain>();
CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTODomain obj4 = new CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformInfoDTODomain();
list3.Add(obj4);
obj4.AliveStatus = "存活alive,死亡dead";
obj4.PlatformCode = "PDD,DOUYIN,JD,KUAISHOU";
obj1.PlatformInfoList= list3;
CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformProxyPerformanceDTODomain obj5 = new CainiaoWaybillCloudprintSimulationHeartbeatRequest.CloudPrintPlatformProxyPerformanceDTODomain();
obj5.MemoryPercent = 30L;
obj5.CpuPercent = 30L;
obj1.ProxyPerformance= obj5;
req.CloudPrintPlatformHeartBeatDto_ = obj1;
CainiaoWaybillCloudprintSimulationHeartbeatResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new CainiaoWaybillCloudprintSimulationHeartbeatRequest;
$cloud_print_platform_heart_beat_dto = new CloudPrintPlatformHeartBeatDTO;
$cloud_print_platform_heart_beat_dto->proxy_ip="127.0.0.1";
$cloud_print_platform_heart_beat_dto->business_id="test";
$platform_info_list = new CloudPrintPlatformInfoDTO;
$platform_info_list->alive_status="存活alive,死亡dead";
$platform_info_list->platform_code="PDD,DOUYIN,JD,KUAISHOU";
$cloud_print_platform_heart_beat_dto->platform_info_list = $platform_info_list;
$proxy_performance = new CloudPrintPlatformProxyPerformanceDTO;
$proxy_performance->memory_percent="30";
$proxy_performance->cpu_percent="30";
$cloud_print_platform_heart_beat_dto->proxy_performance = $proxy_performance;
$req->setCloudPrintPlatformHeartBeatDto(json_encode($cloud_print_platform_heart_beat_dto));
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=cainiao.waybill.cloudprint.simulation.heartbeat' \
-d 'partner_id=apidoc' \
-d 'sign=D48B77C7433B7DA869BB3FE9363608AF' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-15+13%3A45%3A24' \
-d 'v=2.0' \
-d 'cloud_print_platform_heart_beat_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.CainiaoWaybillCloudprintSimulationHeartbeatRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.cloud_print_platform_heart_beat_dto="数据结构示例JSON格式"
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"cainiao.waybill.cloudprint.simulation.heartbeat");
add_param(pRequest,"cloud_print_platform_heart_beat_dto","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('cainiao.waybill.cloudprint.simulation.heartbeat', {
'cloud_print_platform_heart_beat_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})