Skip to content

Commit

Permalink
chore: bump up version 1.1.0 ⬆️
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Feb 18, 2021
1 parent 5130ede commit bb42a4b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
8 changes: 4 additions & 4 deletions API/v1/Console/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

async def serialize(console: Console):
record = console.get_record()

return dict(
location=record['location'],
protocol=record['protocol'],
uuid=record['uuid'],
location=record["location"],
protocol=record["protocol"],
uuid=record["uuid"],
)
2 changes: 2 additions & 0 deletions API/v1/Interface/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ class MemoryArgs(BaseModel):
class NameArgs(BaseModel):
name: str


class CloneArgs(NameArgs):
provision: bool = True


class NameDescriptionArgs(BaseModel):
name: Optional[str]
description: Optional[str]
Expand Down
6 changes: 3 additions & 3 deletions API/v1/VM/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ async def instance_clone(cluster_id: str, vm_uuid: str, args: CloneArgs):

_vm: VM = VM.get_by_uuid(session=session, uuid=vm_uuid)
new_vm = await _vm.clone(args.name)
if new_vm is not None:

if new_vm is not None:
if args.provision:
await new_vm.provision()

ret = dict(success=True, data=await serialize(new_vm))
else:
ret = dict(success=False)
Expand Down
14 changes: 7 additions & 7 deletions API/v1/VM/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

async def serialize(vm: VM):
record = vm.get_record()

return dict(
name=record['name_label'],
bios=record['bios_strings'],
power=record['power_state'],
description=record['name_description'],
uuid=record['uuid'],
vCPUs=record['VCPUs_at_startup'],
name=record["name_label"],
bios=record["bios_strings"],
power=record["power_state"],
description=record["name_description"],
uuid=record["uuid"],
vCPUs=record["VCPUs_at_startup"],
memory=vm.get_memory(),
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "XenXenXenSe"
version = "1.0.2"
version = "1.1.0"
description = "An easy-to-use HTTP API of XenAPI for Web Application Developers."
authors = [
"Alex4386 <[email protected]>",
Expand Down

0 comments on commit bb42a4b

Please sign in to comment.