Skip to content

Commit

Permalink
Allocate unallocate vm ip address task (#517)
Browse files Browse the repository at this point in the history
* Add un/allocate IP address tasks to VMs

* update description

* allocate unallocate ip
  • Loading branch information
mattoni authored Nov 20, 2024
1 parent ffed807 commit b5423a7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
17 changes: 17 additions & 0 deletions components/schemas/vms/tasks/VirtualMachineIpAllocateTask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: VirtualMachineIpAllocateTask
type: object
required:
- action
- contents
properties:
action:
type: string
enum:
- ip.allocate
description: The action to take.
contents:
type: object
properties:
ip_id:
$ref: ../../ID.yml
description: The ID of the IP address to allocate to the virtual machine.
19 changes: 19 additions & 0 deletions components/schemas/vms/tasks/VirtualMachineIpUnallocateTask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
title: VirtualMachineIpUnallocateTask
type: object
required:
- action
- contents
properties:
action:
type: string
enum:
- ip.unallocate
description: The action to take.
contents:
type: object
properties:
ip_id:
$ref: ../../ID.yml
description: The ID of the IP address to unallocate from the virtual machine.
required:
- ip_id
6 changes: 6 additions & 0 deletions platform/paths/virtual-machines/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ post:
`stop`: `virtual-machines-manage`
`reconfigure`: `virtual-machines-manage`
`rootpw.change`: `virtual-machines-manage`
`ip.allocate`: `virtual-machines-manage`
`ip.unallocate`: `virtual-machines-manage`
tags:
- Virtual Machines
parameters:
Expand All @@ -30,11 +32,15 @@ post:
stop: ../../../components/schemas/vms/tasks/VirtualMachineStopTask.yml
reconfigure: ../../../components/schemas/vms/tasks/VirtualMachineReconfigureTask.yml
rootpw.change: ../../../components/schemas/vms/tasks/VirtualMachineRootPwChangeTask.yml
ip.allocate: ../../../components/schemas/vms/tasks/VirtualMachineIpAllocateTask.yml
ip.unallocate: ../../../components/schemas/vms/tasks/VirtualMachineIpUnallocateTask.yml
oneOf:
- $ref: ../../../components/schemas/vms/tasks/VirtualMachineStartTask.yml
- $ref: ../../../components/schemas/vms/tasks/VirtualMachineStopTask.yml
- $ref: ../../../components/schemas/vms/tasks/VirtualMachineReconfigureTask.yml
- $ref: ../../../components/schemas/vms/tasks/VirtualMachineRootPwChangeTask.yml
- $ref: ../../../components/schemas/vms/tasks/VirtualMachineIpAllocateTask.yml
- $ref: ../../../components/schemas/vms/tasks/VirtualMachineIpUnallocateTask.yml
responses:
202:
description: Returns a job descriptor.
Expand Down

0 comments on commit b5423a7

Please sign in to comment.