You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
253 lines
5.0 KiB
253 lines
5.0 KiB
package pcidevice
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
|
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
|
|
)
|
|
|
|
func dataSourcePcideviceSchemaMake() map[string]*schema.Schema {
|
|
rets := map[string]*schema.Schema{
|
|
"device_id": {
|
|
Type: schema.TypeInt,
|
|
Required: true,
|
|
},
|
|
"ckey": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"meta": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Schema{
|
|
Type: schema.TypeString,
|
|
},
|
|
},
|
|
"compute_id": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"description": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"guid": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"hw_path": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"name": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"rg_id": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"stack_id": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"status": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"system_name": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
}
|
|
return rets
|
|
}
|
|
|
|
func dataSourcePcideviceListSchemaMake() map[string]*schema.Schema {
|
|
rets := map[string]*schema.Schema{
|
|
"by_id": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "by_id",
|
|
},
|
|
"compute_id": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "compute_id",
|
|
},
|
|
"name": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
Description: "name",
|
|
},
|
|
"rg_id": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "rg_id",
|
|
},
|
|
"status": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
Description: "status",
|
|
},
|
|
"page": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "page number",
|
|
},
|
|
"size": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Description: "page size",
|
|
},
|
|
"items": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Description: "pcidevice list",
|
|
Elem: &schema.Resource{
|
|
Schema: map[string]*schema.Schema{
|
|
"device_id": {
|
|
Type: schema.TypeInt,
|
|
Required: true,
|
|
},
|
|
"ckey": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"meta": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Schema{
|
|
Type: schema.TypeString,
|
|
},
|
|
},
|
|
"compute_id": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"description": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"guid": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"hw_path": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"name": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"rg_id": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"stack_id": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"status": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"system_name": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"entry_count": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
Description: "entry count",
|
|
},
|
|
}
|
|
return rets
|
|
}
|
|
|
|
func resourcePcideviceSchemaMake() map[string]*schema.Schema {
|
|
return map[string]*schema.Schema{
|
|
"stack_id": {
|
|
Type: schema.TypeInt,
|
|
Required: true,
|
|
ValidateFunc: validation.IntAtLeast(1),
|
|
Description: "stackId",
|
|
},
|
|
"rg_id": {
|
|
Type: schema.TypeInt,
|
|
Required: true,
|
|
ValidateFunc: validation.IntAtLeast(1),
|
|
Description: "Resource GROUP",
|
|
},
|
|
"name": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
Description: "Name of Device",
|
|
},
|
|
"hw_path": {
|
|
Type: schema.TypeString,
|
|
Required: true,
|
|
Description: "PCI address of the device",
|
|
},
|
|
"ckey": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"compute_id": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"description": {
|
|
Type: schema.TypeString,
|
|
Optional: true,
|
|
Computed: true,
|
|
Description: "description, just for information",
|
|
},
|
|
"device_id": {
|
|
Type: schema.TypeInt,
|
|
Optional: true,
|
|
Computed: true,
|
|
},
|
|
"enable": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Default: false,
|
|
Description: "Enable pci device",
|
|
},
|
|
"force_delete": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Default: false,
|
|
Description: "Force delete",
|
|
},
|
|
"force_disable": {
|
|
Type: schema.TypeBool,
|
|
Optional: true,
|
|
Default: false,
|
|
Description: "Force disable",
|
|
},
|
|
"guid": {
|
|
Type: schema.TypeInt,
|
|
Computed: true,
|
|
},
|
|
"meta": {
|
|
Type: schema.TypeList,
|
|
Computed: true,
|
|
Elem: &schema.Schema{
|
|
Type: schema.TypeString,
|
|
},
|
|
},
|
|
"status": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
"system_name": {
|
|
Type: schema.TypeString,
|
|
Computed: true,
|
|
},
|
|
}
|
|
}
|