-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Adding few more function to ADHybridHealth swagger spec #3189
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
Conversation
Automation for azure-sdk-for-rubyNothing to generate for azure-sdk-for-ruby |
Automation for azure-sdk-for-pythonThe initial PR has been merged into your service PR: |
Automation for azure-sdk-for-nodeNothing to generate for azure-sdk-for-node |
Automation for azure-libraries-for-javaEncountered a Subprocess error: (azure-libraries-for-java)
Command: ['/usr/local/bin/autorest', '/tmp/tmp5k4xymgi/rest/specification/adhybridhealthservice/resource-manager/readme.md', '--azure-libraries-for-java-folder=/tmp/tmp5k4xymgi/sdk', '--fluent', '--java', '--multiapi', '--verbose'] AutoRest code generation utility [version: 2.0.4262; node: v7.10.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Loading AutoRest core '/root/.autorest/@[email protected]/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4278)
Loading AutoRest extension '@microsoft.azure/autorest.java' (~2.1.32->2.1.70)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.38->2.3.38)
FATAL: System.Exception: Duplicate File Generation: src/main/java/com/microsoft/azure/management/adhybridhealthservice/implementation/AddsServicesInner.java
at AutoRest.Core.CodeGenerator.<Write>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Core.CodeGenerator.<Write>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Java.Azure.Fluent.CodeGeneratorJvaf.<Generate>d__6.MoveNext() in /opt/vsts/work/1/s/src/azurefluent/CodeGeneratorJvaf.cs:line 58
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Java.Program.<ProcessInternal>d__3.MoveNext() in /opt/vsts/work/1/s/src/Program.cs:line 115
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NewPlugin.<Process>d__15.MoveNext()
FATAL: java/generate - FAILED
FATAL: Error: Plugin java reported failure.
Process() cancelled due to exception : Plugin java reported failure.
Error: Plugin java reported failure. |
Automation for azure-sdk-for-goThe initial PR has been merged into your service PR: |
|
@dsgouda, do you need any more information from me to start with this PR review? |
|
@gamitra will review soon |
dsgouda
left a comment
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.
Please address warnings in the CI linter build
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": " ", |
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.
Please provide a meaningful description.
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.
Added description text for all operations.
| "$ref": "./examples/UserPreference.json" | ||
| } | ||
| }, | ||
| "operationId": "addsServices_getUserPreference", |
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.
A recommended operation id would be UserPreferences_Get or AddsServicesUserPreference_Get
Also, just out of curiosity, what does Adds stand for
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.
@dsgouda, ok I will use AddsServicesUserPreference_get, since it aligns with the naming convention I have used for the previous operations also.
Adds is Active Directory Domain Service,
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 done.
| } | ||
| ], | ||
| "responses": { | ||
| "200": { |
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.
Please provide meaningful description for all operations
Please confirm whether this is a long running operation
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.
@dsgouda, did not get your point. What is a meaningful description for an operation which does not display any result? Do you have an example for me to follow?
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.
@dsgouda , also will be good if you can help me with an example for long running operation.
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.
So none of the operations listed in my swagger spec are long running.
Do I still need to add that flag? All the delete, add,get are targetted operations with a max latency of 6s.
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 one I left out, waiting for the clarification for my previous qs.
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.
Given the latency you do not need to set the flag.
| "type": "string" | ||
| }, | ||
| { | ||
| "name": "withDetails", |
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.
A better name for this parameter would be showDetails or fetchDetails
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 APIs are already in production and being used by UI, so I cant rename any parameter.
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.
Left this out also, because this is a production code.
| } | ||
| ], | ||
| "responses": { | ||
| "200": { |
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.
Please add x-ms-pageable extension
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 revisited this operation,. its not a list. It's a get function. I will change the name of the operation to avoid confusion.
| "tags": [ "Adds" ], | ||
| "description": "Gets Replication status for a given Active Directory Domain Service, that is onboarded to Azure Active Directory Connect Health.", | ||
| "x-ms-examples": { | ||
| "addsServices_getReplicationStatus": { |
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.
Please rename operationid to ReplicationStatus_Get or AddsServicesReplicationStatus_Get
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.
Done.
| "description": "The next partition key to query for.", | ||
| "required": true, | ||
| "type": "string", | ||
| "enum": [ " " ], |
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.
Please create a model definition and refer its schema for enum parameters
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.
The reason why it was added like this is:
The nextRowKey and nextPartitionKey were introduced to allow optimization from UI calls to our APIs. But that was never carried forward. I checked the code again and I see this is marked as mandate parameter but passed as string.Empty.
How to handle this scenario in swagger spec?
So the previous reviewer suggested using this enum pattern.
May I ask one question here, do we need to revisit the old changes? I have already got it reviewed and checked them in 1 month back. Reiterating through that will cost both of us time, I have done everything the previous reviewer asked me to do, and now I am again getting suggestion to re-do the same.
#2989
This is the previous pull request for your reference.
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.
Left this out, as mentioned above.
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.
The way the enum is modeled here is not the issue. We discourage usage of inline definitions of schemas (which is enum here). Please follow an example here and move the schema definition into definitions section
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.
Got it now. Will send another iteration with the change.
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.
@dsgouda , I made the changes for the enum definition as suggested by you. But after that build is failing:
https://travis-ci.org/Azure/azure-rest-api-specs/jobs/389568900
Can you please help me understand what am I doing wrong here? How can I correct that? Thanks for helping.
| "$ref": "./examples/Service_MetricSets.json" | ||
| } | ||
| }, | ||
| "operationId": "service_listMetrics", |
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.
Similar to all other operationids, please rename this to ServiceMetrics_List and Metrics_List
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.
Done.
| "ReplicationDetailsList": { | ||
| "description": "The list of replication details.", | ||
| "type": "object", | ||
| "properties": { |
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.
Please mark properties readOnly wherever applicable.
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.
Do you mean all input properties should be marked readonly?
In our code we dont explicitly have that enforcement.
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.
Need some help understanding this comment. I left it out of the current iteration. Once I get more clarification, I will add this.
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.
If the model properties are to have public getters, readOnly flag is not necessary. If not, it must be set for each of the properties of the model. This ensures better quality SDK
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.
Thanks for explaining. All the model properties for our service are public getters.
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.
@gamitra I think I misspoke here. My bad.
When the property setters of a model are to be public, the readOnly flag is not necessary. If you wish to ensure that the setters are non public, please set this flag.
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.
Went back and took a look. The setters are all public, so leaving this one.
|
@dsgouda, working on the linter error. The build looks flaky, most of the builds are failing with connection timeout error. |
|
@dsgouda, this started failing after I tried to move the enum to definition section as suggested by you. |
|
@gamitra looked into the CI failures and I think I know the issue. Looks like we can't have schema definitions for |
|
@dsgouda, sure I will revert it back to the previous change. The reason why we use emty enum here is: |
|
@gamitra please check the Json for correctness |
dsgouda
left a comment
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.
LGTM subject to CIs passing
|
@dsgouda , Build passed. I see you have signed off also. Thank You for that. |
|
Done. |
|
Thank You so much for your help. Really appreciate it! |
This Pull Request contains the Swagger specification for Microsoft.ADHybridHealthService RP.
This RP is for Azure Active Directory Connect Health service, which has been GA-ed for last 2 years.
Azure Active Directory (Azure AD) Connect Health helps you monitor and gain insights into your on-premises identity infrastructure and the synchronization services. It enables you to maintain a reliable connection to Office 365 and Microsoft Online Services by providing monitoring capabilities for your key identity components such as Active Directory Federation Services (AD FS) servers, Azure AD Connect servers (also known as Sync Engine), Active Directory domain controllers, etc. It also makes the key data points about these components easily accessible so that you can get usage and other important insights to make informed decisions.
The information is presented in the Azure AD Connect Health portal. In the Azure AD Connect Health portal, you can view alerts, performance monitoring, usage analytics, and other information. Azure AD Connect Health enables the single lens of health for your key identity components in one place.
More details about this RP can be found at:
https://docs.microsoft.com/en-us/azure/active-directory/connect-health/active-directory-aadconnect-health
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-versionin the path should match theapi-versionin the spec).Quality of Swagger