DaanHoogland commented on code in PR #197:
URL: 
https://github.com/apache/cloudstack-terraform-provider/pull/197#discussion_r2329766002


##########
cloudstack/data_source_cloudstack_limits.go:
##########
@@ -0,0 +1,210 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+
+package cloudstack
+
+import (
+       "bytes"
+       "crypto/sha256"
+       "encoding/hex"
+       "fmt"
+
+       "github.com/apache/cloudstack-go/v2/cloudstack"
+       "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+       "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
+)
+
+func dataSourceCloudStackLimits() *schema.Resource {
+       return &schema.Resource{
+               Read: dataSourceCloudStackLimitsRead,
+               Schema: map[string]*schema.Schema{
+                       "type": {
+                               Type:     schema.TypeString,
+                               Optional: true,
+                               ValidateFunc: validation.StringInSlice([]string{
+                                       "instance", "ip", "volume", "snapshot", 
"template", "project", "network", "vpc",
+                                       "cpu", "memory", "primarystorage", 
"secondarystorage",
+                               }, false), // false disables case-insensitive 
matching
+                               Description: "The type of resource to list the 
limits. Available types are: " +
+                                       "instance, ip, volume, snapshot, 
template, project, network, vpc, cpu, memory, " +
+                                       "primarystorage, secondarystorage",
+                       },
+                       "account": {
+                               Type:        schema.TypeString,
+                               Optional:    true,
+                               Description: "List resources by account. Must 
be used with the domain_id parameter.",
+                       },
+                       "domain_id": {
+                               Type:        schema.TypeString,
+                               Optional:    true,
+                               Description: "List only resources belonging to 
the domain specified.",
+                       },
+                       "projectid": {

Review Comment:
   @vishesh92 , isn’t this more consistent with cloudstack itself? I would say 
change the rest ; this is actually the correct semantics (unless there is a 
generic golang or terraform convention I’m not aware of)



-- 
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]

Reply via email to