vishesh92 commented on code in PR #138:
URL:
https://github.com/apache/cloudstack-terraform-provider/pull/138#discussion_r1818019962
##########
cloudstack/service_offering_constrained_resource.go:
##########
@@ -0,0 +1,270 @@
+package cloudstack
+
+import (
+ "context"
+ "fmt"
+
+ "github.com/apache/cloudstack-go/v2/cloudstack"
+ "github.com/hashicorp/terraform-plugin-framework/resource"
+ "github.com/hashicorp/terraform-plugin-framework/resource/schema"
+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int32planmodifier"
+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
+ "github.com/hashicorp/terraform-plugin-framework/types"
+ "github.com/hashicorp/terraform-plugin-framework/types/basetypes"
+)
+
+var (
+ _ resource.Resource = &serviceOfferingConstrainedResource{}
+ _ resource.ResourceWithConfigure = &serviceOfferingConstrainedResource{}
+)
+
+func NewserviceOfferingConstrainedResource() resource.Resource {
+ return &serviceOfferingConstrainedResource{}
+}
+
+type serviceOfferingConstrainedResource struct {
+ client *cloudstack.CloudStackClient
+}
+
+func (r *serviceOfferingConstrainedResource) Schema(_ context.Context, _
resource.SchemaRequest, resp *resource.SchemaResponse) {
+ resp.Schema = schema.Schema{
+ Attributes:
serviceOfferingMergeCommonSchema(map[string]schema.Attribute{
+ "cpu_speed": schema.Int32Attribute{
+ Description: "Speed of CPU in Mhz. This does
not apply to kvm.",
+ Required: true,
+ PlanModifiers: []planmodifier.Int32{
+ int32planmodifier.RequiresReplace(),
+ },
+ },
+ "max_cpu_number": schema.Int32Attribute{
+ Description: "The maximum number of CPUs to be
set with Custom Computer Offering",
+ Required: true,
+ PlanModifiers: []planmodifier.Int32{
+ int32planmodifier.RequiresReplace(),
+ },
+ },
+ "max_memory": schema.Int32Attribute{
+ Description: "The maximum memory size of the
custom service offering in MB",
+ Required: true,
+ PlanModifiers: []planmodifier.Int32{
+ int32planmodifier.RequiresReplace(),
+ },
+ },
+ "min_cpu_number": schema.Int32Attribute{
+ Description: "The minimum number of CPUs to be
set with Custom Computer Offering",
Review Comment:
```suggestion
Description: "The minimum number of CPUs to be
set with Custom Compute Offering",
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]