Skip to content

Commit

Permalink
Swagger specs for all existing versions of Microsoft.PolicyInsights (#…
Browse files Browse the repository at this point in the history
…2523)

* Swagger specs for all existing versions of Microsoft.PolicyInsights

* Add support for --validate; make where clauses explicit in existing (approval request pending) suppressions; add new suppression for equivalent paths error (approval request pending)

* Fix $top in examples; fix casing in examples

* Fix two more instances of $top type in examples

* Fix metadata examples by adding content type header and changing the body to a single string

* Remove EQUIVALENT_PATH suppressions; add extendedProperties as additionalProperties; add @odata.count to operations; remove "type" from "rows" in first 2017-08-09-preview and add descriptions

* Fix remaining examples with bad casings

* Fix additionalParameters definition; fix duplicate paths

* Remove redundant operations path/definitions from one of the swagger files for each version (one per namespace is sufficient as long as both files are fed into autorest as a bundle)
  • Loading branch information
bulentelmaci authored and sarangan12 committed Feb 27, 2018
1 parent cd49c02 commit 163751f
Show file tree
Hide file tree
Showing 102 changed files with 13,641 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parameters": {
"policyEventsResource": "default",
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"api-version": "2017-08-09-preview",
"$from": "2018-02-05T18:00:00Z",
"$filter": "PolicyDefinitionAction eq 'deny'",
"$apply": "aggregate($count as NumDenyEvents)"
},
"responses": {
"200": {
"body": {
"value": [
{
"metadata": {
"generatedQuery": ""
},
"columns": {
"NumDenyEvents": {
"ordinal": 1,
"name": "NumDenyEvents",
"dataType": "Numeric"
}
},
"rows": [
[
40
]
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"parameters": {
"policyEventsResource": "default",
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"api-version": "2017-08-09-preview",
"$from": "2018-02-05T18:00:00Z",
"$filter": "PolicyDefinitionAction eq 'audit' or PolicyDefinitionAction eq 'deny'",
"$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId), aggregate($count as NumEvents))",
"$top": 2
},
"responses": {
"200": {
"body": {
"value": [
{
"metadata": {
"generatedQuery": ""
},
"columns": {
"PolicyAssignmentId": {
"ordinal": 1,
"name": "PolicyAssignmentId",
"dataType": "String"
},
"PolicyDefinitionId": {
"ordinal": 2,
"name": "PolicyDefinitionId",
"dataType": "String"
},
"PolicyDefinitionAction": {
"ordinal": 3,
"name": "PolicyDefinitionAction",
"dataType": "String"
},
"ResourceId": {
"ordinal": 4,
"name": "ResourceId",
"dataType": "String"
},
"NumEvents": {
"ordinal": 5,
"name": "NumEvents",
"dataType": "Numeric"
}
},
"rows": [
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/3f3c4330183b4e218fe6fd29",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/24813039-7534-408a-9842-eb99f45721b1",
"audit",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
1
],
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policyassignments/d6be6bb37e5f4333baa95c2a",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/5948d091-78b7-4d3b-a404-cc6a0329b0c6",
"audit",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.servicefabric/clusters/myCluster/applications/resourcescachemonitor/services/myService",
1
]
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"parameters": {
"policyEventsResource": "default",
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"api-version": "2017-08-09-preview",
"$from": "2018-01-05T18:00:00Z",
"$filter": "PolicyDefinitionAction ne 'audit' and PolicyDefinitionAction ne 'append'",
"$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, PolicyDefinitionAction, ResourceId))",
"$top": 2
},
"responses": {
"200": {
"body": {
"value": [
{
"metadata": {
"generatedQuery": ""
},
"columns": {
"PolicyAssignmentId": {
"ordinal": 1,
"name": "PolicyAssignmentId",
"dataType": "String"
},
"PolicyDefinitionId": {
"ordinal": 2,
"name": "PolicyDefinitionId",
"dataType": "String"
},
"PolicyDefinitionAction": {
"ordinal": 3,
"name": "PolicyDefinitionAction",
"dataType": "String"
},
"ResourceId": {
"ordinal": 4,
"name": "ResourceId",
"dataType": "String"
}
},
"rows": [
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.authorization/policyassignments/storageaccountsku",
"/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
"deny",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/mysa1"
],
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
"/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
"deny",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.storage/storageaccounts/mysa2"
]
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"parameters": {
"policyEventsResource": "default",
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"api-version": "2017-08-09-preview",
"$from": "2018-01-01T00:00:00Z",
"$filter": "PolicyDefinitionAction eq 'deny'",
"$apply": "groupby((PolicyAssignmentId, PolicyDefinitionId, ResourceId))/groupby((PolicyAssignmentId, PolicyDefinitionId), aggregate($count as NumDeniedResources))",
"$orderby": "NumDeniedResources desc",
"$top": 10
},
"responses": {
"200": {
"body": {
"value": [
{
"metadata": {
"generatedQuery": ""
},
"columns": {
"PolicyAssignmentId": {
"ordinal": 1,
"name": "PolicyAssignmentId",
"dataType": "String"
},
"PolicyDefinitionId": {
"ordinal": 2,
"name": "PolicyDefinitionId",
"dataType": "String"
},
"NumDeniedResources": {
"ordinal": 3,
"name": "NumDeniedResources",
"dataType": "Numeric"
}
},
"rows": [
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/0591f497c35344fcbaf7a393",
"/providers/microsoft.authorization/policydefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c",
3
],
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/mypolicyassignment2",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mypolicydefinition2",
2
],
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup1/providers/microsoft.authorization/policyassignments/mypolicyassignment2",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mypolicydefinition3",
2
],
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/5bc427ca-0089-4d0d-85bd-e98d1e40b3bf/providers/microsoft.authorization/policyassignments/mypolicyassignment3",
"/providers/microsoft.authorization/policydefinitions/7433c107-6db4-4ad1-b57a-a76dce0154a1",
1
],
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/da43b50031bf4bce84584faa",
"/providers/microsoft.authorization/policydefinitions/1e30110a-5ceb-460c-a204-c1c3969c6d62",
1
],
[
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourcegroups/myResourceGroup2/providers/microsoft.authorization/policyassignments/mypolicyassignment1",
"/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/providers/microsoft.authorization/policydefinitions/mypolicydefinition1",
1
]
]
}
]
}
}
}
}
Loading

0 comments on commit 163751f

Please sign in to comment.