1.0.1
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type ItemVFPoolModel struct {
|
||||
//required and optional fields
|
||||
VFPoolID types.Int64 `tfsdk:"vfpool_id"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
|
||||
// computed fields
|
||||
AccountAccess types.List `tfsdk:"account_access"`
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
Description types.String `tfsdk:"description"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
GUID types.Int64 `tfsdk:"guid"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
RGAccess types.List `tfsdk:"rg_access"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
UpdatedTime types.Int64 `tfsdk:"updated_time"`
|
||||
VFS []VFSModel `tfsdk:"vfs"`
|
||||
}
|
||||
|
||||
type VFSModel struct {
|
||||
NodeID types.Int64 `tfsdk:"node_id"`
|
||||
VFList []VFItemModel `tfsdk:"vf_list"`
|
||||
}
|
||||
|
||||
type VFItemModel struct {
|
||||
NicName types.String `tfsdk:"nic_name"`
|
||||
VFSInfo []VFSInfoItemModel `tfsdk:"vfs_info"`
|
||||
}
|
||||
|
||||
type VFSInfoItemModel struct {
|
||||
ID types.Int64 `tfsdk:"id"`
|
||||
Claimed types.Bool `tfsdk:"claimed"`
|
||||
VMID types.Int64 `tfsdk:"vm_id"`
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type ListVFPoolModel struct {
|
||||
// optional fields
|
||||
ByID types.Int64 `tfsdk:"by_id"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Description types.String `tfsdk:"description"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
AccountAccess types.Int64 `tfsdk:"account_access"`
|
||||
RgAccess types.Int64 `tfsdk:"rg_access"`
|
||||
SortBy types.String `tfsdk:"sort_by"`
|
||||
Page types.Int64 `tfsdk:"page"`
|
||||
Size types.Int64 `tfsdk:"size"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
|
||||
// compute fields
|
||||
Items []ItemVFPoolListModel `tfsdk:"items"`
|
||||
EntryCount types.Int64 `tfsdk:"entry_count"`
|
||||
}
|
||||
|
||||
type ItemVFPoolListModel struct {
|
||||
VFPoolID types.Int64 `tfsdk:"vfpool_id"`
|
||||
AccountAccess types.List `tfsdk:"account_access"`
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
Description types.String `tfsdk:"description"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
GUID types.Int64 `tfsdk:"guid"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
RGAccess types.List `tfsdk:"rg_access"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
UpdatedTime types.Int64 `tfsdk:"updated_time"`
|
||||
VFS []VFSListModel `tfsdk:"vfs"`
|
||||
}
|
||||
|
||||
type VFSListModel struct {
|
||||
NodeID types.Int64 `tfsdk:"node_id"`
|
||||
VFList []VFItemListModel `tfsdk:"vf_list"`
|
||||
}
|
||||
|
||||
type VFItemListModel struct {
|
||||
NicName types.String `tfsdk:"nic_name"`
|
||||
VFSInfo []VFSInfoItemListModel `tfsdk:"vfs_info"`
|
||||
}
|
||||
|
||||
type VFSInfoItemListModel struct {
|
||||
ID types.Int64 `tfsdk:"id"`
|
||||
Claimed types.Bool `tfsdk:"claimed"`
|
||||
VMID types.Int64 `tfsdk:"vm_id"`
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/attr"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type ResourceItemVFPoolModel struct {
|
||||
//required and optional fields
|
||||
Name types.String `tfsdk:"name"`
|
||||
Description types.String `tfsdk:"description"`
|
||||
AccountAccess types.List `tfsdk:"account_access"`
|
||||
RGAccess types.List `tfsdk:"rg_access"`
|
||||
Config types.List `tfsdk:"config"`
|
||||
Enable types.Bool `tfsdk:"enable"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
|
||||
// computed fields
|
||||
ID types.String `tfsdk:"id"`
|
||||
VFPoolID types.Int64 `tfsdk:"vfpool_id"`
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
GUID types.Int64 `tfsdk:"guid"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
UpdatedTime types.Int64 `tfsdk:"updated_time"`
|
||||
VFS types.List `tfsdk:"vfs"`
|
||||
}
|
||||
|
||||
type ResourceItemVFPoolConfigModel struct {
|
||||
NodeID types.Int64 `tfsdk:"node_id"`
|
||||
NicName types.String `tfsdk:"nic_name"`
|
||||
VFIDs types.List `tfsdk:"vf_ids"`
|
||||
}
|
||||
|
||||
var ResourceItemVFPoolConfig = map[string]attr.Type{
|
||||
"node_id": types.Int64Type,
|
||||
"nic_name": types.StringType,
|
||||
"vf_ids": types.ListType{ElemType: types.Int64Type},
|
||||
}
|
||||
|
||||
type ResourceIVFSModel struct {
|
||||
NodeID types.Int64 `tfsdk:"node_id"`
|
||||
VFList types.List `tfsdk:"vf_list"`
|
||||
}
|
||||
|
||||
var ResourceIVFS = map[string]attr.Type{
|
||||
"node_id": types.Int64Type,
|
||||
"vf_list": types.ListType{ElemType: types.ObjectType{AttrTypes: ResourceIVFItem}},
|
||||
}
|
||||
|
||||
type ResourceIVFItemModel struct {
|
||||
NicName types.String `tfsdk:"nic_name"`
|
||||
VFSInfo types.List `tfsdk:"vfs_info"`
|
||||
}
|
||||
|
||||
var ResourceIVFItem = map[string]attr.Type{
|
||||
"nic_name": types.StringType,
|
||||
"vfs_info": types.ListType{ElemType: types.ObjectType{AttrTypes: ResourceIVFSInfoItem}},
|
||||
}
|
||||
|
||||
type ResourceIVFSInfoItemModel struct {
|
||||
ID types.Int64 `tfsdk:"id"`
|
||||
Claimed types.Bool `tfsdk:"claimed"`
|
||||
VMID types.Int64 `tfsdk:"vm_id"`
|
||||
}
|
||||
|
||||
var ResourceIVFSInfoItem = map[string]attr.Type{
|
||||
"id": types.Int64Type,
|
||||
"claimed": types.BoolType,
|
||||
"vm_id": types.Int64Type,
|
||||
}
|
||||
Reference in New Issue
Block a user