| 1 | // Copyright 2017 Kumina, https://kumina.nl/ |
| 2 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | // you may not use this file except in compliance with the License. |
| 4 | // You may obtain a copy of the License at |
| 5 | // |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | // |
| 8 | // Unless required by applicable law or agreed to in writing, software |
| 9 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | // See the License for the specific language governing permissions and |
| 12 | // limitations under the License. |
| 13 | |
| 14 | package libvirt_schema |
| 15 | |
| 16 | type Domain struct { |
| 17 | Devices Devices `xml:"devices"` |
| 18 | Metadata Metadata `xml:"metadata"` |
| 19 | UUID string `xml:"uuid"` |
| 20 | } |
| 21 | |
| 22 | type Metadata struct { |
| 23 | // The actual xml tag is nova:instance, but we don't care about the namespaces |
| 24 | NovaInstance NovaInstance `xml:"instance"` |
| 25 | } |
| 26 | |
| 27 | type NovaInstance struct { |
| 28 | Name string `xml:"name"` |
| 29 | Flavor NovaFlavor `xml:"flavor"` |
| 30 | Owner NovaOwner `xml:"owner"` |
| 31 | } |
| 32 | |
| 33 | type NovaFlavor struct { |
| 34 | Name string `xml:"name,attr"` |
| 35 | } |
| 36 | |
| 37 | type NovaOwner struct { |
| 38 | ProjectName string `xml:"project"` |
| 39 | } |
| 40 | |
| 41 | type Devices struct { |
| 42 | Disks []Disk `xml:"disk"` |
| 43 | Interfaces []Interface `xml:"interface"` |
| 44 | } |
| 45 | |
| 46 | type Disk struct { |
| 47 | Device string `xml:"device,attr"` |
| 48 | Source DiskSource `xml:"source"` |
| 49 | Target DiskTarget `xml:"target"` |
| 50 | } |
| 51 | |
| 52 | type DiskSource struct { |
| 53 | File string `xml:"file,attr"` |
| 54 | } |
| 55 | |
| 56 | type DiskTarget struct { |
| 57 | Device string `xml:"dev,attr"` |
| 58 | } |
| 59 | |
| 60 | type Interface struct { |
| 61 | Source InterfaceSource `xml:"source"` |
| 62 | Target InterfaceTarget `xml:"target"` |
| 63 | } |
| 64 | |
| 65 | type InterfaceSource struct { |
| 66 | Bridge string `xml:"bridge,attr"` |
| 67 | } |
| 68 | |
| 69 | type InterfaceTarget struct { |
| 70 | Device string `xml:"dev,attr"` |
| 71 | } |