Skip to content

Commit

Permalink
single example with post nextLinl
Browse files Browse the repository at this point in the history
  • Loading branch information
Namrata Jagasia committed Apr 15, 2021
1 parent f80541d commit a937ffd
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"parameters": {
"policyStatesResource": "latest",
"managementGroupsNamespace": "Microsoft.Management",
"managementGroupName": "myManagementGroup",
"api-version": "2019-10-01",
"$skiptoken": "WpmWfBSvPhkAK6QD"
},
"responses": {
"200": {
"body": {
"@odata.nextLink": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2019-10-01&%24skiptoken=zZLPbtwgEIffhfOy",
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest",
"@odata.count": 2,
"value": [
{
"@odata.id": null,
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
"timestamp": "2019-10-09T17:41:47Z",
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
"policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/1ef5d536aec743a0aa801c1a",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
"effectiveParameters": null,
"isCompliant": false,
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"resourceType": "/microsoft.insights/autoscalesettings",
"resourceLocation": "westus",
"resourceGroup": "myrg1",
"resourceTags": "tbd",
"policyAssignmentName": "1ef5d536aec743a0aa801c1a",
"policyAssignmentOwner": "tbd",
"policyAssignmentParameters": "{}",
"policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
"policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
"policyDefinitionAction": "audit",
"policyDefinitionCategory": "tbd",
"policySetDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policySetDefinitions/335cefd2-ab16-430f-b364-974a170eb1d5",
"policySetDefinitionName": "335cefd2-ab16-430f-b364-974a170eb1d5",
"policySetDefinitionOwner": null,
"policySetDefinitionCategory": null,
"policySetDefinitionParameters": null,
"managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
"policyDefinitionReferenceId": "15521232277412542086",
"complianceState": "NonCompliant",
"policyDefinitionGroupNames": [
"myGroup"
]
},
{
"@odata.id": null,
"@odata.context": "https://management.azure.com/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.PolicyInsights/policyStates/$metadata#latest/$entity",
"timestamp": "2019-10-09T17:41:47Z",
"resourceId": "/subscriptions/fffedd8f-ffff-fffd-fffd-fffed2f84852/resourceGroups/myrg1/providers/microsoft.insights/autoscalesettings/mytest1",
"policyAssignmentId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyAssignments/186044306c044a1d8c0ff76c",
"policyDefinitionId": "/providers/Microsoft.Management/managementGroups/myManagementGroup/providers/Microsoft.Authorization/policyDefinitions/022d9357-5a90-46f7-9554-21d30ce4c32d",
"effectiveParameters": null,
"isCompliant": true,
"subscriptionId": "fffedd8f-ffff-fffd-fffd-fffed2f84852",
"resourceType": "/microsoft.insights/autoscalesettings",
"resourceLocation": "westus",
"resourceGroup": "myrg1",
"resourceTags": "tbd",
"policyAssignmentName": "186044306c044a1d8c0ff76c",
"policyAssignmentOwner": "tbd",
"policyAssignmentParameters": "{\"allowedLocations\":{\"value\":[\"centralus\"]}}",
"policyAssignmentScope": "/providers/Microsoft.Management/managementGroups/myManagementGroup",
"policyDefinitionName": "022d9357-5a90-46f7-9554-21d30ce4c32d",
"policyDefinitionAction": "audit",
"policyDefinitionCategory": "tbd",
"policySetDefinitionId": "",
"policySetDefinitionName": "",
"policySetDefinitionOwner": null,
"policySetDefinitionCategory": null,
"policySetDefinitionParameters": null,
"managementGroupIds": "myManagementGroup,fff988bf-fff1-ffff-fffb-fffcd011db47",
"policyDefinitionReferenceId": "",
"complianceState": "Compliant",
"policyDefinitionGroupNames": [
"myGroup"
]
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
}
},
"x-ms-pageable": {
"nextLinkName": "@odata.nextLink"
"nextLinkName": "@odata.nextLink",
"operationName": "PolicyStates_NextLink"
},
"x-ms-examples": {
"Query latest at management group scope": {
Expand Down Expand Up @@ -1153,6 +1154,41 @@
}
}
}
},
"/{nextLink}": {
"post": {
"operationId": "PolicyStates_NextLink",
"description": "Subsequent post calls to the next link",
"parameters": [
{
"name": "$skiptoken",
"in": "query",
"required": true,
"type": "string",
"description": "Next link for list operation.",
"x-ms-skip-url-encoding": true
}
],

This comment has been minimized.

Copy link
@iscai-msft

iscai-msft Apr 16, 2021

Contributor

You also need to make nextLink a path parameter here. Here's an example.

Side note: I think your docstring for $skiptoken is off since it's referring to a next link

"responses": {
"200": {
"description": "Query results.",
"schema": {
"$ref": "#/definitions/PolicyStatesQueryResults"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/QueryFailure"
}
}
},
"x-ms-examples": {
"Query latest at resource group level policy assignment scope with next link": {
"$ref": "./examples/PolicyStates_QueryManagementGroupScopeNextLinkSkipToken.json"
}
}
}
}
},
"definitions": {
Expand Down

0 comments on commit a937ffd

Please sign in to comment.