/
schema.go
47 lines (45 loc) · 1.4 KB
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package lvmthin
import (
"github.com/awlsring/terraform-provider-proxmox/proxmox/filters"
ds "github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
)
// add storage class filter
var filter = filters.FilterConfig{"node"}
var dataSourceSchema = ds.Schema{
Attributes: map[string]ds.Attribute{
"filters": filter.Schema(),
"node_storage_lvms": ds.ListNestedAttribute{
Computed: true,
NestedObject: ds.NestedAttributeObject{
Attributes: map[string]ds.Attribute{
"id": ds.StringAttribute{
Computed: true,
Description: "The identifier of the node storage. Formatted as `{node}/{storage}`",
},
"storage": ds.StringAttribute{
Computed: true,
Description: "The name of the storage class this implements.",
},
"node": ds.StringAttribute{
Computed: true,
Description: "The node which the class implementation is on.",
},
"content_types": ds.ListAttribute{
Computed: true,
ElementType: types.StringType,
Description: "The content types that can be stored on this storage class.",
},
"size": ds.Int64Attribute{
Computed: true,
Description: "The size of the storage in bytes.",
},
"volume_group": ds.StringAttribute{
Computed: true,
Description: "The associated volume group.",
},
},
},
},
},
}