Skip to content

Commit

Permalink
Blueprints API update for excludedPrincipals and whoIsBlueprint (#5470)
Browse files Browse the repository at this point in the history
* Make swagger changes to support whoIsBlueprint and excludedPrincipals scenarios

* Update typo and descriptions

* Incorporate feedback

* fix autorest warning

* Update parameters block for the URL params

* Fix names of referenced json files

* Update package name

* update readme files

* Update description

* Update specification/blueprint/resource-manager/readme.typescript.md

Co-Authored-By: filizt <filizkurban@gmail.com>

* Update specification/blueprint/resource-manager/readme.typescript.md

Co-Authored-By: filizt <filizkurban@gmail.com>

* Update description with for each enum value

* Fix description one more time

* Update more descriptions

* Update descriptions to match with ScopeParameter type
  • Loading branch information
filizt authored and jhendrixMSFT committed Mar 28, 2019
1 parent 7d66941 commit a8b96bf
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
"in": "path",
"required": true,
"type": "string",
"description": "The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}').",
"description": "The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'). For blueprint assignments management group scope is reserved for future use.",
"x-ms-parameter-location": "method",
"x-ms-skip-url-encoding": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,36 @@
}
}
},
"/{scope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}/WhoIsBlueprint": {
"post": {
"operationId": "Assignments_WhoIsBlueprint",
"description": "Get Blueprints service SPN objectId",
"x-ms-examples": {
"WhoIsBlueprint_Action": {
"$ref": "./examples/WhoIsBlueprint_Action.json"
}
},
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/ScopeParameter"
},
{
"$ref": "#/parameters/AssignmentNameParameter"
}
],
"responses": {
"200": {
"description": "Blueprints service SPN objectId",
"schema":{
"$ref": "#/definitions/WhoIsBlueprintContract"
}
}
}
}
},
"/{scope}/providers/Microsoft.Blueprint/blueprintAssignments": {
"get": {
"tags": [
Expand Down Expand Up @@ -293,6 +323,13 @@
"name": "AssignmentLockMode",
"modelAsString": true
}
},
"excludedPrincipals": {
"type": "array",
"description": "List of AAD principals excluded from blueprint locks. Up to 5 principals are permitted.",
"items": {
"type": "string"
}
}
}
},
Expand Down Expand Up @@ -525,6 +562,15 @@
"description": "Last modified time of this blueprint definition."
}
}
},
"WhoIsBlueprintContract":{
"description": "Response schema for querying the Azure Blueprints service principal in the tenant.",
"properties": {
"objectId": {
"type": "string",
"description": "AAD object Id of the Azure Blueprints service principal in the tenant."
}
}
}
},
"parameters": {
Expand All @@ -533,7 +579,7 @@
"in": "path",
"required": true,
"type": "string",
"description": "The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}').",
"description": "The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'). For blueprint assignments management group scope is reserved for future use.",
"x-ms-parameter-location": "method",
"x-ms-skip-url-encoding": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,22 +550,22 @@
"description": "Get an artifact for a published blueprint definition.",
"x-ms-examples": {
"Sub-ARMTemplateArtifact": {
"$ref": "./examples/subscriptionBPDef/ARMTemplateArtifact_Get.json"
"$ref": "./examples/subscriptionBPDef/SealedARMTemplateArtifact_Get.json"
},
"Sub-PolicyAssignmentArtifact": {
"$ref": "./examples/subscriptionBPDef/PolicyAssignmentArtifact_Get.json"
"$ref": "./examples/subscriptionBPDef/SealedPolicyAssignmentArtifact_Get.json"
},
"Sub-RoleAssignmentArtifact": {
"$ref": "./examples/subscriptionBPDef/RoleAssignmentArtifact_Get.json"
"$ref": "./examples/subscriptionBPDef/SealedRoleAssignmentArtifact_Get.json"
},
"MG-ARMTemplateArtifact": {
"$ref": "./examples/managementGroupBPDef/ARMTemplateArtifact_Get.json"
"$ref": "./examples/managementGroupBPDef/SealedARMTemplateArtifact_Get.json"
},
"MG-PolicyAssignmentArtifact": {
"$ref": "./examples/managementGroupBPDef/PolicyAssignmentArtifact_Get.json"
"$ref": "./examples/managementGroupBPDef/SealedPolicyAssignmentArtifact_Get.json"
},
"MG-RoleAssignmentArtifact": {
"$ref": "./examples/managementGroupBPDef/RoleAssignmentArtifact_Get.json"
"$ref": "./examples/managementGroupBPDef/SealedRoleAssignmentArtifact_Get.json"
}
},
"parameters": [
Expand Down Expand Up @@ -824,7 +824,17 @@
],
"x-ms-enum": {
"name": "BlueprintTargetScope",
"modelAsString": true
"modelAsString": false,
"values": [
{
"value": "subscription",
"description": "The blueprint targets a subscription during blueprint assignment."
},
{
"value": "managementGroup",
"description": "The blueprint targets a management group during blueprint assignment. This is reserved for future use."
}
]
}
},
"parameters": {
Expand Down Expand Up @@ -1342,7 +1352,7 @@
"in": "path",
"required": true,
"type": "string",
"description": "The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}').",
"description": "The scope of the resource. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'). For blueprint assignments management group scope is reserved for future use.",
"x-ms-parameter-location": "method",
"x-ms-skip-url-encoding": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"scope": "subscriptions/{subscriptionId}",
"assignmentName": "assignSimpleBlueprint"
},
"responses": {
"200": {
"body": {
"objectId" : "00000000-0000-0000-0000-000000000000"
}
}
}
}
29 changes: 2 additions & 27 deletions specification/blueprint/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ This is not used by Autorest itself.
``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-go
- repo: azure-sdk-for-node
- repo: azure-sdk-for-js
- repo: azure-sdk-for-python
```

Expand All @@ -82,32 +82,7 @@ csharp:

## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python)
python-mode: create
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.blueprint
package-name: azure-mgmt-blueprint
title: BlueprintManagementClient
description: The Blueprint Client.
clear-output-folder: true
```
``` yaml $(python) && $(python-mode) == 'update'
python:
no-namespace-folders: true
output-folder: $(python-sdks-folder)/azure-mgmt-blueprint/azure/mgmt/blueprint
```
``` yaml $(python) && $(python-mode) == 'create'
python:
basic-setup-py: true
output-folder: $(python-sdks-folder)/azure-mgmt-blueprint
```
See configuration in [readme.python.md](./readme.python.md)

## Go

Expand Down
28 changes: 28 additions & 0 deletions specification/blueprint/resource-manager/readme.python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python)
python-mode: create
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.blueprint
package-name: azure-mgmt-blueprint
title: BlueprintManagementClient
description: The Blueprint Client.
clear-output-folder: true
```
``` yaml $(python) && $(python-mode) == 'update'
python:
no-namespace-folders: true
output-folder: $(python-sdks-folder)/azure-mgmt-blueprint/azure/mgmt/blueprint
```
``` yaml $(python) && $(python-mode) == 'create'
python:
basic-setup-py: true
output-folder: $(python-sdks-folder)/azure-mgmt-blueprint
```
12 changes: 12 additions & 0 deletions specification/blueprint/resource-manager/readme.typescript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## TypeScript

These settings apply only when `--typescript` is specified on the command line.
Please also specify `--typescript-sdks-folder=<path to root folder of your azure-sdk-for-js clone>`.

``` yaml $(typescript)
typescript:
azure-arm: true
package-name: "@azure/arm-blueprint"
output-folder: "$(typescript-sdks-folder)/packages/@azure/arm-blueprint"
generate-metadata: true
```

0 comments on commit a8b96bf

Please sign in to comment.