Skip to content

Commit

Permalink
Guest Configuration S360 Swagger fixes (Azure#15988)
Browse files Browse the repository at this point in the history
* Add GET all methods for resource group and subscription

* Fix Linter Validation issue

* Fix Swagger Correctness S360 items

* Fix swagger validation comments

* Fix model validaiton

* Fix Lint errors

* Fix model validation for examples

Co-authored-by: Aashish Rajaram Salokhe <[email protected]>
  • Loading branch information
aashish1987 and Aashish Rajaram Salokhe authored Sep 16, 2021
1 parent 0f9a4a2 commit ca93e24
Show file tree
Hide file tree
Showing 13 changed files with 841 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"parameters": {
"subscriptionId": "mySubscriptionId",
"resourceGroupName": "myResourceGroupName",
"api-version": "2020-06-25"
},
"responses": {
"200": {
"headers": {},
"body": [
{
"location": "centraluseuap",
"id": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/AuditSecureProtocol2",
"name": "AuditSecureProtocol2",
"properties": {
"complianceStatus": "Compliant",
"assignmentHash": "content hash",
"latestReportId": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/AuditSecureProtocol2/reports/7367cbb8-ae99-47d0-a33b-a283564d2cb1",
"lastComplianceStatusChecked": "2018-08-29T22:14:13Z",
"context": null,
"guestConfiguration": {
"kind": null,
"name": "AuditSecureProtocol2",
"version": "1.0.0.3",
"contentUri": "https://mystorageaccount.blob.core.windows.net/builtinconfig/AuditSecureProtocol2/AuditSecureProtocol2_1.0.0.3.zip",
"contentHash": "content hash",
"configurationParameter": [],
"configurationSetting": null
},
"provisioningState": null
}
},
{
"location": "centraluseuap",
"id": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/myAssignment",
"name": "myAssignment",
"properties": {
"complianceStatus": "Compliant",
"assignmentHash": "content hash",
"latestReportId": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/myAssignment/reports/7367cbb8-ae99-47d0-a33b-a283564d2cb1",
"lastComplianceStatusChecked": "2018-08-29T22:14:13Z",
"context": null,
"guestConfiguration": {
"kind": null,
"name": "myAssignment",
"version": "1.0.0.3",
"contentUri": "https://mystorageaccount.blob.core.windows.net/builtinconfig/myAssignment/myAssignment.0.0.3.zip",
"contentHash": "content hash",
"configurationParameter": [],
"configurationSetting": null
},
"provisioningState": null
}
}
]
},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"parameters": {
"subscriptionId": "mySubscriptionId",
"api-version": "2020-06-25"
},
"responses": {
"200": {
"headers": {},
"body": [
{
"location": "centraluseuap",
"id": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/AuditSecureProtocol2",
"name": "AuditSecureProtocol2",
"properties": {
"complianceStatus": "Compliant",
"assignmentHash": "content hash",
"latestReportId": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/AuditSecureProtocol2/reports/7367cbb8-ae99-47d0-a33b-a283564d2cb1",
"lastComplianceStatusChecked": "2018-08-29T22:14:13Z",
"context": null,
"guestConfiguration": {
"kind": null,
"name": "AuditSecureProtocol2",
"version": "1.0.0.3",
"contentUri": "https://mystorageaccount.blob.core.windows.net/builtinconfig/AuditSecureProtocol2/AuditSecureProtocol2_1.0.0.3.zip",
"contentHash": "content hash",
"configurationParameter": [],
"configurationSetting": null
},
"provisioningState": null
}
},
{
"location": "centraluseuap",
"id": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/myAssignment",
"name": "myAssignment",
"properties": {
"complianceStatus": "Compliant",
"assignmentHash": "content hash",
"latestReportId": "/subscriptions/subscriptionId/resourceGroups/myResourceGroupName/providers/Microsoft.Compute/virtualMachines/myvm/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/myAssignment/reports/7367cbb8-ae99-47d0-a33b-a283564d2cb1",
"lastComplianceStatusChecked": "2018-08-29T22:14:13Z",
"context": null,
"guestConfiguration": {
"kind": null,
"name": "myAssignment",
"version": "1.0.0.3",
"contentUri": "https://mystorageaccount.blob.core.windows.net/builtinconfig/myAssignment/myAssignment.0.0.3.zip",
"contentHash": "content hash",
"configurationParameter": [],
"configurationSetting": null
},
"provisioningState": null
}
}
]
},
"204": {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,105 @@
]
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments": {
"get": {
"tags": [
"GuestConfigurationAssignments"
],
"operationId": "GuestConfigurationAssignments_SubscriptionList",
"description": "List all guest configuration assignments for a subscription.",
"x-ms-examples": {
"List all guest configuration assignments for a subscription": {
"$ref": "./examples/listSubGuestConfigurationAssignments.json"
}
},
"parameters": [
{
"$ref": "../../common/v1/definitions.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/GuestConfigurationAssignmentList"
}
},
"204": {
"description": "No Content"
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../common/v1/definitions.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": null
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
]
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments": {
"get": {
"tags": [
"GuestConfigurationAssignments"
],
"operationId": "GuestConfigurationAssignments_RGList",
"description": "List all guest configuration assignments for a resource group.",
"x-ms-examples": {
"List all guest configuration assignments for a resource group": {
"$ref": "./examples/listRGGuestConfigurationAssignments.json"
}
},
"parameters": [
{
"$ref": "../../common/v1/definitions.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../common/v1/definitions.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../common/v1/definitions.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/GuestConfigurationAssignmentList"
}
},
"204": {
"description": "No Content"
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../common/v1/definitions.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": null
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
]
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments": {
"get": {
"tags": [
Expand Down Expand Up @@ -806,6 +905,12 @@
"type": "string",
"description": "Uri of the storage where guest configuration package is uploaded."
},
"contentType": {
"type": "string",
"readOnly": true,
"description": "Specifies the content type of the configuration. Possible values could be Builtin or Custom.",
"x-nullable": true
},
"contentHash": {
"type": "string",
"description": "Combined hash of the guest configuration package and configuration parameters."
Expand All @@ -831,6 +936,13 @@
},
"description": "The configuration parameters for the guest configuration."
},
"configurationProtectedParameter": {
"type": "array",
"items": {
"$ref": "#/definitions/ConfigurationParameter"
},
"description": "The protected configuration parameters for the guest configuration."
},
"configurationSetting": {
"$ref": "#/definitions/ConfigurationSetting",
"description": "The configuration setting for the guest configuration."
Expand Down Expand Up @@ -938,6 +1050,20 @@
"description": "Id of the latest report for the guest configuration assignment. ",
"x-nullable": true
},
"vmssVMList": {
"type": "array",
"x-nullable": true,
"items": {
"$ref": "#/definitions/VMSSVMInfo"
},
"description": "The list of VM Compliance data for VMSS"
},
"parameterHash": {
"type": "string",
"readOnly": true,
"description": "parameter hash for the guest configuration assignment. ",
"x-nullable": true
},
"context": {
"type": "string",
"description": "The source which initiated the guest configuration assignment. Ex: Azure Policy"
Expand Down Expand Up @@ -1043,6 +1169,11 @@
"$ref": "#/definitions/AssignmentReportDetails",
"description": "Details of the assignment report.",
"x-nullable": true
},
"vmssResourceId": {
"type": "string",
"readOnly": true,
"description": "Azure resource Id of the VMSS."
}
},
"description": "Report for the guest configuration assignment. Report contains information such as compliance status, reason, and more."
Expand Down Expand Up @@ -1192,6 +1323,48 @@
}
},
"description": "Reason and code for the compliance of the guest configuration assignment resource."
},
"VMSSVMInfo": {
"properties": {
"vmId": {
"type": "string",
"readOnly": true,
"description": "UUID of the VM."
},
"vmResourceId": {
"type": "string",
"readOnly": true,
"description": "Azure resource Id of the VM."
},
"complianceStatus": {
"type": "string",
"readOnly": true,
"description": "A value indicating compliance status of the machine for the assigned guest configuration.",
"x-ms-enum": {
"name": "complianceStatus",
"modelAsString": true
},
"enum": [
"Compliant",
"NonCompliant",
"Pending"
]
},
"latestReportId": {
"type": "string",
"readOnly": true,
"description": "Id of the latest report for the guest configuration assignment. ",
"x-nullable": true
},
"lastComplianceChecked": {
"type": "string",
"format": "date-time",
"readOnly": true,
"description": "Date and time when last compliance status was checked.",
"x-nullable": true
}
},
"description": "Information about VMSS VM"
}
},
"parameters": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@
"latestReportId": null,
"lastComplianceStatusChecked": null,
"context": "Azure policy",
"resourceType": null,
"vmssVMList": null,
"guestConfiguration": {
"kind": null,
"name": "WhitelistedApplication",
"version": "1.0.0.3",
"contentUri": null,
"contentHash": null,
"contentType": null,
"configurationParameter": [
{
"name": "[InstalledApplication]bwhitelistedapp;Name",
Expand All @@ -68,12 +71,15 @@
"latestReportId": null,
"lastComplianceStatusChecked": null,
"context": "Azure policy",
"resourceType": null,
"vmssVMList": null,
"guestConfiguration": {
"kind": null,
"name": "WhitelistedApplication",
"version": "1.0.0.3",
"contentUri": null,
"contentHash": null,
"contentType": null,
"configurationParameter": [
{
"name": "[InstalledApplication]bwhitelistedapp;Name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@
"latestReportId": "a2a64e5d-a1a9-4344-a866-fb9e1541f723",
"lastComplianceStatusChecked": null,
"context": "Azure policy",
"resourceType": null,
"vmssVMList": null,
"guestConfiguration": {
"kind": null,
"name": "WhitelistedApplication",
"version": "1.0.0.3",
"contentUri": null,
"contentHash": null,
"contentType": null,
"configurationParameter": [
{
"name": "[InstalledApplication]bwhitelistedapp;Name",
Expand All @@ -68,12 +71,15 @@
"latestReportId": "a2a64e5d-a1a9-4344-a866-fb9e1541f723",
"lastComplianceStatusChecked": null,
"context": "Azure policy",
"resourceType": null,
"vmssVMList": null,
"guestConfiguration": {
"kind": null,
"name": "WhitelistedApplication",
"version": "1.0.0.3",
"contentUri": null,
"contentHash": null,
"contentType": null,
"configurationParameter": [
{
"name": "[InstalledApplication]bwhitelistedapp;Name",
Expand Down
Loading

0 comments on commit ca93e24

Please sign in to comment.