tetra12 opened a new issue #5979:
URL: https://github.com/apache/cloudstack/issues/5979


   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and main branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete 
the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   API
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on main 
branch.
   -->
   
   ~~~
   4.16.1.0-Snapshot
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, 
advanced networking, etc.  N/A otherwise
   -->
   Advanced Zone with SG
   
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   Ubuntu 21.10
   4.16.1.0-Snapshot master
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   Cloudstack server returns an empty response for both 
`authorizeSecurityGroupIngress` and `authorizeSecurityGroupEgress` methods. 
However, the job is done, rules are correctly added to desired SGs.
   
   Details on those API methods are 
[here](https://cloudstack.apache.org/api/apidocs-4.16/apis/authorizeSecurityGroupIngress.html)
   
   The issue with an empty response causes problems in downstream APIs, since 
SG Rule ID is required.
   
   I'm not sure how to reproduce this in Java, but I found this issue working 
with the Go API.
   See screens attached in the next section
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal 
test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   1. Setup an Adv Zone with SG enabled
   2. Create an empty SG
   3. Create an `authorizeSecurityGroupIngress` or 
`authorizeSecurityGroupEgress` API request
   4. Use the following SG Rule settings:
   
   Protocol = "tcp"
   CidrList = {"10.1.2.2/30", "10.1.3.3/30"}
   PortStart = 11111
   PortEnd = 22222
   
   5. Run API request
   6. Notice that the rule was added, the code is `200`  but the response 
contains only the `JobID` field. All others are empty
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   The full response struct is returned as per spec here: 
https://cloudstack.apache.org/api/apidocs-4.16/apis/authorizeSecurityGroupIngress.html
   
   The expected full struct is the following:
   
   type AuthorizeSecurityGroupIngressResponse struct {
        Account           string `json:"account"`
        Cidr              string `json:"cidr"`
        Endport           int    `json:"endport"`
        Icmpcode          int    `json:"icmpcode"`
        Icmptype          int    `json:"icmptype"`
        JobID             string `json:"jobid"`
        Jobstatus         int    `json:"jobstatus"`
        Protocol          string `json:"protocol"`
        Ruleid            string `json:"ruleid"`
        Securitygroupname string `json:"securitygroupname"`
        Startport         int    `json:"startport"`
        Tags              []Tags `json:"tags"`
   }
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   And the screenshot with an empty response from my debugger
   
![sg_resp](https://user-images.githubusercontent.com/45828526/153406502-4d2fb937-8862-4957-8363-3b67cd242561.png)
   
   ~~~
   Resp is `200`, the job is done, but the resp structure contains only JobID
   ~~~
   


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