1.0.0
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type K8ciListModel struct {
|
||||
// request fields
|
||||
ByID types.Int64 `tfsdk:"by_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
WorkerDriver types.String `tfsdk:"worker_driver"`
|
||||
MasterDriver types.String `tfsdk:"master_driver"`
|
||||
NetworkPlugins types.String `tfsdk:"network_plugins"`
|
||||
IncludeDisabled types.Bool `tfsdk:"include_disabled"`
|
||||
Page types.Int64 `tfsdk:"page"`
|
||||
SortBy types.String `tfsdk:"sort_by"`
|
||||
Size types.Int64 `tfsdk:"size"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
Items []ItemInListK8ciModel `tfsdk:"items"`
|
||||
EntryCount types.Int64 `tfsdk:"entry_count"`
|
||||
}
|
||||
|
||||
type ItemInListK8ciModel struct {
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
Description types.String `tfsdk:"desc"`
|
||||
K8CIID types.Int64 `tfsdk:"k8ci_id"`
|
||||
LBImageID types.Int64 `tfsdk:"lb_image_id"`
|
||||
K8CIName types.String `tfsdk:"k8ci_name"`
|
||||
NetworkPlugins types.List `tfsdk:"network_plugins"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
Version types.String `tfsdk:"version"`
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type RecordK8SDataSourceModel struct {
|
||||
// request fields
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
ACL *RecordACLDataSourceModel `tfsdk:"acl"`
|
||||
AccountID types.Int64 `tfsdk:"account_id"`
|
||||
AccountName types.String `tfsdk:"account_name"`
|
||||
BServiceID types.Int64 `tfsdk:"bservice_id"`
|
||||
K8CI types.Int64 `tfsdk:"k8sci_id"`
|
||||
CreatedBy types.String `tfsdk:"created_by"`
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
DeletedBy types.String `tfsdk:"deleted_by"`
|
||||
DeletedTime types.Int64 `tfsdk:"deleted_time"`
|
||||
ExtNetID types.Int64 `tfsdk:"extnet_id"`
|
||||
K8CIName types.String `tfsdk:"k8sci_name"`
|
||||
Masters *MasterGroupDataSourceModel `tfsdk:"masters"`
|
||||
Workers []ItemK8SGroupDataSourceModel `tfsdk:"workers"`
|
||||
LBID types.Int64 `tfsdk:"lb_id"`
|
||||
LBIP types.String `tfsdk:"lb_ip"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
NetworkPlugin types.String `tfsdk:"network_plugin"`
|
||||
RGID types.Int64 `tfsdk:"rg_id"`
|
||||
RGName types.String `tfsdk:"rg_name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
UpdatedBy types.String `tfsdk:"updated_by"`
|
||||
UpdatedTime types.Int64 `tfsdk:"updated_time"`
|
||||
Kubeconfig types.String `tfsdk:"kubeconfig"`
|
||||
VinsId types.Int64 `tfsdk:"vins_id"`
|
||||
}
|
||||
|
||||
type RecordACLDataSourceModel struct {
|
||||
AccountACL []ItemACLDataSourceModel `tfsdk:"account_acl"`
|
||||
K8SACL []ItemACLDataSourceModel `tfsdk:"k8s_acl"`
|
||||
RGACL []ItemACLDataSourceModel `tfsdk:"rg_acl"`
|
||||
}
|
||||
|
||||
type ItemACLDataSourceModel struct {
|
||||
Explicit types.Bool `tfsdk:"explicit"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
Right types.String `tfsdk:"right"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
Type types.String `tfsdk:"type"`
|
||||
UserGroupID types.String `tfsdk:"user_group_id"`
|
||||
}
|
||||
|
||||
type MasterGroupDataSourceModel struct {
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
DetailedInfo []ItemDetailedInfoDataSourceModel `tfsdk:"detailed_info"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
MasterGroupId types.Int64 `tfsdk:"master_group_id"`
|
||||
MasterGroupName types.String `tfsdk:"master_group_name"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
}
|
||||
|
||||
type ItemK8SGroupDataSourceModel struct {
|
||||
Annotations types.List `tfsdk:"annotations"`
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
DetailedInfo []ItemDetailedInfoDataSourceModel `tfsdk:"detailed_info"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
WorkerGroupID types.Int64 `tfsdk:"worker_group_id"`
|
||||
Labels types.List `tfsdk:"labels"`
|
||||
WorkerGroupName types.String `tfsdk:"worker_group_name"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Taints types.List `tfsdk:"taints"`
|
||||
}
|
||||
|
||||
type ItemDetailedInfoDataSourceModel struct {
|
||||
ComputeId types.Int64 `tfsdk:"compute_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
Interfaces []ItemInterfacesDataSourceModel `tfsdk:"interfaces"`
|
||||
NatableVinsIp types.String `tfsdk:"natable_vins_ip"`
|
||||
NatableVinsNetwork types.String `tfsdk:"natable_vins_network"`
|
||||
}
|
||||
|
||||
type ItemInterfacesDataSourceModel struct {
|
||||
DefGw types.String `tfsdk:"def_gw"`
|
||||
IpAddress types.String `tfsdk:"ip_address"`
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type K8SComputesModel struct {
|
||||
// request fields
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
Masters []ItemComputeModel `tfsdk:"masters"`
|
||||
Workers []ItemComputeModel `tfsdk:"workers"`
|
||||
}
|
||||
|
||||
type ItemComputeModel struct {
|
||||
ComputeId types.Int64 `tfsdk:"compute_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
GroupName types.String `tfsdk:"group_name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type K8SListModel struct {
|
||||
// request fields
|
||||
ByID types.Int64 `tfsdk:"by_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
IPAddress types.String `tfsdk:"ip_address"`
|
||||
RGID types.Int64 `tfsdk:"rg_id"`
|
||||
LBID types.Int64 `tfsdk:"lb_id"`
|
||||
BasicServiceID types.Int64 `tfsdk:"bservice_id"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
IncludeDeleted types.Bool `tfsdk:"includedeleted"`
|
||||
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 []ItemInListK8SModel `tfsdk:"items"`
|
||||
EntryCount types.Int64 `tfsdk:"entry_count"`
|
||||
}
|
||||
|
||||
type ItemInListK8SModel struct {
|
||||
AccountID types.Int64 `tfsdk:"account_id"`
|
||||
AccountName types.String `tfsdk:"account_name"`
|
||||
ACL types.List `tfsdk:"acl"`
|
||||
BServiceID types.Int64 `tfsdk:"bservice_id"`
|
||||
CIID types.Int64 `tfsdk:"k8sci_id"`
|
||||
CreatedBy types.String `tfsdk:"created_by"`
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
DeletedBy types.String `tfsdk:"deleted_by"`
|
||||
DeletedTime types.Int64 `tfsdk:"deleted_time"`
|
||||
Description types.String `tfsdk:"desc"`
|
||||
ExtNetID types.Int64 `tfsdk:"extnet_id"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
GUID types.Int64 `tfsdk:"guid"`
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
LBID types.Int64 `tfsdk:"lb_id"`
|
||||
Milestones types.Int64 `tfsdk:"milestones"`
|
||||
Name types.String `tfsdk:"k8s_name"`
|
||||
NetworkPlugin types.String `tfsdk:"network_plugin"`
|
||||
RGID types.Int64 `tfsdk:"rg_id"`
|
||||
RGName types.String `tfsdk:"rg_name"`
|
||||
ServiceAccount *ServiceAccountInListModel `tfsdk:"service_account"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
UpdatedBy types.String `tfsdk:"updated_by"`
|
||||
UpdatedTime types.Int64 `tfsdk:"updated_time"`
|
||||
VINSID types.Int64 `tfsdk:"vins_id"`
|
||||
WorkersGroup []ItemWGInListModel `tfsdk:"workers_groups"`
|
||||
}
|
||||
|
||||
type ServiceAccountInListModel struct {
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
Password types.String `tfsdk:"password"`
|
||||
Username types.String `tfsdk:"username"`
|
||||
}
|
||||
|
||||
type ItemWGInListModel struct {
|
||||
Annotations types.List `tfsdk:"annotations"`
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
DetailedInfo []ItemDetailedInfoInListModel `tfsdk:"detailed_info"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
WorkerGroupID types.Int64 `tfsdk:"worker_group_id"`
|
||||
Labels types.List `tfsdk:"labels"`
|
||||
WorkerGroupName types.String `tfsdk:"worker_group_name"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Taints types.List `tfsdk:"taints"`
|
||||
}
|
||||
|
||||
type ItemDetailedInfoInListModel struct {
|
||||
Externalip types.String `tfsdk:"externalip"`
|
||||
ID types.Int64 `tfsdk:"id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type K8SListDeletedModel struct {
|
||||
// request fields
|
||||
ByID types.Int64 `tfsdk:"by_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
IPAddress types.String `tfsdk:"ip_address"`
|
||||
RGID types.Int64 `tfsdk:"rg_id"`
|
||||
LBID types.Int64 `tfsdk:"lb_id"`
|
||||
BasicServiceID types.Int64 `tfsdk:"bservice_id"`
|
||||
TechStatus types.String `tfsdk:"tech_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 []ItemInListDeletedK8SModel `tfsdk:"items"`
|
||||
EntryCount types.Int64 `tfsdk:"entry_count"`
|
||||
}
|
||||
|
||||
type ItemInListDeletedK8SModel struct {
|
||||
AccountID types.Int64 `tfsdk:"account_id"`
|
||||
AccountName types.String `tfsdk:"account_name"`
|
||||
ACL types.List `tfsdk:"acl"`
|
||||
BServiceID types.Int64 `tfsdk:"bservice_id"`
|
||||
CIID types.Int64 `tfsdk:"k8sci_id"`
|
||||
CreatedBy types.String `tfsdk:"created_by"`
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
DeletedBy types.String `tfsdk:"deleted_by"`
|
||||
DeletedTime types.Int64 `tfsdk:"deleted_time"`
|
||||
Description types.String `tfsdk:"desc"`
|
||||
ExtNetID types.Int64 `tfsdk:"extnet_id"`
|
||||
GID types.Int64 `tfsdk:"gid"`
|
||||
GUID types.Int64 `tfsdk:"guid"`
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
LBID types.Int64 `tfsdk:"lb_id"`
|
||||
Milestones types.Int64 `tfsdk:"milestones"`
|
||||
Name types.String `tfsdk:"k8s_name"`
|
||||
NetworkPlugin types.String `tfsdk:"network_plugin"`
|
||||
RGID types.Int64 `tfsdk:"rg_id"`
|
||||
RGName types.String `tfsdk:"rg_name"`
|
||||
ServiceAccount *ServiceAccountInListDeletedModel `tfsdk:"service_account"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
UpdatedBy types.String `tfsdk:"updated_by"`
|
||||
UpdatedTime types.Int64 `tfsdk:"updated_time"`
|
||||
VINSID types.Int64 `tfsdk:"vins_id"`
|
||||
WorkersGroup []ItemWGInListDeletedModel `tfsdk:"workers_groups"`
|
||||
}
|
||||
|
||||
type ServiceAccountInListDeletedModel struct {
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
Password types.String `tfsdk:"password"`
|
||||
Username types.String `tfsdk:"username"`
|
||||
}
|
||||
|
||||
type ItemWGInListDeletedModel struct {
|
||||
Annotations types.List `tfsdk:"annotations"`
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
DetailedInfo []ItemDetailedInfoInListDeletedModel `tfsdk:"detailed_info"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
WorkerGroupID types.Int64 `tfsdk:"worker_group_id"`
|
||||
Labels types.List `tfsdk:"labels"`
|
||||
WorkerGroupName types.String `tfsdk:"worker_group_name"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Taints types.List `tfsdk:"taints"`
|
||||
}
|
||||
|
||||
type ItemDetailedInfoInListDeletedModel struct {
|
||||
Externalip types.String `tfsdk:"externalip"`
|
||||
ID types.Int64 `tfsdk:"id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type K8SWgModel struct {
|
||||
// request fields
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
WorkerGroupID types.Int64 `tfsdk:"wg_id"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
Annotations types.List `tfsdk:"annotations"`
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
DetailedInfo []ItemDetailedInfoInWgModel `tfsdk:"detailed_info"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
Labels types.List `tfsdk:"labels"`
|
||||
WorkerGroupName types.String `tfsdk:"worker_group_name"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Taints types.List `tfsdk:"taints"`
|
||||
}
|
||||
|
||||
type ItemDetailedInfoInWgModel struct {
|
||||
ComputeId types.Int64 `tfsdk:"compute_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
Interfaces []ItemInterfacesInWgModel `tfsdk:"interfaces"`
|
||||
NatableVinsIp types.String `tfsdk:"natable_vins_ip"`
|
||||
NatableVinsNetwork types.String `tfsdk:"natable_vins_network"`
|
||||
}
|
||||
|
||||
type ItemInterfacesInWgModel struct {
|
||||
DefGw types.String `tfsdk:"def_gw"`
|
||||
IpAddress types.String `tfsdk:"ip_address"`
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type RecordK8SWgCloudInitDataSourceModel struct {
|
||||
// request fields
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
WgId types.Int64 `tfsdk:"wg_id"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
CloudInit types.String `tfsdk:"cloud_init"`
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
)
|
||||
|
||||
type K8SWgListModel struct {
|
||||
// request fields
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
Items []ItemWgListModel `tfsdk:"items"`
|
||||
}
|
||||
|
||||
type ItemWgListModel struct {
|
||||
Annotations types.List `tfsdk:"annotations"`
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
DetailedInfo []ItemDetailedInfoDataSourceModel `tfsdk:"detailed_info"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
Labels types.List `tfsdk:"labels"`
|
||||
WorkerGroupID types.Int64 `tfsdk:"worker_group_id"`
|
||||
WorkerGroupName types.String `tfsdk:"worker_group_name"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Taints types.List `tfsdk:"taints"`
|
||||
}
|
||||
|
||||
type ItemDetailedInfoInWgListModel struct {
|
||||
ComputeId types.Int64 `tfsdk:"compute_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
Interfaces []ItemInterfacesInWgModel `tfsdk:"interfaces"`
|
||||
NatableVinsIp types.String `tfsdk:"natable_vins_ip"`
|
||||
NatableVinsNetwork types.String `tfsdk:"natable_vins_network"`
|
||||
}
|
||||
|
||||
type ItemInterfacesInWgListModel struct {
|
||||
DefGw types.String `tfsdk:"def_gw"`
|
||||
IpAddress types.String `tfsdk:"ip_address"`
|
||||
}
|
||||
124
internal/service/cloudapi/k8s/models/model_resource_k8s_cp.go
Normal file
124
internal/service/cloudapi/k8s/models/model_resource_k8s_cp.go
Normal file
@@ -0,0 +1,124 @@
|
||||
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 ResourceK8SCPModel struct {
|
||||
// request fields
|
||||
Name types.String `tfsdk:"name"`
|
||||
RGID types.Int64 `tfsdk:"rg_id"`
|
||||
K8SCIID types.Int64 `tfsdk:"k8sci_id"`
|
||||
NetworkPlugin types.String `tfsdk:"network_plugin"`
|
||||
SEPID types.Int64 `tfsdk:"sep_id"`
|
||||
SEPPool types.String `tfsdk:"sep_pool"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
ExtNetID types.Int64 `tfsdk:"extnet_id"`
|
||||
VinsId types.Int64 `tfsdk:"vins_id"`
|
||||
WithLB types.Bool `tfsdk:"with_lb"`
|
||||
HighlyAvailable types.Bool `tfsdk:"ha_mode"`
|
||||
AdditionalSANs types.List `tfsdk:"additional_sans"`
|
||||
InitConfiguration types.String `tfsdk:"init_config"`
|
||||
ClusterConfiguration types.String `tfsdk:"cluster_config"`
|
||||
KubeletConfiguration types.String `tfsdk:"kubelet_config"`
|
||||
KubeProxyConfiguration types.String `tfsdk:"kube_proxy_config"`
|
||||
JoinConfiguration types.String `tfsdk:"join_config"`
|
||||
Description types.String `tfsdk:"desc"`
|
||||
ExtNetOnly types.Bool `tfsdk:"extnet_only"`
|
||||
OidcCertificate types.String `tfsdk:"oidc_cert"`
|
||||
Start types.Bool `tfsdk:"start"`
|
||||
Enabled types.Bool `tfsdk:"enabled"`
|
||||
Permanently types.Bool `tfsdk:"permanently"`
|
||||
Restore types.Bool `tfsdk:"restore"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
LBSysctlParams types.List `tfsdk:"lb_sysctl_params"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
LastUpdated types.String `tfsdk:"last_updated"`
|
||||
ACL types.Object `tfsdk:"acl"`
|
||||
DetailedInfo types.List `tfsdk:"detailed_info"`
|
||||
AccountID types.Int64 `tfsdk:"account_id"`
|
||||
AccountName types.String `tfsdk:"account_name"`
|
||||
BServiceID types.Int64 `tfsdk:"bservice_id"`
|
||||
CreatedBy types.String `tfsdk:"created_by"`
|
||||
CreatedTime types.Int64 `tfsdk:"created_time"`
|
||||
DeletedBy types.String `tfsdk:"deleted_by"`
|
||||
DeletedTime types.Int64 `tfsdk:"deleted_time"`
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
K8CIName types.String `tfsdk:"k8s_ci_name"`
|
||||
LBID types.Int64 `tfsdk:"lb_id"`
|
||||
LBIP types.String `tfsdk:"lb_ip"`
|
||||
MasterGroupId types.Int64 `tfsdk:"master_group_id"`
|
||||
MasterGroupName types.String `tfsdk:"master_group_name"`
|
||||
RGName types.String `tfsdk:"rg_name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
UpdatedBy types.String `tfsdk:"updated_by"`
|
||||
UpdatedTime types.Int64 `tfsdk:"updated_time"`
|
||||
Kubeconfig types.String `tfsdk:"kubeconfig"`
|
||||
}
|
||||
|
||||
type RecordACLModel struct {
|
||||
AccountACL types.List `tfsdk:"account_acl"`
|
||||
K8SACL types.List `tfsdk:"k8s_acl"`
|
||||
RGACL types.List `tfsdk:"rg_acl"`
|
||||
}
|
||||
|
||||
type ItemACLModel struct {
|
||||
Explicit types.Bool `tfsdk:"explicit"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
Right types.String `tfsdk:"right"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
Type types.String `tfsdk:"type"`
|
||||
UserGroupID types.String `tfsdk:"user_group_id"`
|
||||
}
|
||||
|
||||
type ItemDetailedInfoModel struct {
|
||||
ComputeId types.Int64 `tfsdk:"compute_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
Interfaces types.List `tfsdk:"interfaces"`
|
||||
NatableVinsIp types.String `tfsdk:"natable_vins_ip"`
|
||||
NatableVinsNetwork types.String `tfsdk:"natable_vins_network"`
|
||||
}
|
||||
|
||||
type ItemInterfacesModel struct {
|
||||
DefGw types.String `tfsdk:"def_gw"`
|
||||
IpAddress types.String `tfsdk:"ip_address"`
|
||||
}
|
||||
|
||||
var ItemInterfaces map[string]attr.Type = map[string]attr.Type{
|
||||
"def_gw": types.StringType,
|
||||
"ip_address": types.StringType,
|
||||
}
|
||||
|
||||
var ListACL map[string]attr.Type = map[string]attr.Type{
|
||||
"account_acl": types.ListType{ElemType: types.ObjectType{AttrTypes: ItemAcl}},
|
||||
"k8s_acl": types.ListType{ElemType: types.ObjectType{AttrTypes: ItemAcl}},
|
||||
"rg_acl": types.ListType{ElemType: types.ObjectType{AttrTypes: ItemAcl}},
|
||||
}
|
||||
|
||||
var ItemAcl map[string]attr.Type = map[string]attr.Type{
|
||||
"explicit": types.BoolType,
|
||||
"guid": types.StringType,
|
||||
"right": types.StringType,
|
||||
"status": types.StringType,
|
||||
"type": types.StringType,
|
||||
"user_group_id": types.StringType,
|
||||
}
|
||||
|
||||
var ItemDetailedInfo map[string]attr.Type = map[string]attr.Type{
|
||||
"compute_id": types.Int64Type,
|
||||
"name": types.StringType,
|
||||
"status": types.StringType,
|
||||
"tech_status": types.StringType,
|
||||
"interfaces": types.ListType{ElemType: types.ObjectType{AttrTypes: ItemInterfaces}},
|
||||
"natable_vins_ip": types.StringType,
|
||||
"natable_vins_network": types.StringType,
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
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 ResourceK8SWGModel struct {
|
||||
// request fields
|
||||
K8SID types.Int64 `tfsdk:"k8s_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Num types.Int64 `tfsdk:"num"`
|
||||
CPU types.Int64 `tfsdk:"cpu"`
|
||||
RAM types.Int64 `tfsdk:"ram"`
|
||||
Disk types.Int64 `tfsdk:"disk"`
|
||||
Annotations types.List `tfsdk:"annotations"`
|
||||
Labels types.List `tfsdk:"labels"`
|
||||
Taints types.List `tfsdk:"taints"`
|
||||
WorkerSEPID types.Int64 `tfsdk:"worker_sep_id"`
|
||||
WorkerSEPPool types.String `tfsdk:"worker_sep_pool"`
|
||||
CloudInit types.String `tfsdk:"cloud_init"`
|
||||
Timeouts timeouts.Value `tfsdk:"timeouts"`
|
||||
// response fields
|
||||
Id types.String `tfsdk:"id"`
|
||||
LastUpdated types.String `tfsdk:"last_updated"`
|
||||
WorkerGroupId types.Int64 `tfsdk:"wg_id"`
|
||||
DetailedInfo types.List `tfsdk:"detailed_info"`
|
||||
GUID types.String `tfsdk:"guid"`
|
||||
}
|
||||
|
||||
type ItemDetailedInfoInK8sWGModel struct {
|
||||
ComputeId types.Int64 `tfsdk:"compute_id"`
|
||||
Name types.String `tfsdk:"name"`
|
||||
Status types.String `tfsdk:"status"`
|
||||
TechStatus types.String `tfsdk:"tech_status"`
|
||||
Interfaces types.List `tfsdk:"interfaces"`
|
||||
NatableVinsIp types.String `tfsdk:"natable_vins_ip"`
|
||||
NatableVinsNetwork types.String `tfsdk:"natable_vins_network"`
|
||||
}
|
||||
|
||||
type ItemInterfacesInK8sWGModel struct {
|
||||
DefGw types.String `tfsdk:"def_gw"`
|
||||
IpAddress types.String `tfsdk:"ip_address"`
|
||||
}
|
||||
|
||||
var ItemInterfacesInK8sWG map[string]attr.Type = map[string]attr.Type{
|
||||
"def_gw": types.StringType,
|
||||
"ip_address": types.StringType,
|
||||
}
|
||||
|
||||
var ItemDetailedInfoInK8sWG map[string]attr.Type = map[string]attr.Type{
|
||||
"compute_id": types.Int64Type,
|
||||
"name": types.StringType,
|
||||
"status": types.StringType,
|
||||
"tech_status": types.StringType,
|
||||
"interfaces": types.ListType{ElemType: types.ObjectType{AttrTypes: ItemInterfaces}},
|
||||
"natable_vins_ip": types.StringType,
|
||||
"natable_vins_network": types.StringType,
|
||||
}
|
||||
Reference in New Issue
Block a user