-
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
[Ready to MERGE] Swagger for Tenant Properties API #5038
Changes from 3 commits
5d3784a
38018ad
c81e213
33d848a
5c877c2
c736ede
7a96d09
eab3b0f
b6137f4
53fb8f8
b405815
42f98d2
0d55ad6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,6 +200,47 @@ | |
} | ||
} | ||
}, | ||
"/providers/Microsoft.Billing/discoverTenants?billingProfileId={billingProfileId}": { | ||
"get": { | ||
"tags": [ | ||
"discoverTenants" | ||
], | ||
"x-ms-examples": { | ||
"TenantPropertiesGet": { | ||
"$ref": "./examples/TenantPropertiesGet.json" | ||
} | ||
}, | ||
"operationId": "TenantProperties_Get", | ||
"description": "Gets a Tenant Properties.", | ||
"parameters": [ | ||
{ | ||
"name": "billingProfileId", | ||
"in": "path", | ||
"description": "Billing Profile Id.", | ||
"required": true, | ||
"type": "string" | ||
}, | ||
{ | ||
"$ref": "#/parameters/apiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK. The request has succeeded.", | ||
"schema": { | ||
"$ref": "#/definitions/TenantProperties" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"/subscriptions/{subscriptionId}/providers/Microsoft.Billing/invoices": { | ||
"get": { | ||
"tags": [ | ||
|
@@ -402,7 +443,7 @@ | |
"$ref": "#/definitions/EnrollmentAccountProperties" | ||
} | ||
} | ||
}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trim? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 looks like you replaced the next line indentation with a tab though 😉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any tab in notepadd ++. Can you please approve it else it won't get published as ARM api. |
||
"EnrollmentAccountListResult": { | ||
"description": "Result of listing enrollment accounts.", | ||
"properties": { | ||
|
@@ -431,6 +472,26 @@ | |
} | ||
} | ||
}, | ||
"TenantProperties": { | ||
"description": "A Tenant properties Resource", | ||
"properties": { | ||
"billingProfileName": { | ||
"description": "The Billing Profile name.", | ||
"type": "string", | ||
"readOnly": true | ||
}, | ||
"billingAccountId": { | ||
"description": "The Billing AccountId.", | ||
"type": "string", | ||
"readOnly": true | ||
}, | ||
"tenantId": { | ||
"description": "The TenantId.", | ||
"type": "string", | ||
"readOnly": true | ||
} | ||
} | ||
}, | ||
"BillingPeriod": { | ||
"description": "A billing period resource.", | ||
"type": "object", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2018-03-01-preview", | ||
"billingProfileId": "f47d2fec-3db5-4758-8717-4ff7b1641c13" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"BillingProfileName": "PayByCheck01", | ||
"BillingAccountId": "9984934b-0494-53de-0fcd-83828e47dbc6", | ||
"TenantId": "251d3d06-c6e0-487b-bd5e-5c2e4c23d51a" | ||
} | ||
} | ||
} | ||
} |
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.
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
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 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.
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 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/
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.
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.
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.
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.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 have done changes in resource type name from "discoverTenants" to "tenants" now.