卷 - 导入

可使用此命令来将已导出卷的内容导入到卷中。

格式:


<a volume object>.import({<propertyName>:<value>,...})

示例:

>>> testvol
{
  "acl": (nested object),
  "auxiliary_name": None,
  "cloud": (nested object),
  "created_time": "Aug 11, 2014 6:13:49 PM",
  "description": "",
  "harddiskdrive": None,
  "id": "b5f4ea6a-146d-4590-afc6-8b5fc68da67e",
  "id_auxiliary": None,
  "id_flashcopy_source": None,
  "is_external": "F",
  "name": "TestVol",
  "replication_role": "none",
  "replication_state": None,
  "replication_type": "async",
  "size": 2048,
  "solidstatedrive": None,
  "state": "available",
  "type": "block",
  "units": "MB",
  "updated_time": "Aug 12, 2014 10:14:11 AM",
  "url": "/admin/resources/volumes/b5f4ea6a-146d-4590-afc6-8b5fc68da67e",
  "virtualmachines": (nested object),
  "volumeconfiguration": (nested object),
  "volumegroup": (nested object)
}
>>> testvol.import({'host':'172.20.255.126','username':'root','password':'passw0rd','path':'/tmp/test/vol/TestVol.json'})
{
  "acl": (nested object),
  "auxiliary_name": None,
  "cloud": (nested object),
  "created_time": "Aug 11, 2014 6:13:49 PM",
  "description": "",
  "harddiskdrive": None,
  "id": "b5f4ea6a-146d-4590-afc6-8b5fc68da67e",
  "id_auxiliary": None,
  "id_flashcopy_source": None,
  "is_external": "F",
  "name": "TestVol",
  "replication_role": "none",
  "replication_state": None,
  "replication_type": "async",
  "size": 2048,
  "solidstatedrive": None,
  "state": "pending",
  "type": "block",
  "units": "MB",
  "updated_time": "Aug 12, 2014 10:29:42 AM",
  "url": "/admin/resources/volumes/b5f4ea6a-146d-4590-afc6-8b5fc68da67e",
  "virtualmachines": (nested object),
  "volumeconfiguration": (nested object),
  "volumegroup": (nested object)
}
>>>