summaryrefslogtreecommitdiff
path: root/libvirt/resource_libvirt_volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'libvirt/resource_libvirt_volume.go')
-rw-r--r--libvirt/resource_libvirt_volume.go92
1 files changed, 44 insertions, 48 deletions
diff --git a/libvirt/resource_libvirt_volume.go b/libvirt/resource_libvirt_volume.go
index 4f9c3322..de5ceabd 100644
--- a/libvirt/resource_libvirt_volume.go
+++ b/libvirt/resource_libvirt_volume.go
@@ -11,59 +11,55 @@ import (
libvirt "github.com/libvirt/libvirt-go"
)
-func volumeCommonSchema() map[string]*schema.Schema {
- return map[string]*schema.Schema{
- "name": {
- Type: schema.TypeString,
- Required: true,
- ForceNew: true,
- },
- "pool": {
- Type: schema.TypeString,
- Optional: true,
- Default: "default",
- ForceNew: true,
- },
- "source": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- },
- "size": {
- Type: schema.TypeInt,
- Optional: true,
- Computed: true,
- ForceNew: true,
- },
- "format": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- },
- "base_volume_id": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- },
- "base_volume_pool": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- },
- "base_volume_name": {
- Type: schema.TypeString,
- Optional: true,
- ForceNew: true,
- },
- }
-}
-
func resourceLibvirtVolume() *schema.Resource {
return &schema.Resource{
Create: resourceLibvirtVolumeCreate,
Read: resourceLibvirtVolumeRead,
Delete: resourceLibvirtVolumeDelete,
- Schema: volumeCommonSchema(),
+ Schema: map[string]*schema.Schema{
+ "name": {
+ Type: schema.TypeString,
+ Required: true,
+ ForceNew: true,
+ },
+ "pool": {
+ Type: schema.TypeString,
+ Optional: true,
+ Default: "default",
+ ForceNew: true,
+ },
+ "source": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ },
+ "size": {
+ Type: schema.TypeInt,
+ Optional: true,
+ Computed: true,
+ ForceNew: true,
+ },
+ "format": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ },
+ "base_volume_id": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ },
+ "base_volume_pool": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ },
+ "base_volume_name": {
+ Type: schema.TypeString,
+ Optional: true,
+ ForceNew: true,
+ },
+ },
}
}