Skip to content

Conversation

@gamitra
Copy link
Contributor

@gamitra gamitra commented Jun 7, 2018

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

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Jun 7, 2018

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link

AutorestCI commented Jun 7, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2709

@AutorestCI
Copy link

AutorestCI commented Jun 7, 2018

Automation for azure-sdk-for-node

Nothing to generate for azure-sdk-for-node

@AutorestCI
Copy link

AutorestCI commented Jun 7, 2018

Automation for azure-libraries-for-java

Encountered 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']
Finished with return code 1
and output:

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.

@AutorestCI
Copy link

AutorestCI commented Jun 7, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#2004

@gamitra
Copy link
Contributor Author

gamitra commented Jun 7, 2018

@dsgouda, do you need any more information from me to start with this PR review?

@dsgouda
Copy link
Contributor

dsgouda commented Jun 7, 2018

@gamitra will review soon

Copy link
Contributor

@dsgouda dsgouda left a 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": " ",
Copy link
Contributor

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.

Copy link
Contributor Author

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",
Copy link
Contributor

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

Copy link
Contributor Author

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,

Copy link
Contributor Author

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": {
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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",
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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": {
Copy link
Contributor

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

Copy link
Contributor Author

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": {
Copy link
Contributor

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

Copy link
Contributor Author

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": [ " " ],
Copy link
Contributor

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

Copy link
Contributor Author

@gamitra gamitra Jun 7, 2018

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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",
Copy link
Contributor

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

Copy link
Contributor Author

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": {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@dsgouda dsgouda Jun 7, 2018

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

dsgouda commented Jun 7, 2018

@gamitra Please address linter errors/warnings here

@gamitra
Copy link
Contributor Author

gamitra commented Jun 8, 2018

@dsgouda, working on the linter error. The build looks flaky, most of the builds are failing with connection timeout error.
I will update you once I have a good build ready for your review.

@dsgouda
Copy link
Contributor

dsgouda commented Jun 8, 2018

@gamitra the build is failing due to syntax errors reported here
Please take a look

@gamitra
Copy link
Contributor Author

gamitra commented Jun 8, 2018

@dsgouda, this started failing after I tried to move the enum to definition section as suggested by you.
However, I am unable to figure out why is this failure, been trying to resolve it from yesterday. Do you see any obvious issue?
It would be really helpful, if you can point me to the issue.

@dsgouda
Copy link
Contributor

dsgouda commented Jun 8, 2018

@gamitra looked into the CI failures and I think I know the issue. Looks like we can't have schema definitions for query parameters.
tldr;
Please revert to the earlier inline definition for the enum and that should fix the CI issues.
Lastly, could you explain why you need an empty enum here.
@fearthecowboy FYI

@gamitra
Copy link
Contributor Author

gamitra commented Jun 8, 2018

@dsgouda, sure I will revert it back to the previous change. The reason why we use emty enum here is:
The nextRowKey and nextPartitionKey were introduced to allow optimization from UI calls to our APIs. But that was never carried forward.However, in code this is marked as mandate parameter but passed as string.Empty.
That is the reason we had to craft the enum as empty.

@dsgouda
Copy link
Contributor

dsgouda commented Jun 8, 2018

@gamitra please check the Json for correctness

Copy link
Contributor

@dsgouda dsgouda left a 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

@gamitra
Copy link
Contributor Author

gamitra commented Jun 8, 2018

@dsgouda , Build passed. I see you have signed off also. Thank You for that.
How do I merge the pull request? The "Merge pull request" button for me is showing disabled..
Last review, the reviewer merged it for me.
Can you please help me merge this PR?

@dsgouda dsgouda merged commit fc63801 into Azure:master Jun 8, 2018
@dsgouda
Copy link
Contributor

dsgouda commented Jun 8, 2018

Done.

@gamitra
Copy link
Contributor Author

gamitra commented Jun 8, 2018

Thank You so much for your help. Really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants