fid= fopen('reqJosn.json', 'w+');
load('request-set-10.mat');
requests = requests.request;
requestNum = length(requests);
for i = :
request.name = sprintf('%s%d', 'vn_test_',i);
request.type = ;
request.description = sprintf('%s%d%s', 'virtual network ',i, ' for test use');
controller.id = i;
controller.name = 'defaultController';
controller.host = 'localhost';
controller.port = ;
controller.type = 'POX';
request.controller = controller;
nodeNum = requests(,i).node_num;
linkNum = requests(,i).link_num;
request.sw_number = nodeNum;
switches = {};//注意此处如需在结构里嵌套结构,必须这样子
for j = :nodeNum
swTemp.id = j;
swTemp.name = sprintf('%s%d', 'sw', j);
swTemp.resource = requests(,i).cpu(j);
swTemp.port_num = ;
swTemp.host_num = ;
switches = [switches,swTemp];
end
request.switches = switches;
subJson = savejson('',request);//幻化为json字符串,具体help一下
fprintf(fid, '%s',subJson);
end
fclose(fid);

最新文章

  1. 数据库分库分表(sharding)系列(一) 拆分规则
  2. Linux命令之dos2unix
  3. OpenStack虚拟机状态
  4. Thinkphp 使用gmail发送邮件
  5. LeetCode Database题解
  6. 【Spring源码分析系列】ApplicationContext 相关接口架构分析
  7. [APIO2007] 风铃
  8. python 用文本来提供输入信息的模板,不用每次都手动粘贴了
  9. mysql函数之截取字符串
  10. webservice-整理
  11. 接口自动化 基于python实现的http+json协议接口自动化测试框架源码(实用改进版)
  12. android画板笔锋实现
  13. Centos 6.5 yum 安装Apache软件
  14. 资料整理,SQL Server ,面试前复习笔记
  15. Hadoop系列-MapReduce基础
  16. 模板引擎 引自 《PHP核心技术与最佳实践》
  17. python面向对象之类成员修饰符
  18. 0329--Scrum团队准备工作
  19. JS小案例(基础好烦恼少)----持续更新
  20. 《梦断代码Dreaming In Code》阅读笔记(一)

热门文章

  1. 转 使用隐含Trace参数诊断Oracle Data Pump故障
  2. jQuery自动完成插件flexselect
  3. HBase学习(二)
  4. 注意mysql connector的版本
  5. java并发编程 volatile关键字 精准理解
  6. spring boot Configuration Annotation Proessor not found in classpath
  7. js获取文件上传进度
  8. Android内存监测工具使用
  9. 夜色的 cocos2d-x 开发笔记 04
  10. Java 空对象设计模式(Null Object Pattern) 讲解