Skip to content

Commit 79e1506

Browse files
committed
Adding operations for Delta engine
Adding API endpoints to describe: - operation to run an evaluation and provide results - operation to record a item to be skipped - operation to remove reference to skipped - operation to restore value for entire item or single property
1 parent f191c8a commit 79e1506

File tree

1 file changed

+247
-0
lines changed

1 file changed

+247
-0
lines changed

SHIELD.json

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,30 @@
109109
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
110110
"type": "string"
111111
}
112+
},
113+
"configId": {
114+
"description": "Reference of the configuration property in the template used during deploy.Reference of the configuration property in the template used during deploy.",
115+
"in": "query",
116+
"name": "configId",
117+
"required": true,
118+
"schema": {
119+
"type": "string",
120+
"format": "uuid",
121+
"maxLength": 36,
122+
"minLength": 36,
123+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
124+
"example": "42ff150d-2ff0-4b38-849e-fe6aa5eedb49"
125+
}
126+
},
127+
"path": {
128+
"description": "Location of the item in the object structure flattened for predictable navigation.",
129+
"in": "query",
130+
"name": "path",
131+
"required": true,
132+
"schema": {
133+
"type": "string",
134+
"example": "roleScopeTagIds"
135+
}
112136
}
113137
},
114138
"responses": {
@@ -770,6 +794,51 @@
770794
"example": "Privileged",
771795
"title": "Type of security class the object(s) belongs to",
772796
"type": "string"
797+
},
798+
"Shield.Deploy.Delta.Restore": {
799+
"title": "SHIELD - Deploy - Delta - Restore",
800+
"description": "Payload expected for Restore operation",
801+
"type": "object",
802+
"properties": {
803+
"configId": {
804+
"description": "Reference of the configuration property in the template used during deploy.Reference of the configuration property in the template used during deploy.",
805+
"type": "string",
806+
"format": "uuid",
807+
"maxLength": 36,
808+
"minLength": 36,
809+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
810+
"example": "8c9befc8-b25b-44b6-9778-350d7c511557"
811+
},
812+
"path": {
813+
"description": "Location of the item in the object structure flattened for predictable navigation.",
814+
"type": "string",
815+
"example": "displayName"
816+
}
817+
},
818+
"required": [ "configId", "path" ]
819+
820+
},
821+
"Shield.Deploy.Delta.Skip": {
822+
"title": "SHIELD - Deploy - Delta - Skip",
823+
"description": "Payload expected for Skip operation",
824+
"type": "object",
825+
"properties": {
826+
"configId": {
827+
"description": "Reference of the configuration property in the template used during deploy.Reference of the configuration property in the template used during deploy.",
828+
"type": "string",
829+
"format": "uuid",
830+
"maxLength": 36,
831+
"minLength": 36,
832+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$",
833+
"example": "42ff150d-2ff0-4b38-849e-fe6aa5eedb49"
834+
},
835+
"path": {
836+
"description": "Location of the item in the object structure flattened for predictable navigation.",
837+
"type": "string",
838+
"example": "roleScopeTagIds"
839+
}
840+
},
841+
"required": [ "configId", "path" ]
773842
}
774843
},
775844
"securitySchemes": {
@@ -1282,6 +1351,184 @@
12821351
"security": []
12831352
}
12841353
},
1354+
"/API/Deploy/Delta": {
1355+
"get": {
1356+
"summary": "Initiate evaluation for configuration discrepancies",
1357+
"description": "Runs the comparison between configuration templates and live data to find discrepancies to be addressed.",
1358+
"operationId": "/API/Deploy/Delta/Get",
1359+
"responses": {
1360+
"200": {
1361+
"content": {
1362+
"application/json": {
1363+
"schema": {
1364+
"properties": {
1365+
"invalid": {
1366+
"additionalProperties": {
1367+
"description": "String with details of the error response.",
1368+
"type": "string"
1369+
},
1370+
"description": "Collection of the configuration items where request for live data responded with error.",
1371+
"type": "object"
1372+
},
1373+
"missing": {
1374+
"additionalProperties": {
1375+
"description": "String indicating name and description of the configuration item.",
1376+
"type": "string"
1377+
},
1378+
"description": "Collection of the configuration items that are present in the template but do not have reference to indicate they were deployed.",
1379+
"type": "object"
1380+
},
1381+
"results": {
1382+
"additionalProperties": {
1383+
"items": {
1384+
"properties": {
1385+
"actions": {
1386+
"items": {
1387+
"type": "string"
1388+
},
1389+
"description": "List of operations available to be performed on the entity.",
1390+
"type": "array",
1391+
"minItems": 1
1392+
},
1393+
"message": {
1394+
"description": "Detailed information about the discrepancy for the entity.",
1395+
"type": "string"
1396+
},
1397+
"path": {
1398+
"description": "Location in the object where evaluated property encountered an error.",
1399+
"type": "string"
1400+
}
1401+
},
1402+
"type": "object",
1403+
"required": [ "actions", "message", "path" ]
1404+
},
1405+
"type": "array"
1406+
},
1407+
"description": "Collection of the configuration items where discrepancies where found.",
1408+
"type": "object"
1409+
}
1410+
},
1411+
"type": "object",
1412+
"required": [ "invalid", "missing", "results"],
1413+
"example": {
1414+
"invalid": {
1415+
"a14402b8-98c5-41e3-ba99-e5e1a536f68d": "Setting ID '58246273-d366-40d5-ac3d-daacb8bc2655' - Item not found.",
1416+
"9af9209d-d191-4b42-9f65-dfd8b7882bba": "Setting ID 'f6f5d07b-230c-4818-93de-e407b8ca9537' - Insufficient access to view this data."
1417+
},
1418+
"missing": {
1419+
"78afd77c-c2a6-4328-9c61-b9fd44114823": "Microsoft.Policies.PowerToysMicrosoft.Policies.PowerToys - Version 0.86.0"
1420+
},
1421+
"results": {
1422+
"c47c20bd-46fa-4dfe-b971-3e5b1ce34a86": [
1423+
{
1424+
"actions": [ "ignore", "restore" ],
1425+
"message": "Value mismatch for property 'displayName' with current value being 'Audit Platform and Configuration Updates2'",
1426+
"path": "displayName"
1427+
},
1428+
{
1429+
"actions": [ "ignore" ],
1430+
"message": "Expected object at level 'groupPolicyUploadedLanguageFiles', but encountered 'Array'",
1431+
"path": "groupPolicyUploadedLanguageFiles"
1432+
}
1433+
],
1434+
"4b26b6f6-9cb3-4384-bd1e-6d298455c2c4": [
1435+
{
1436+
"actions": [ "restore" ],
1437+
"message": "Array value at level 'roleScopeTagIds/1' is not found in the returned value",
1438+
"path": "roleScopeTagIds/1"
1439+
}
1440+
]
1441+
}
1442+
}
1443+
}
1444+
}
1445+
},
1446+
"description": "OK"
1447+
}
1448+
},
1449+
"tags": [
1450+
"Delta"
1451+
]
1452+
}
1453+
},
1454+
"/API/Deploy/Delta/Restore": {
1455+
"patch": {
1456+
"summary": "Restores the intended structure",
1457+
"description": "Applies a change to restore configuration item or its property to the value from the template.",
1458+
"operationId": "/API/Deploy/Delta/Restore/Patch",
1459+
"requestBody": {
1460+
"content": {
1461+
"application/json": {
1462+
"schema": {
1463+
"$ref": "#/components/schemas/Shield.Deploy.Delta.Restore"
1464+
}
1465+
}
1466+
}
1467+
},
1468+
"responses": {
1469+
"204":{
1470+
"description": "Restoration of configuration item or its property is successful"
1471+
},
1472+
"400": {
1473+
"description": "The body does not match expected format!"
1474+
}
1475+
},
1476+
"tags": [
1477+
"Delta"
1478+
]
1479+
}
1480+
},
1481+
"/API/Deploy/Delta/Skip": {
1482+
"post": {
1483+
"summary": "Records intention to bypass evaluation",
1484+
"description": "Stores the reference to the entity to be skipped during the evaluation process. Could be entire configuration item or a specific property.",
1485+
"operationId": "/API/Deploy/Delta/Skip/Post",
1486+
"requestBody": {
1487+
"content": {
1488+
"application/json": {
1489+
"schema": {
1490+
"$ref": "#/components/schemas/Shield.Deploy.Delta.Skip"
1491+
}
1492+
}
1493+
}
1494+
},
1495+
"responses": {
1496+
"204":{
1497+
"description": "Recorded successfully"
1498+
},
1499+
"400": {
1500+
"description": "The body does not match expected format!"
1501+
}
1502+
},
1503+
"tags": [
1504+
"Delta"
1505+
]
1506+
},
1507+
"delete": {
1508+
"summary": "Removes entry that allowed to bypass evaluation",
1509+
"description": "Deletes the reference to the entity so that evaluation process does not skip over it.",
1510+
"operationId": "/API/Deploy/Delta/Skip/Delete",
1511+
"parameters": [
1512+
{
1513+
"$ref": "#/components/parameters/configId"
1514+
},
1515+
{
1516+
"$ref": "#/components/parameters/path"
1517+
}
1518+
],
1519+
"responses": {
1520+
"204":{
1521+
"description": "Record has been removed successfully"
1522+
},
1523+
"400": {
1524+
"description": "Required fields are not found among query parameters!"
1525+
}
1526+
},
1527+
"tags": [
1528+
"Delta"
1529+
]
1530+
}
1531+
},
12851532
"/API/Deploy/Version": {
12861533
"get": {
12871534
"description": "Gets the version of the API server and the architecture version deployed as well as the supported version of the architecture spec from the server.",

0 commit comments

Comments
 (0)