Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guest_configuration_assignments column in azure_compute_virtual_machine table. closes #324 #353

Merged
merged 4 commits into from
Sep 30, 2021

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Sep 29, 2021

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
select name, jsonb_pretty(guest_configuration_assignment) as guest_configuration_assignment from azure_compute_virtual_machine
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| name     | guest_configuration_assignment                                                                                                                                                                 
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| test-vm1 | {                                                                                                                                                                                              
|          | }                                                                                                                                                                                              
| test-vm  | [                                                                                                                                                                                              
|          |     {                                                                                                                                                                                          
|          |         "id": "/subscriptions/d46d7416-f95f-4771-bbb5-529d4c76659c/resourceGroups/turbot_rg/providers/Microsoft.Compute/virtualMachines/test-vm/providers/Microsoft.GuestConfiguration/guestCon
|          |         "name": "WhitelistedApplication",                                                                                                                                                      
|          |         "location": "westcentralus",                                                                                                                                                           
|          |         "assignmentHash": "123contenthash.B15688699FC8C7DFD93D7AC32E4CF97DBCED1FD30D46301C5CDA41AEE23DC68E",                                                                                   
|          |         "complianceStatus": "Pending",                                                                                                                                                         
|          |         "guestConfiguration": {                                                                                                                                                                
|          |             "name": "WhitelistedApplication",                                                                                                                                                  
|          |             "version": "1.0",                                                                                                                                                                  
|          |             "configurationSetting": {                                                                                                                                                          
|          |                 "rebootIfNeeded": true,                                                                                                                                                        
|          |                 "configurationMode": "MonitorOnly",                                                                                                                                            
|          |                 "allowModuleOverwrite": false,                                                                                                                                                 
|          |                 "refreshFrequencyMins": 5,                                                                                                                                                     
|          |                 "configurationModeFrequencyMins": 15                                                                                                                                           
|          |             },                                                                                                                                                                                 
|          |             "configurationParameter": [                                                                                                                                                        
|          |                 {                                                                                                                                                                              
|          |                     "name": "[InstalledApplication]bwhitelistedapp;Name",                                                                                                                      
|          |                     "value": "NotePad,sql"                                                                                                                                                     
|          |                 }                                                                                                                                                                              
|          |             ]                                                                                                                                                                                  
|          |         }                                                                                                                                                                                      
|          |     }                                                                                                                                                                                          
|          | ]                                                                                                                                                                                              
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

@@ -307,6 +308,13 @@ func tableAzureComputeVirtualMachine(_ context.Context) *plugin.Table {
Hydrate: getAzureComputeVirtualMachineExtensions,
Transform: transform.FromValue(),
},
{
Name: "guest_configuration_assignment",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Name: "guest_configuration_assignment",
Name: "guest_configuration_assignments",


var assignments []map[string]interface{}

// SDK does not support pagination yet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment for extract

@bigdatasourav bigdatasourav changed the title Add Guest Configuration Assignments details in table azure_compute_virtual_machine closes #324 Add guest_configuration_assignments column in azure_compute_virtual_machine table. closes #324 Sep 30, 2021
Name: "guest_configuration_assignment",
Description: "Guest configuration assignments for a virtual machine.",
Type: proto.ColumnType_JSON,
Hydrate: getComputeVirtualMachineGuestConfigurationAssignment,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Hydrate: getComputeVirtualMachineGuestConfigurationAssignment,
Hydrate: listComputeVirtualMachineGuestConfigurationAssignments,

Copy link
Contributor

@bigdatasourav bigdatasourav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bigdatasourav bigdatasourav merged commit 8ed3b98 into main Sep 30, 2021
@bigdatasourav bigdatasourav deleted the issue-324 branch September 30, 2021 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Guest Configuration Assignments details in table azure_compute_virtual_machine
2 participants