-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new Sql VA API #18804
Add new Sql VA API #18804
Conversation
Hi, @shimonar1171 Thanks for your PR. I am workflow bot for review process. Here are some small tips. Any feedback about review process or workflow bot, pls contact swagger and tools team. vscswagger@microsoft.com |
[Call for Action] To better understand Azure service dev/test scenario, and support Azure service developer better on Swagger and REST API related tests in early phase, please help to fill in with this survey https://aka.ms/SurveyForEarlyPhase. It will take 5 to 10 minutes. If you already complete survey, please neglect this comment. Thanks. |
Swagger Validation Report
|
Swagger Generation Artifacts
|
Hi @shimonar1171, Your PR has some issues. Please fix the CI sequentially by following the order of
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
raosuhas, |
} | ||
} | ||
}, | ||
"post": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post in this case is needed because it will discard any old existing baseline on that database and sets the baselines as specified exactly in this request. please let me know if that makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still unsure about your POST action, it seems like it is creating some sort of resource(s) internally.
POSTs are not meant to create resources, POSTs are reserved for actions, see our documentation (first bullet point):
You are modeling your API incorrectly then.
It seems to me that you are invoking an action to create a set of baselineRules? which is invalid since you are using POST. For example, what happens when a user calls your POST API multiple times, what happens with the previous rules?
To me it seems like the modeling needs to be the following (assuming you only want to support 1 baseline):
Collection GET -> /baselines
CRUD on /baselines/default
-> default is used as a singleton, it means you are only supporting one baseline at a time - otherwise the API can model the API as /baselines/{baselineName}
if you want to support multiple baselines.
Then the PUT body for the above API will be your Baseline input.
Now, to retrieve baseline rules:
Collection GET -> /baselines/default/rules
to return all baseline rules
CRUD on /baselines/default/rules/{ruleId}
I strongly recommend reviewing our documentation: https://armwiki.azurewebsites.net/rp_onboarding/process/onboarding.html and RPC: https://github.com/Azure/azure-resource-manager-rpc
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does a user know which scanId
to use? My assumption is that scans
are created when you call a POST on initiateScan
but what happens if the user calls your POST API multiple times, how does he/she knows which scanId to pick? This applies to your SQLVulnerabilityAssesment resource type as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is exactly why we have the other get command in line 19 in this file, to list all the scans available for that database. the use case is as follows: customer initiates a new scan, then he uses the api in line 19 to query what scan ids are available under that database. it also includes some statistics as for how many rules have failed, so this api in line 78 was made in order to retrieve the statistics of that scan id in case the customer has it, and we have a special scan id which is 'latest' that will load the scan record for the latest scan
it seems ARM has signed off |
* Add new Sql VA API * Update server level API * Update API attributes * Update controlers * Add missing examples * Fix examples * Format JSON file * Update examples * Updae scan record API * Add ref to README file * Update version * Update enums * Add SystemData * add systemData * sort readme files * Update examples * Update remove baseline API * Add 204 respond to delete API * Add 204 error * Fixed error * Update description * Update swagger * fix PR comments, seperated baseline operations to /baselines/default/rules/ruleid * fix validations errors Co-authored-by: Ahmad Abas <ahabas@microsoft.com>
* Add new Sql VA API * Update server level API * Update API attributes * Update controlers * Add missing examples * Fix examples * Format JSON file * Update examples * Updae scan record API * Add ref to README file * Update version * Update enums * Add SystemData * add systemData * sort readme files * Update examples * Update remove baseline API * Add 204 respond to delete API * Add 204 error * Fixed error * Update description * Update swagger * fix PR comments, seperated baseline operations to /baselines/default/rules/ruleid * fix validations errors Co-authored-by: Ahmad Abas <ahabas@microsoft.com>
Changelog
Add a changelog entry for this PR by answering the following questions:
Contribution checklist:
If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist
Otherwise your PR may be subject to ARM review requirements. Complete the following:
Check this box if any of the following apply to the PR so that label "WaitForARMFeedback" will be added automatically to begin ARM API Review. Failure to comply may result in delays to the manifest.
Adding a new service
Adding new API(s)
Adding a new API version
-[ ] To review changes efficiently, ensure you are using OpenAPIHub to initialize the PR for adding a new version. More details, refer to the wiki.
Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.
If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.
Breaking Change Review Checklist
If any of the following scenarios apply to the PR, request approval from the Breaking Change Review Board as defined in the Breaking Change Policy.
Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
Please follow the link to find more details on PR review process.