You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "mlsorensen (via GitHub)" <gi...@apache.org> on 2023/03/02 22:43:19 UTC

[GitHub] [cloudstack-go] mlsorensen opened a new pull request, #46: Generate account details correctly (accountdetails[0].somekey=someval)

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

   When creating or updating accounts using the API, the parameters are expected to be in format:
   
   ```
   accountdetails[0].somekey=someval
   ```
   
   not
   
   ```
   accountdetails[0].key=somekey
   accountdetails[0].value=someval
   ```
   
   Since `accountdetails` is handled via `default`, I'm using the `detailsRequireZeroIndex` list to ensure we don't make this change broad. Any other APIs that require this format can just be added to `detailsRequireZeroIndex` as we identify them, rather than making a sweeping change.
   
   I don't know what's up with the change in comment on the delete calls... possibly a change that wasn't properly committed earlier.


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


[GitHub] [cloudstack-go] rohityadavcloud merged pull request #46: Generate account details correctly (accountdetails[0].somekey=someval)

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud merged PR #46:
URL: https://github.com/apache/cloudstack-go/pull/46


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


[GitHub] [cloudstack-go] rohityadavcloud commented on pull request #46: Generate account details correctly (accountdetails[0].somekey=someval)

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

   Thanks @mlsorensen if this is fundamental issue with only the `accoundetails` param, your fix makes sense to me.


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


[GitHub] [cloudstack-go] rohityadavcloud commented on pull request #46: Generate account details correctly (accountdetails[0].somekey=someval)

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

   @mlsorensen one remark - could this cause backward compatibility issue (in case other users/clients are passing details with the old format, for example looking at cmk docs - https://github.com/apache/cloudstack-cloudmonkey/wiki/Usage#argument-passing)


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


[GitHub] [cloudstack-go] mlsorensen commented on pull request #46: Generate account details correctly (accountdetails[0].somekey=someval)

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

   > @mlsorensen one remark - could this cause backward compatibility issue (in case other users/clients are passing details with the old format, for example looking at cmk docs - https://github.com/apache/cloudstack-cloudmonkey/wiki/Usage#argument-passing)
   
   Hmm, I'm not sure. I can only say that passing it the way it has now doesn't actually work.  This PR I think actually moves it to work in accord with the link above where the desired key name is a part of the parameter (left side of "=").
   
   When it currently passes:
   
   ```
   accountdetails[0].key=aaa
   accountdetails[0].value=bbb
   ```
   
   you end up with this in the resulting account:
   
   ```
   "accountdetails": {
       "key": "aaa",
       "value: "bbb"
   }
   ```
   
   Whereas in some other APIs it gets interpreted as:
   
   ```
   "aaa": "bbb"
   ```


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