Skip to content
Prev Previous commit
Next Next commit
Update billing.json
  • Loading branch information
Santosh Sinha committed Jan 15, 2019
commit c81e2130e29fae03a78cb1bfec7529ea6510ae1e
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@
}
}
},
"/providers/Microsoft.Billing/DiscoverTenants?billingProfileId={billingProfileId}": {
"/providers/Microsoft.Billing/discoverTenants?billingProfileId={billingProfileId}": {
Copy link
Contributor

Choose a reason for hiding this comment

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

As billingProfileId is mandatory, this is likely better served by a POST action request where the billingProfileId is passed in the request body. See this for an example

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 API is designed for Power BI custom connector to achieve multi-tenancy. This design is approved by connector Team. It is a request flow which brings Tenant Id for a specified billingProfileId input. API is doing a tenant discovery and that's why it is named as "DiscoverTenant". I hope this clarifies your question.

Copy link
Contributor

Choose a reason for hiding this comment

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

This URL is not compliant with the Resource Provider Contract. It behaves as an action (POST) but is expressed as if it were a collection enumeration. To make this compliant with the RPC, you can model this as a POST/action, or this could be expressed as a normal collection enumeration:
`/providers/Microsoft.Billing/billingProfiles/{billingProfileId}/tenants/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes in swagger are committed to making the URL compliant with the Resource Provider Contract. The new URL is
'/providers/Microsoft.Billing/billingProfiles/{billingProfileId}/discoverTenants'

I am keeping the name discoverTenants as the sole purpose of this API is to discover the Tenants only. As all the review comments are implemented can you please mark this approve.

Copy link
Contributor

Choose a reason for hiding this comment

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

thank you for these changes. This path is syntactically correct. The resource type name in this case would be "discoverTenants" which is a bit odd, as verbs are atypical in a resource type name. I would prefer it to be named with a noun pattern for consistency. discoveredTenants would be substantially preferable in my opinion.

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 have done changes in resource type name from "discoverTenants" to "tenants" now.

"get": {
"tags": [
"TenantProperties"
"discoverTenants"
],
"x-ms-examples": {
"TenantPropertiesGet": {
Expand Down