-
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
Adding AddBillingRoleAssignment API in 2020-05-01 version #11023
Changes from all commits
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 |
---|---|---|
|
@@ -3460,6 +3460,150 @@ | |
} | ||
} | ||
}, | ||
"/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment": { | ||
"post": { | ||
"tags": [ | ||
"BillingRoleAssignments" | ||
], | ||
"operationId": "BillingRoleAssignments_AddByBillingAccount", | ||
"description": "Adds a role assignment on a billing account. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.", | ||
"x-ms-examples": { | ||
"AddRoleAssignmentToBillingAccount": { | ||
"$ref": "./examples/AddRoleAssignmentToBillingAccount.json" | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/apiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/billingAccountNameParameter" | ||
}, | ||
{ | ||
"name": "parameters", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/BillingRoleAssignmentRequestProperties" | ||
}, | ||
"description": "Request parameters that are provided to the create billing role assignment operation." | ||
} | ||
], | ||
"responses": { | ||
"201": { | ||
"description": "Role assignment is successfully created", | ||
"schema": { | ||
"$ref": "#/definitions/BillingRoleAssignment" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment": { | ||
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.
Why are we modeling this as a POST instead of a proper resource with PUT and GET and list? 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. The swagger already has the GET and List apis. We are currently adding an action to add the role assignments. 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. That is the reason we did not publish this api along with other APIs. Our older version of API also has POST. 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. Makes sense. |
||
"post": { | ||
"tags": [ | ||
"BillingRoleAssignments" | ||
], | ||
"operationId": "BillingRoleAssignments_AddByInvoiceSection", | ||
"description": "Adds a role assignment on an invoice section. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.", | ||
"x-ms-examples": { | ||
"AddRoleAssignmentToInvoiceSection": { | ||
"$ref": "./examples/AddRoleAssignmentToInvoiceSection.json" | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/apiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/billingAccountNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/billingProfileNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/invoiceSectionNameParameter" | ||
}, | ||
{ | ||
"name": "parameters", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/BillingRoleAssignmentRequestProperties" | ||
}, | ||
"description": "Request parameters that are provided to the create billing role assignment operation." | ||
} | ||
], | ||
"responses": { | ||
"201": { | ||
"description": "Role assignment is successfully created", | ||
"schema": { | ||
"$ref": "#/definitions/BillingRoleAssignment" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/createBillingRoleAssignment": { | ||
"post": { | ||
"tags": [ | ||
"BillingRoleAssignments" | ||
], | ||
"operationId": "BillingRoleAssignments_AddByBillingProfile", | ||
"description": "Adds a role assignment on a billing profile. The operation is supported for billing accounts with agreement type Microsoft Customer Agreement.", | ||
"x-ms-examples": { | ||
"AddRoleAssignmentToBillingProfile": { | ||
"$ref": "./examples/AddRoleAssignmentToBillingProfile.json" | ||
} | ||
}, | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/apiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/billingAccountNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/billingProfileNameParameter" | ||
}, | ||
{ | ||
"name": "parameters", | ||
"in": "body", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/definitions/BillingRoleAssignmentRequestProperties" | ||
}, | ||
"description": "Request parameters that are provided to the create billing role assignment operation." | ||
} | ||
], | ||
"responses": { | ||
"201": { | ||
"description": "Role assignment is successfully created", | ||
"schema": { | ||
"$ref": "#/definitions/BillingRoleAssignment" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements": { | ||
"get": { | ||
"tags": [ | ||
|
@@ -6026,6 +6170,19 @@ | |
} | ||
} | ||
}, | ||
"BillingRoleAssignmentRequestProperties": { | ||
"description": "The request parameters to add the role assignment on a scope", | ||
"properties": { | ||
"principalId": { | ||
"description": "The user's principal id that the role gets assigned to", | ||
"type": "string" | ||
}, | ||
"roleDefinitionId": { | ||
"description": "The role definition id", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"BillingRoleDefinitionListResult": { | ||
"description": "The list of role definitions.", | ||
"properties": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2020-05-01", | ||
"billingAccountName": "{billingAccountName}", | ||
"parameters": { | ||
"principalId": "00000000-0000-0000-0000-000000000000", | ||
"roleDefinitionId": "{roleDefinitionId}" | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"body": { | ||
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", | ||
"name": "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", | ||
"properties": { | ||
"createdOn": "2018-06-21T21:34:12.2363515+00:00", | ||
"createdByPrincipalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f", | ||
"createdByPrincipalId": "10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1", | ||
"principalId": "00000000-0000-0000-0000-000000000000", | ||
"scope": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}", | ||
"principalTenantId": "10000000-aaaa-bbbb-cccc-2d7cd011db47", | ||
"roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002" | ||
}, | ||
"type": "Microsoft.Billing/billingAccounts/billingRoleAssignments" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2020-05-01", | ||
"billingAccountName": "{billingAccountName}", | ||
"billingProfileName": "{billingProfileName}", | ||
"parameters": { | ||
"principalId": "00000000-0000-0000-0000-000000000000", | ||
"roleDefinitionId": "{roleDefinitionId}" | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"body": { | ||
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47", | ||
"name": "10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47", | ||
"properties": { | ||
"createdOn": "2018-06-21T21:58:19.9073876+00:00", | ||
"scope": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", | ||
"createdByPrincipalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f", | ||
"createdByPrincipalId": "10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1", | ||
"principalId": "00000000-0000-0000-0000-000000000000", | ||
"principalTenantId": "10000000-aaaa-bbbb-cccc-2d7cd011db47", | ||
"roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002" | ||
}, | ||
"type": "Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2020-05-01", | ||
"billingAccountName": "{billingAccountName}", | ||
"billingProfileName": "{billingProfileName}", | ||
"invoiceSectionName": "{invoiceSectionName}", | ||
"parameters": { | ||
"principalId": "00000000-0000-0000-0000-000000000000", | ||
"roleDefinitionId": "{roleDefinitionId}" | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"body": { | ||
"id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", | ||
"name": "10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9", | ||
"properties": { | ||
"createdOn": "2018-06-21T21:34:12.2363515+00:00", | ||
"scope": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", | ||
"createdByPrincipalTenantId": "7ca289b9-c32d-4f01-8566-7ff93261d76f", | ||
"createdByPrincipalId": "10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1", | ||
"principalId": "00000000-0000-0000-0000-000000000000", | ||
"principalTenantId": "10000000-aaaa-bbbb-cccc-2d7cd011db47", | ||
"roleDefinitionId": "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002" | ||
}, | ||
"type": "Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments" | ||
} | ||
} | ||
} | ||
} |
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.
You are modifying an existing stable API version. As per https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#versioning, this is not allowed and requires a version bump.
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.
We have added new apis to same version earlier in past 15 days: #10585
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.
Yeah I think I will allow it given that we've created an expectation that this is ok.
In reply to: 499105356 [](ancestors = 499105356)
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! @majastrz