1.0.1
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type DataSourceNode struct {
|
||||
//required field
|
||||
NodeID types.Int64 `tfsdk:"node_id"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
|
||||
//response field
|
||||
Consumption *ConsumptionModel `tfsdk:"consumption"`
|
||||
CpuInfo *CpuInfoModel `tfsdk:"cpu_info"`
|
||||
CPUAllocationRatio types.Int64 `tfsdk:"cpu_allocation_ratio"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
ID types.String `tfsdk:"id"`
|
||||
IPAddr types.List `tfsdk:"ipaddr"`
|
||||
IsolatedCPUs types.List `tfsdk:"isolated_cpus"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
NeedReboot types.Bool `tfsdk:"need_reboot"`
|
||||
NicInfo []NicInfoModel `tfsdk:"nic_info"`
|
||||
NumaTopology *NumaTopologyModel `tfsdk:"numa_topology"`
|
||||
ReservedCPUs types.List `tfsdk:"reserved_cpus"`
|
||||
Roles types.List `tfsdk:"roles"`
|
||||
SriovEnabled types.Bool `tfsdk:"sriov_enabled"`
|
||||
StackId types.Int64 `tfsdk:"stack_id"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
Version types.String `tfsdk:"version"`
|
||||
}
|
||||
|
||||
type ConsumptionModel struct {
|
||||
Consumed *ConsumedModel `tfsdk:"consumed"`
|
||||
Free *ResourcesInfo `tfsdk:"free"`
|
||||
Reserved *ResourcesInfo `tfsdk:"reserved"`
|
||||
Total *ResourcesInfo `tfsdk:"total"`
|
||||
Hostname types.String `tfsdk:"hostname"`
|
||||
}
|
||||
|
||||
type ConsumedModel struct {
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Computes types.Int64 `tfsdk:"computes"`
|
||||
Routers types.Int64 `tfsdk:"routers"`
|
||||
VCPU types.Int64 `tfsdk:"vcpu"`
|
||||
}
|
||||
|
||||
type ResourcesInfo struct {
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
}
|
||||
|
||||
type CpuInfoModel struct {
|
||||
ClockSpeed types.Int64 `tfsdk:"clock_speed"`
|
||||
CoreCount types.Int64 `tfsdk:"core_count"`
|
||||
PhysCount types.Int64 `tfsdk:"phys_count"`
|
||||
}
|
||||
|
||||
type NicInfoModel struct {
|
||||
Driver types.String `tfsdk:"driver"`
|
||||
MaxVFS types.Int64 `tfsdk:"max_vfs"`
|
||||
NumaNode types.Int64 `tfsdk:"numa_node"`
|
||||
NumVFS types.Int64 `tfsdk:"num_vfs"`
|
||||
OSName types.String `tfsdk:"os_name"`
|
||||
PCISlot types.String `tfsdk:"pci_slot"`
|
||||
VFList []VFList `tfsdk:"vf_list"`
|
||||
}
|
||||
|
||||
type VFList struct {
|
||||
FnID types.Int64 `tfsdk:"fn_id"`
|
||||
PCISlot types.String `tfsdk:"pci_slot"`
|
||||
}
|
||||
|
||||
type NumaTopologyModel struct {
|
||||
NodeNum types.Int64 `tfsdk:"node_num"`
|
||||
Nodes []NumaTopologyNodes `tfsdk:"nodes"`
|
||||
}
|
||||
|
||||
type NumaTopologyNodes struct {
|
||||
CPUList types.List `tfsdk:"cpu_list"`
|
||||
Memory *NumaTopologyNodesMemory `tfsdk:"memory"`
|
||||
}
|
||||
|
||||
type NumaTopologyNodesMemory struct {
|
||||
OneG types.Int64 `tfsdk:"one_g"`
|
||||
TwoM types.Int64 `tfsdk:"two_m"`
|
||||
Total types.Int64 `tfsdk:"total"`
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type DataSourceNodeList struct {
|
||||
// request fields
|
||||
ByID types.Int64 `tfsdk:"by_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Version types.String `tfsdk:"version"`
|
||||
Release types.String `tfsdk:"release"`
|
||||
SepID types.Int64 `tfsdk:"sep_id"`
|
||||
Role types.String `tfsdk:"role"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
SortBy types.String `tfsdk:"sort_by"`
|
||||
Page types.Int64 `tfsdk:"page"`
|
||||
Size types.Int64 `tfsdk:"size"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
Items []ItemNodeModel `tfsdk:"items"`
|
||||
EntryCount types.Int64 `tfsdk:"entry_count"`
|
||||
}
|
||||
|
||||
type ItemNodeModel struct {
|
||||
AdditionalPkgs types.List `tfsdk:"additional_pkgs"`
|
||||
CpuInfo *CpuInfoModel `tfsdk:"cpu_info"`
|
||||
Description types.String `tfsdk:"description"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
HostKey types.String `tfsdk:"hostkey"`
|
||||
IPAddr types.List `tfsdk:"ipaddr"`
|
||||
IsolatedCPUs types.List `tfsdk:"isolated_cpus"`
|
||||
LastCheck types.Int64 `tfsdk:"lastcheck"`
|
||||
MachineGUID types.String `tfsdk:"machine_guid"`
|
||||
MainboardSN types.String `tfsdk:"mainboard_sn"`
|
||||
Memory types.Int64 `tfsdk:"memory"`
|
||||
Milestones types.Int64 `tfsdk:"milestones"`
|
||||
Model types.String `tfsdk:"model"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
NeedReboot types.Bool `tfsdk:"need_reboot"`
|
||||
NetAddr []NetAddrModel `tfsdk:"net_addr"`
|
||||
NetworkMode types.String `tfsdk:"network_mode"`
|
||||
NicInfo []NicInfoModel `tfsdk:"nic_info"`
|
||||
NodeUUID types.String `tfsdk:"node_uuid"`
|
||||
NodeID types.Int64 `tfsdk:"node_id"`
|
||||
NumaTopology *NumaTopologyModel `tfsdk:"numa_topology"`
|
||||
PeerBackup types.Int64 `tfsdk:"peer_backup"`
|
||||
PeerLog types.Int64 `tfsdk:"peer_log"`
|
||||
PeerStats types.Int64 `tfsdk:"peer_stats"`
|
||||
Pgpus types.List `tfsdk:"pgpus"`
|
||||
PublicKeys types.List `tfsdk:"public_keys"`
|
||||
Release types.String `tfsdk:"release"`
|
||||
ReservedCPUs types.List `tfsdk:"reserved_cpus"`
|
||||
Roles types.List `tfsdk:"roles"`
|
||||
SEPs types.List `tfsdk:"seps"`
|
||||
SerialNum types.String `tfsdk:"serial_num"`
|
||||
SriovEnabled types.Bool `tfsdk:"sriov_enabled"`
|
||||
StackId types.Int64 `tfsdk:"stack_id"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
Tags types.List `tfsdk:"tags"`
|
||||
Type types.String `tfsdk:"type"`
|
||||
Version types.String `tfsdk:"version"`
|
||||
}
|
||||
|
||||
type NetAddrModel struct {
|
||||
CIDR types.List `tfsdk:"cidr"`
|
||||
Index types.Int64 `tfsdk:"index"`
|
||||
IP types.List `tfsdk:"ip"`
|
||||
MAC types.String `tfsdk:"mac"`
|
||||
MTU types.Int64 `tfsdk:"mtu"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
}
|
||||
Reference in New Issue
Block a user