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.
terraform-provider-dynamix/internal/service/cloudapi/bservice/schemas/schema_resource_bservice.go

200 lines
4.4 KiB

7 months ago
package schemas
import (
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
)
func MakeSchemaResourceBService() map[string]schema.Attribute {
return map[string]schema.Attribute{
"service_name": schema.StringAttribute{
Required: true,
},
"rg_id": schema.Int64Attribute{
Required: true,
},
"ssh_key": schema.StringAttribute{
Optional: true,
Computed: true,
},
"ssh_user": schema.StringAttribute{
Optional: true,
Computed: true,
},
"permanently": schema.BoolAttribute{
Optional: true,
},
"enable": schema.BoolAttribute{
Optional: true,
},
"restore": schema.BoolAttribute{
Optional: true,
},
"start": schema.BoolAttribute{
Optional: true,
},
"service_id": schema.Int64Attribute{
Optional: true,
Computed: true,
},
"snapshots": schema.ListNestedAttribute{
Optional: true,
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"guid": schema.StringAttribute{
Computed: true,
},
"label": schema.StringAttribute{
Computed: true,
},
"rollback": schema.BoolAttribute{
Optional: true,
},
"timestamp": schema.Int64Attribute{
Computed: true,
},
"valid": schema.BoolAttribute{
Computed: true,
},
},
},
},
"account_id": schema.Int64Attribute{
Computed: true,
},
"account_name": schema.StringAttribute{
Computed: true,
},
"base_domain": schema.StringAttribute{
Computed: true,
},
"computes": schema.ListNestedAttribute{
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"account_id": schema.Int64Attribute{
Computed: true,
},
"architecture": schema.StringAttribute{
Computed: true,
},
"compgroup_id": schema.Int64Attribute{
Computed: true,
},
"compgroup_name": schema.StringAttribute{
Computed: true,
},
"compgroup_role": schema.StringAttribute{
Computed: true,
},
"id": schema.Int64Attribute{
Computed: true,
},
"rg_id": schema.Int64Attribute{
Computed: true,
},
"stack_id": schema.Int64Attribute{
Computed: true,
},
"name": schema.StringAttribute{
Computed: true,
},
"status": schema.StringAttribute{
Computed: true,
},
"tech_status": schema.StringAttribute{
Computed: true,
},
},
},
},
"cpu_total": schema.Int64Attribute{
Computed: true,
},
"created_by": schema.StringAttribute{
Computed: true,
},
"created_time": schema.Int64Attribute{
Computed: true,
},
"deleted_by": schema.StringAttribute{
Computed: true,
},
"deleted_time": schema.Int64Attribute{
Computed: true,
},
"disk_total": schema.Int64Attribute{
Computed: true,
},
"gid": schema.Int64Attribute{
Computed: true,
},
"groups": schema.ListNestedAttribute{
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"computes": schema.Int64Attribute{
Computed: true,
},
"consistency": schema.BoolAttribute{
Computed: true,
},
"id": schema.Int64Attribute{
Computed: true,
},
"name": schema.StringAttribute{
Computed: true,
},
"status": schema.StringAttribute{
Computed: true,
},
"tech_status": schema.StringAttribute{
Computed: true,
},
},
},
},
"guid": schema.Int64Attribute{
Computed: true,
},
"milestones": schema.Int64Attribute{
Computed: true,
},
"parent_srv_id": schema.Int64Attribute{
Computed: true,
},
"parent_srv_type": schema.StringAttribute{
Computed: true,
},
"ram_total": schema.Int64Attribute{
Computed: true,
},
"rg_name": schema.StringAttribute{
Computed: true,
},
"status": schema.StringAttribute{
Computed: true,
},
"tech_status": schema.StringAttribute{
Computed: true,
},
"updated_by": schema.StringAttribute{
Computed: true,
},
"updated_time": schema.Int64Attribute{
Computed: true,
},
"user_managed": schema.BoolAttribute{
Computed: true,
},
"id": schema.StringAttribute{
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
}
}