feat(plugin): Support extracting Azure resource name (#11)
This commit is contained in:
3 files changed
+79
-96
No files matched your search
+9
-3
@@ -389,10 +389,16 @@ func (p *AzurePlugin) ListHosts(ctx context.Context, req *pb.ListHostsRequest) (
|
||||
|
||||
ret := &pb.ListHostsResponse{}
|
||||
for k, v := range vmToNetworkMap {
|
||||
_, externalName, err := splitId(k, constMsComputeService, constVirtualMachinesResource)
|
||||
if err != nil {
|
||||
externalName = ""
|
||||
}
|
||||
|
||||
host := &pb.ListHostsResponseHost{
|
||||
ExternalId: k,
|
||||
IpAddresses: v.IpAddresses,
|
||||
SetIds: resourceToSetMap[k],
|
||||
ExternalId: k,
|
||||
ExternalName: externalName,
|
||||
IpAddresses: v.IpAddresses,
|
||||
SetIds: resourceToSetMap[k],
|
||||
}
|
||||
ret.Hosts = append(ret.Hosts, host)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user