You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "tonymmm1 (via GitHub)" <gi...@apache.org> on 2024/07/22 08:40:52 UTC

[PR] work on expanding Quota api [cloudstack-go]

tonymmm1 opened a new pull request, #90:
URL: https://github.com/apache/cloudstack-go/pull/90

   (no comment)


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2254212671

   Implemented overrides for quotaBalance and quotaStatement that should work. 


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2254195056

   As of cloudstack 14.19.0.2 it seems like the quotaBalance response object does not match listApis.json from cmk-cli.
   
   
   Is the object I am receiving from cloudstack api.
   
   ```
   {
     "quotabalanceresponse": {
       "balance": {
         "startquota": 0,
         "credits": [],
         "startdate": "2024-07-27T11:32:15-0500",
         "currency": "$"
       }
     }
   }
   ```
   
   Is the generated type.
   
   ```
   type QuotaBalance struct {
   	Account   string  `json:"account"`
   	Accountid int64   `json:"accountid"`
   	Domain    int64   `json:"domain"`
   	JobID     string  `json:"jobid"`
   	Jobstatus int     `json:"jobstatus"`
   	Name      string  `json:"name"`
   	Quota     float64 `json:"quota"`
   	Type      int     `json:"type"`
   	Unit      string  `json:"unit"`
   }
   ```
   
   There seems to be no correlation between these types?


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland closed pull request #90: update listApis.json, Quota API, and fixed double url value handling
URL: https://github.com/apache/cloudstack-go/pull/90


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json and update Quota API [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2246719750

   ```user@linux make mocks
   user1@s1-desktopt1 go test -v ./...
   # github.com/apache/cloudstack-go/v2/cloudstack
   cloudstack/QuotaService.go:235:5: v declared and not used
   cloudstack/QuotaService.go:241:5: v declared and not used
   cloudstack/QuotaService.go:849:5: v declared and not used
   cloudstack/QuotaService.go:1418:5: v declared and not used
   FAIL    github.com/apache/cloudstack-go/v2/cloudstack [build failed]
   FAIL    github.com/apache/cloudstack-go/v2/examples [build failed]
   ?       github.com/apache/cloudstack-go/v2/generate     [no test files]
   FAIL    github.com/apache/cloudstack-go/v2/test [build failed]
   FAIL
   ```


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] work on expanding Quota api [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2246696439

   quotaUpdate that was generated has additional response fields in the struct when the documentation states it should only show "updated_on".
   
   ```
   type QuotaUpdateResponse struct {
   	JobID      string `json:"jobid"`
   	Jobstatus  int    `json:"jobstatus"`
   	Updated_on string `json:"updated_on"`
   }
   ```


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json and update Quota API [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2246743626

   Fixed the double/float type generation.
   
   ```Running Suite: Encoding Suite - /home/user1/git/cloudstack-go/test
   ==================================================================
   Random Seed: 1721788077
   
   Will run 4 of 4 specs
   ••••
   
   Ran 4 of 4 Specs in 0.000 seconds
   SUCCESS! -- 4 Passed | 0 Failed | 0 Pending | 0 Skipped
   --- PASS: TestEncodeValues (0.00s)
   === RUN   TestUUID
   --- PASS: TestUUID (0.00s)
   PASS
   ok      github.com/apache/cloudstack-go/v2/test 0.044s
   ```
   


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#discussion_r1883710327


##########
generate/generate.go:
##########
@@ -1865,6 +1865,20 @@ func (s *service) generateResponseType(a *API) {
 	tn := capitalize(strings.TrimPrefix(a.Name, "configure") + "Response")
 
 	// add custom response types for some specific API calls
+	if a.Name == "quotaBalance" {
+		pn("type QuotaBalanceResponse struct {")
+		pn("    Statement QuotaBalanceResponseType `json:\"balance\"`")
+		pn("}")
+		pn("")
+		pn("type QuotaBalanceResponseType struct {")
+		pn("    StartQuota float64  `json:\"startquota\"`")
+		pn("    Credits    []string `json:\"credits\"`")
+		pn("    StartDate  string   `json:\"startdate\"`")
+		pn("    Currency   string   `json:\"currency\"`")
+		pn("}")

Review Comment:
   @Pearl1594 is this resolved?



-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] work on expanding Quota api [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2246638950

   I noticed that the listApis.json was missing the api functions.


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on code in PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#discussion_r1867869799


##########
generate/generate.go:
##########
@@ -1865,6 +1865,20 @@ func (s *service) generateResponseType(a *API) {
 	tn := capitalize(strings.TrimPrefix(a.Name, "configure") + "Response")
 
 	// add custom response types for some specific API calls
+	if a.Name == "quotaBalance" {
+		pn("type QuotaBalanceResponse struct {")
+		pn("    Statement QuotaBalanceResponseType `json:\"balance\"`")
+		pn("}")
+		pn("")
+		pn("type QuotaBalanceResponseType struct {")
+		pn("    StartQuota float64  `json:\"startquota\"`")
+		pn("    Credits    []string `json:\"credits\"`")
+		pn("    StartDate  string   `json:\"startdate\"`")
+		pn("    Currency   string   `json:\"currency\"`")
+		pn("}")

Review Comment:
   Do we need to add EndDate and EndQuota as well?



-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2541600390

   @tonymmm1 can you deal with the conflict, please?


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2565667979

   @tonymmm1 , I rebased your code in PR #98 . please have a quick review if you can.


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json and update Quota API [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2246736045

   seems to be an issue with generator.go on double types


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] work on expanding Quota api [cloudstack-go]

Posted by "tonymmm1 (via GitHub)" <gi...@apache.org>.
tonymmm1 commented on PR #90:
URL: https://github.com/apache/cloudstack-go/pull/90#issuecomment-2243989711

   Requesting a review if any mistakes/issues in implementation.


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] update listApis.json, Quota API, and fixed double url value handling [cloudstack-go]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland closed pull request #90: update listApis.json, Quota API, and fixed double url value handling
URL: https://github.com/apache/cloudstack-go/pull/90


-- 
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: dev-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org