Skip to content

Commit 38338c5

Browse files
committed
fix: Add missing Properties
1 parent 1bac863 commit 38338c5

7 files changed

Lines changed: 256 additions & 17 deletions

File tree

plugins/source/azure/codegen/recipes/base.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,16 @@ func initColumns(table *codegen.TableDefinition, definition resourceDefinition)
188188

189189
func initTable(definition resourceDefinition, azureService string, azureSubService string, azureStructName string) *codegen.TableDefinition {
190190
skipFields := append(definition.skipFields, defaultSkipFields...)
191-
table, err := codegen.NewTableFromStruct(fmt.Sprintf("%s_%s_%s", pluginName, strings.ToLower(azureService), strcase.ToSnake(azureSubService)), definition.azureStruct, codegen.WithSkipFields(skipFields), codegen.WithUnwrapEmbeddedStructs())
191+
table, err := codegen.NewTableFromStruct(
192+
fmt.Sprintf("%s_%s_%s",
193+
pluginName,
194+
strings.ToLower(azureService),
195+
strcase.ToSnake(azureSubService)),
196+
definition.azureStruct,
197+
codegen.WithSkipFields(skipFields),
198+
codegen.WithUnwrapAllEmbeddedStructs(), // Unwrap all embedded structs otherwise all resources will just have `Id, Type, Name, Location, Tags` columns
199+
codegen.WithUnwrapFieldsStructs([]string{"Properties"}), // Some resources have a `Properties` field which contains the actual resource properties instead of an embedded struct
200+
)
192201
if err != nil {
193202
log.Fatal(err)
194203
}

plugins/source/azure/resources/services/authorization/role_assignments.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,19 @@ func RoleAssignments() *schema.Table {
4040
Resolver: schema.PathResolver("Type"),
4141
},
4242
{
43-
Name: "properties",
44-
Type: schema.TypeJSON,
45-
Resolver: schema.PathResolver("Properties"),
43+
Name: "scope",
44+
Type: schema.TypeString,
45+
Resolver: schema.PathResolver("Scope"),
46+
},
47+
{
48+
Name: "role_definition_id",
49+
Type: schema.TypeString,
50+
Resolver: schema.PathResolver("RoleDefinitionID"),
51+
},
52+
{
53+
Name: "principal_id",
54+
Type: schema.TypeString,
55+
Resolver: schema.PathResolver("PrincipalID"),
4656
},
4757
},
4858
}

plugins/source/azure/resources/services/iothub/devices.go

Lines changed: 117 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,124 @@ func Devices() *schema.Table {
2727
Resolver: schema.PathResolver("Etag"),
2828
},
2929
{
30-
Name: "properties",
30+
Name: "authorization_policies",
3131
Type: schema.TypeJSON,
32-
Resolver: schema.PathResolver("Properties"),
32+
Resolver: schema.PathResolver("AuthorizationPolicies"),
33+
},
34+
{
35+
Name: "disable_local_auth",
36+
Type: schema.TypeBool,
37+
Resolver: schema.PathResolver("DisableLocalAuth"),
38+
},
39+
{
40+
Name: "disable_device_sas",
41+
Type: schema.TypeBool,
42+
Resolver: schema.PathResolver("DisableDeviceSAS"),
43+
},
44+
{
45+
Name: "disable_module_sas",
46+
Type: schema.TypeBool,
47+
Resolver: schema.PathResolver("DisableModuleSAS"),
48+
},
49+
{
50+
Name: "restrict_outbound_network_access",
51+
Type: schema.TypeBool,
52+
Resolver: schema.PathResolver("RestrictOutboundNetworkAccess"),
53+
},
54+
{
55+
Name: "allowed_fqdn_list",
56+
Type: schema.TypeStringArray,
57+
Resolver: schema.PathResolver("AllowedFqdnList"),
58+
},
59+
{
60+
Name: "public_network_access",
61+
Type: schema.TypeString,
62+
Resolver: schema.PathResolver("PublicNetworkAccess"),
63+
},
64+
{
65+
Name: "ip_filter_rules",
66+
Type: schema.TypeJSON,
67+
Resolver: schema.PathResolver("IPFilterRules"),
68+
},
69+
{
70+
Name: "network_rule_sets",
71+
Type: schema.TypeJSON,
72+
Resolver: schema.PathResolver("NetworkRuleSets"),
73+
},
74+
{
75+
Name: "min_tls_version",
76+
Type: schema.TypeString,
77+
Resolver: schema.PathResolver("MinTLSVersion"),
78+
},
79+
{
80+
Name: "private_endpoint_connections",
81+
Type: schema.TypeJSON,
82+
Resolver: schema.PathResolver("PrivateEndpointConnections"),
83+
},
84+
{
85+
Name: "provisioning_state",
86+
Type: schema.TypeString,
87+
Resolver: schema.PathResolver("ProvisioningState"),
88+
},
89+
{
90+
Name: "state",
91+
Type: schema.TypeString,
92+
Resolver: schema.PathResolver("State"),
93+
},
94+
{
95+
Name: "host_name",
96+
Type: schema.TypeString,
97+
Resolver: schema.PathResolver("HostName"),
98+
},
99+
{
100+
Name: "event_hub_endpoints",
101+
Type: schema.TypeJSON,
102+
Resolver: schema.PathResolver("EventHubEndpoints"),
103+
},
104+
{
105+
Name: "routing",
106+
Type: schema.TypeJSON,
107+
Resolver: schema.PathResolver("Routing"),
108+
},
109+
{
110+
Name: "storage_endpoints",
111+
Type: schema.TypeJSON,
112+
Resolver: schema.PathResolver("StorageEndpoints"),
113+
},
114+
{
115+
Name: "messaging_endpoints",
116+
Type: schema.TypeJSON,
117+
Resolver: schema.PathResolver("MessagingEndpoints"),
118+
},
119+
{
120+
Name: "enable_file_upload_notifications",
121+
Type: schema.TypeBool,
122+
Resolver: schema.PathResolver("EnableFileUploadNotifications"),
123+
},
124+
{
125+
Name: "cloud_to_device",
126+
Type: schema.TypeJSON,
127+
Resolver: schema.PathResolver("CloudToDevice"),
128+
},
129+
{
130+
Name: "comments",
131+
Type: schema.TypeString,
132+
Resolver: schema.PathResolver("Comments"),
133+
},
134+
{
135+
Name: "features",
136+
Type: schema.TypeString,
137+
Resolver: schema.PathResolver("Features"),
138+
},
139+
{
140+
Name: "locations",
141+
Type: schema.TypeJSON,
142+
Resolver: schema.PathResolver("Locations"),
143+
},
144+
{
145+
Name: "enable_data_residency",
146+
Type: schema.TypeBool,
147+
Resolver: schema.PathResolver("EnableDataResidency"),
33148
},
34149
{
35150
Name: "sku",

plugins/source/azure/resources/services/keyvault/managed_hsms.go

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,44 @@ func ManagedHsms() *schema.Table {
2222
Resolver: client.ResolveAzureSubscription,
2323
},
2424
{
25-
Name: "properties",
26-
Type: schema.TypeJSON,
27-
Resolver: schema.PathResolver("Properties"),
25+
Name: "initial_admin_object_ids",
26+
Type: schema.TypeStringArray,
27+
Resolver: schema.PathResolver("InitialAdminObjectIds"),
28+
},
29+
{
30+
Name: "hsm_uri",
31+
Type: schema.TypeString,
32+
Resolver: schema.PathResolver("HsmURI"),
33+
},
34+
{
35+
Name: "enable_soft_delete",
36+
Type: schema.TypeBool,
37+
Resolver: schema.PathResolver("EnableSoftDelete"),
38+
},
39+
{
40+
Name: "soft_delete_retention_in_days",
41+
Type: schema.TypeInt,
42+
Resolver: schema.PathResolver("SoftDeleteRetentionInDays"),
43+
},
44+
{
45+
Name: "enable_purge_protection",
46+
Type: schema.TypeBool,
47+
Resolver: schema.PathResolver("EnablePurgeProtection"),
48+
},
49+
{
50+
Name: "create_mode",
51+
Type: schema.TypeString,
52+
Resolver: schema.PathResolver("CreateMode"),
53+
},
54+
{
55+
Name: "status_message",
56+
Type: schema.TypeString,
57+
Resolver: schema.PathResolver("StatusMessage"),
58+
},
59+
{
60+
Name: "provisioning_state",
61+
Type: schema.TypeString,
62+
Resolver: schema.PathResolver("ProvisioningState"),
2863
},
2964
{
3065
Name: "id",

plugins/source/azure/resources/services/keyvault/vaults.go

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,69 @@ func Vaults() *schema.Table {
5050
Resolver: schema.PathResolver("Tags"),
5151
},
5252
{
53-
Name: "properties",
53+
Name: "sku",
5454
Type: schema.TypeJSON,
55-
Resolver: schema.PathResolver("Properties"),
55+
Resolver: schema.PathResolver("Sku"),
56+
},
57+
{
58+
Name: "access_policies",
59+
Type: schema.TypeJSON,
60+
Resolver: schema.PathResolver("AccessPolicies"),
61+
},
62+
{
63+
Name: "vault_uri",
64+
Type: schema.TypeString,
65+
Resolver: schema.PathResolver("VaultURI"),
66+
},
67+
{
68+
Name: "enabled_for_deployment",
69+
Type: schema.TypeBool,
70+
Resolver: schema.PathResolver("EnabledForDeployment"),
71+
},
72+
{
73+
Name: "enabled_for_disk_encryption",
74+
Type: schema.TypeBool,
75+
Resolver: schema.PathResolver("EnabledForDiskEncryption"),
76+
},
77+
{
78+
Name: "enabled_for_template_deployment",
79+
Type: schema.TypeBool,
80+
Resolver: schema.PathResolver("EnabledForTemplateDeployment"),
81+
},
82+
{
83+
Name: "enable_soft_delete",
84+
Type: schema.TypeBool,
85+
Resolver: schema.PathResolver("EnableSoftDelete"),
86+
},
87+
{
88+
Name: "soft_delete_retention_in_days",
89+
Type: schema.TypeInt,
90+
Resolver: schema.PathResolver("SoftDeleteRetentionInDays"),
91+
},
92+
{
93+
Name: "enable_rbac_authorization",
94+
Type: schema.TypeBool,
95+
Resolver: schema.PathResolver("EnableRbacAuthorization"),
96+
},
97+
{
98+
Name: "create_mode",
99+
Type: schema.TypeString,
100+
Resolver: schema.PathResolver("CreateMode"),
101+
},
102+
{
103+
Name: "enable_purge_protection",
104+
Type: schema.TypeBool,
105+
Resolver: schema.PathResolver("EnablePurgeProtection"),
106+
},
107+
{
108+
Name: "network_acls",
109+
Type: schema.TypeJSON,
110+
Resolver: schema.PathResolver("NetworkAcls"),
111+
},
112+
{
113+
Name: "private_endpoint_connections",
114+
Type: schema.TypeJSON,
115+
Resolver: schema.PathResolver("PrivateEndpointConnections"),
56116
},
57117
},
58118

plugins/source/azure/resources/services/resources/groups.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ func Groups() *schema.Table {
4040
Resolver: schema.PathResolver("Type"),
4141
},
4242
{
43-
Name: "properties",
44-
Type: schema.TypeJSON,
45-
Resolver: schema.PathResolver("Properties"),
43+
Name: "provisioning_state",
44+
Type: schema.TypeString,
45+
Resolver: schema.PathResolver("ProvisioningState"),
4646
},
4747
{
4848
Name: "location",

plugins/source/azure/resources/services/resources/links.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,19 @@ func Links() *schema.Table {
3535
Resolver: schema.PathResolver("Name"),
3636
},
3737
{
38-
Name: "properties",
39-
Type: schema.TypeJSON,
40-
Resolver: schema.PathResolver("Properties"),
38+
Name: "source_id",
39+
Type: schema.TypeString,
40+
Resolver: schema.PathResolver("SourceID"),
41+
},
42+
{
43+
Name: "target_id",
44+
Type: schema.TypeString,
45+
Resolver: schema.PathResolver("TargetID"),
46+
},
47+
{
48+
Name: "notes",
49+
Type: schema.TypeString,
50+
Resolver: schema.PathResolver("Notes"),
4151
},
4252
},
4353
}

0 commit comments

Comments
 (0)