-
Notifications
You must be signed in to change notification settings - Fork 544
feat: Add instance_view to azure_compute_virtual_machines table #5941
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
Changes from 8 commits
56604ae
ae3a16d
7639dcc
19c72e1
47e2f98
7750f05
8190815
033b6d9
fe4531c
ca8429b
3784cf9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package compute | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" | ||
| "github.com/cloudquery/cloudquery/plugins/source/azure/client" | ||
| "github.com/cloudquery/plugin-sdk/schema" | ||
| ) | ||
|
|
||
| func getInstanceView(ctx context.Context, meta schema.ClientMeta, resource *schema.Resource, c schema.Column) error { | ||
| cl := meta.(*client.Client) | ||
| svc, err := armcompute.NewVirtualMachinesClient(cl.SubscriptionId, cl.Creds, cl.Options) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| item := resource.Item.(*armcompute.VirtualMachine) | ||
| group, err := client.ParseResourceGroup(*item.ID) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| instanceView, err := svc.InstanceView(ctx, group, *item.Name, nil) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| return resource.Set(c.Name, instanceView.VirtualMachineInstanceView) | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.