diff --git a/src/flat/folders/simple/node.folder.accesskey.ts b/src/flat/folders/simple/node.folder.accesskey.ts index d78a526..dc6f4ea 100644 --- a/src/flat/folders/simple/node.folder.accesskey.ts +++ b/src/flat/folders/simple/node.folder.accesskey.ts @@ -26,7 +26,7 @@ export class AccessKeysFolderNode extends FiltersFolderNode i continue; } - resources.push(new ResourceNode(this.profile, "", item.accessKeyId, "AccessKey", deleteAccessKey, getAccessKey)); + resources.push(new ResourceNode(this.profile, "", item.accessKeyId, "AccessKey", deleteAccessKey, getAccessKey, undefined)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.apiaccessrule.ts b/src/flat/folders/simple/node.folder.apiaccessrule.ts index a1ba40e..13432ec 100644 --- a/src/flat/folders/simple/node.folder.apiaccessrule.ts +++ b/src/flat/folders/simple/node.folder.apiaccessrule.ts @@ -26,7 +26,7 @@ export class ApiAccessRulesFolderNode extends FiltersFolderNode implements Explo continue; } - resources.push(new ResourceNode(this.profile, "", item.caId, "Ca", deleteCa, getCa)); + resources.push(new ResourceNode(this.profile, "", item.caId, "Ca", deleteCa, getCa, undefined)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.clientgateway.ts b/src/flat/folders/simple/node.folder.clientgateway.ts index 6a5846a..911bea4 100644 --- a/src/flat/folders/simple/node.folder.clientgateway.ts +++ b/src/flat/folders/simple/node.folder.clientgateway.ts @@ -26,7 +26,7 @@ export class ClientGatewaysFolderNode extends FiltersFolderNode continue; } - resources.push(new ResourceNode(this.profile, "", item.dhcpOptionsSetId, "DhcpOption", deleteDhcpOption, getDhcpOption)); + resources.push(new ResourceNode(this.profile, "", item.dhcpOptionsSetId, "DhcpOption", deleteDhcpOption, getDhcpOption, item.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.directlink.ts b/src/flat/folders/simple/node.folder.directlink.ts index ddf8080..6b805f5 100644 --- a/src/flat/folders/simple/node.folder.directlink.ts +++ b/src/flat/folders/simple/node.folder.directlink.ts @@ -26,7 +26,7 @@ export class DirectLinksFolderNode extends FiltersFolderNode continue; } - resources.push(new ResourceNode(this.profile, "", item.directLinkId, "DirectLink", deleteDirectLink, getDirectLink)); + resources.push(new ResourceNode(this.profile, "", item.directLinkId, "DirectLink", deleteDirectLink, getDirectLink, undefined)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.directlinkinterface.ts b/src/flat/folders/simple/node.folder.directlinkinterface.ts index b274f58..5b7d05a 100644 --- a/src/flat/folders/simple/node.folder.directlinkinterface.ts +++ b/src/flat/folders/simple/node.folder.directlinkinterface.ts @@ -26,7 +26,7 @@ export class DirectLinkInterfacesFolderNode extends FiltersFolderNode implem if (typeof keypair.keypairName === 'undefined') { continue; } - resources.push(new ResourceNode(this.profile, "", keypair.keypairName, "keypairs", deleteKeypair, getKeypair)); + resources.push(new ResourceNode(this.profile, "", keypair.keypairName, "keypairs", deleteKeypair, getKeypair, undefined)); } return Promise.resolve(resources.sort(resourceNodeCompare)); }); diff --git a/src/flat/folders/simple/node.folder.loadbalancer.ts b/src/flat/folders/simple/node.folder.loadbalancer.ts index c6ab2b2..dc6ecd1 100644 --- a/src/flat/folders/simple/node.folder.loadbalancer.ts +++ b/src/flat/folders/simple/node.folder.loadbalancer.ts @@ -23,7 +23,7 @@ export class LoadBalancerFolderNode extends FiltersFolderNode continue; } - resources.push(new ResourceNode(this.profile, "", item.natServiceId, "NatService", deleteNatService, getNatService)); + resources.push(new ResourceNode(this.profile, "", item.natServiceId, "NatService", deleteNatService, getNatService, item.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.netaccesspoint.ts b/src/flat/folders/simple/node.folder.netaccesspoint.ts index 680ca65..f2f38f5 100644 --- a/src/flat/folders/simple/node.folder.netaccesspoint.ts +++ b/src/flat/folders/simple/node.folder.netaccesspoint.ts @@ -26,7 +26,7 @@ export class NetAccessPointsFolderNode extends FiltersFolderNode continue; } - resources.push(new ResourceNode(this.profile, "", item.netPeeringId, "NetPeering", deleteNetPeering, getNetPeering)); + resources.push(new ResourceNode(this.profile, "", item.netPeeringId, "NetPeering", deleteNetPeering, getNetPeering, item.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.snapshot.ts b/src/flat/folders/simple/node.folder.snapshot.ts index 6057291..e33d46e 100644 --- a/src/flat/folders/simple/node.folder.snapshot.ts +++ b/src/flat/folders/simple/node.folder.snapshot.ts @@ -23,7 +23,7 @@ export class SnapshotsFolderNode extends FiltersFolderNode impl if (typeof snapshot.snapshotId === 'undefined' || typeof snapshot.description === 'undefined') { continue; } - resources.push(new ResourceNode(this.profile, snapshot.description, snapshot.snapshotId, "snapshots", deleteSnapshot, getSnapshot)); + resources.push(new ResourceNode(this.profile, snapshot.description, snapshot.snapshotId, "snapshots", deleteSnapshot, getSnapshot, snapshot.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); }); diff --git a/src/flat/folders/simple/node.folder.subnet.ts b/src/flat/folders/simple/node.folder.subnet.ts index d30d4a7..388de1c 100644 --- a/src/flat/folders/simple/node.folder.subnet.ts +++ b/src/flat/folders/simple/node.folder.subnet.ts @@ -26,7 +26,7 @@ export class SubnetsFolderNode extends FiltersFolderNode implemen continue; } - resources.push(new ResourceNode(this.profile, "", item.subnetId, "Subnet", deleteSubnet, getSubnet)); + resources.push(new ResourceNode(this.profile, "", item.subnetId, "Subnet", deleteSubnet, getSubnet, item.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.vmgroup.ts b/src/flat/folders/simple/node.folder.vmgroup.ts index 5eb6131..90ce2db 100644 --- a/src/flat/folders/simple/node.folder.vmgroup.ts +++ b/src/flat/folders/simple/node.folder.vmgroup.ts @@ -31,7 +31,7 @@ export class VmGroupsFolderNode extends FiltersFolderNode implem continue; } - resources.push(new ResourceNode(this.profile, item.vmGroupName, item.vmGroupId, "VmGroup", deleteVmGroup, getVmGroup)); + resources.push(new ResourceNode(this.profile, item.vmGroupName, item.vmGroupId, "VmGroup", deleteVmGroup, getVmGroup, item.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.vmtemplate.ts b/src/flat/folders/simple/node.folder.vmtemplate.ts index 09122d3..5b8e4a8 100644 --- a/src/flat/folders/simple/node.folder.vmtemplate.ts +++ b/src/flat/folders/simple/node.folder.vmtemplate.ts @@ -31,7 +31,7 @@ export class VmTemplatesFolderNode extends FiltersFolderNode continue; } - resources.push(new ResourceNode(this.profile, item.vmTemplateName, item.vmTemplateId, "VmTemplate", deleteVmTemplate, getVmTemplate)); + resources.push(new ResourceNode(this.profile, item.vmTemplateName, item.vmTemplateId, "VmTemplate", deleteVmTemplate, getVmTemplate, item.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/simple/node.folder.vpnconnection.ts b/src/flat/folders/simple/node.folder.vpnconnection.ts index 8e0d27b..db64cf6 100644 --- a/src/flat/folders/simple/node.folder.vpnconnection.ts +++ b/src/flat/folders/simple/node.folder.vpnconnection.ts @@ -26,7 +26,7 @@ export class VpnConnectionsFolderNode extends FiltersFolderNode implements Expl if (typeof net.netId === 'undefined') { continue; } - resources.push(new NetResourceNode(this.profile, "", net.netId?.toString())); + resources.push(new NetResourceNode(this.profile, "", net.netId?.toString(), net.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); }); diff --git a/src/flat/folders/specific/node.folder.nic.ts b/src/flat/folders/specific/node.folder.nic.ts index 47c3037..7c87c0a 100644 --- a/src/flat/folders/specific/node.folder.nic.ts +++ b/src/flat/folders/specific/node.folder.nic.ts @@ -30,7 +30,7 @@ export class NicsFolderNode extends FiltersFolderNode implements Exp continue; } - resources.push(new NicResourceNode(this.profile, "", item.nicId, item.state)); + resources.push(new NicResourceNode(this.profile, "", item.nicId, item.state, item.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); diff --git a/src/flat/folders/specific/node.folder.publicip.ts b/src/flat/folders/specific/node.folder.publicip.ts index f0bb3b8..cccf661 100644 --- a/src/flat/folders/specific/node.folder.publicip.ts +++ b/src/flat/folders/specific/node.folder.publicip.ts @@ -23,7 +23,7 @@ export class ExternalIPsFolderNode extends FiltersFolderNode im if (typeof publicIp.publicIp === 'undefined' || typeof publicIp.publicIpId === 'undefined') { continue; } - resources.push(new PublicIpResourceNode(this.profile, publicIp.publicIp, publicIp.publicIpId, (typeof publicIp.linkPublicIpId === "undefined" || publicIp.linkPublicIpId.length === 0) ? "unlink" : "link")); + resources.push(new PublicIpResourceNode(this.profile, publicIp.publicIp, publicIp.publicIpId, (typeof publicIp.linkPublicIpId === "undefined" || publicIp.linkPublicIpId.length === 0) ? "unlink" : "link", publicIp.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); }); diff --git a/src/flat/folders/specific/node.folder.routetable.ts b/src/flat/folders/specific/node.folder.routetable.ts index 983ef7b..313078f 100644 --- a/src/flat/folders/specific/node.folder.routetable.ts +++ b/src/flat/folders/specific/node.folder.routetable.ts @@ -23,7 +23,7 @@ export class RouteTablesFolderNode extends FiltersFolderNode if (typeof routeTable.routeTableId === 'undefined') { continue; } - resources.push(new RouteTableResourceNode(this.profile, "", routeTable.routeTableId, (typeof routeTable.linkRouteTables === 'undefined') || routeTable.linkRouteTables.length === 0 ? 'unlink' : 'link')); + resources.push(new RouteTableResourceNode(this.profile, "", routeTable.routeTableId, (typeof routeTable.linkRouteTables === 'undefined') || routeTable.linkRouteTables.length === 0 ? 'unlink' : 'link', routeTable.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); }); diff --git a/src/flat/folders/specific/node.folder.securitygroup.ts b/src/flat/folders/specific/node.folder.securitygroup.ts index e94cbc5..8b55465 100644 --- a/src/flat/folders/specific/node.folder.securitygroup.ts +++ b/src/flat/folders/specific/node.folder.securitygroup.ts @@ -23,7 +23,7 @@ export class SecurityGroupsFolderNode extends FiltersFolderNode implements Explo } } - resources.push(new VmResourceNode(this.profile, getVmName(vm), vm.vmId?.toString(), vm.state, isWindows)); + resources.push(new VmResourceNode(this.profile, getVmName(vm), vm.vmId?.toString(), vm.state, isWindows, vm.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); }); diff --git a/src/flat/folders/specific/node.folder.volume.ts b/src/flat/folders/specific/node.folder.volume.ts index 9910f1c..c2ee405 100644 --- a/src/flat/folders/specific/node.folder.volume.ts +++ b/src/flat/folders/specific/node.folder.volume.ts @@ -24,7 +24,7 @@ export class VolumeFolderNode extends FiltersFolderNode implement if (typeof volume.volumeId === 'undefined' || typeof volume.state === 'undefined') { continue; } - resources.push(new VolumeResourceNode(this.profile, "", volume.volumeId, volume.state)); + resources.push(new VolumeResourceNode(this.profile, "", volume.volumeId, volume.state, volume.tags)); } return Promise.resolve(resources.sort(resourceNodeCompare)); }); diff --git a/src/flat/resources/node.resources.eip.ts b/src/flat/resources/node.resources.eip.ts index ef83a1a..689e941 100644 --- a/src/flat/resources/node.resources.eip.ts +++ b/src/flat/resources/node.resources.eip.ts @@ -3,12 +3,13 @@ import { deleteExternalIP, unlinkExternalIP, getExternalIP } from '../../cloud/p import { Profile } from '../node'; import { ResourceNode } from './node.resources'; import { LinkResourceNode } from './types/node.resources.link'; +import { ResourceTag } from 'outscale-api'; export class PublicIpResourceNode extends ResourceNode implements LinkResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string) { - super(profile, resourceName, resourceId, "eips", deleteExternalIP, getExternalIP); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "eips", deleteExternalIP, getExternalIP, tags); } getContextValue(): string { diff --git a/src/flat/resources/node.resources.flexiblegpus.ts b/src/flat/resources/node.resources.flexiblegpus.ts index 4b62805..f9ee4eb 100644 --- a/src/flat/resources/node.resources.flexiblegpus.ts +++ b/src/flat/resources/node.resources.flexiblegpus.ts @@ -3,12 +3,13 @@ import { deleteFlexibleGpu, getFlexibleGpu, unlinkFlexibleGpu } from '../../clou import { Profile } from '../node'; import { ResourceNode } from './node.resources'; import { LinkResourceNode } from './types/node.resources.link'; +import { ResourceTag } from 'outscale-api'; export class FlexibleGpuResourceNode extends ResourceNode implements LinkResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string) { - super(profile, resourceName, resourceId, "FlexibleGpu", deleteFlexibleGpu, getFlexibleGpu); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "FlexibleGpu", deleteFlexibleGpu, getFlexibleGpu, tags); } getContextValue(): string { diff --git a/src/flat/resources/node.resources.internetservices.ts b/src/flat/resources/node.resources.internetservices.ts index 4cfd9fe..9fa6a60 100644 --- a/src/flat/resources/node.resources.internetservices.ts +++ b/src/flat/resources/node.resources.internetservices.ts @@ -3,12 +3,13 @@ import { deleteInternetService, getInternetService, unlinkInternetService } from import { Profile } from '../node'; import { ResourceNode } from './node.resources'; import { LinkResourceNode } from './types/node.resources.link'; +import { ResourceTag } from 'outscale-api'; export class InternetServiceResourceNode extends ResourceNode implements LinkResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string) { - super(profile, resourceName, resourceId, "InternetService", deleteInternetService, getInternetService); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "InternetService", deleteInternetService, getInternetService, tags); } getContextValue(): string { diff --git a/src/flat/resources/node.resources.nets.ts b/src/flat/resources/node.resources.nets.ts index 57263b7..fba9d8d 100644 --- a/src/flat/resources/node.resources.nets.ts +++ b/src/flat/resources/node.resources.nets.ts @@ -15,12 +15,13 @@ import { RouteTableResourceNode } from "./node.resources.routetables"; import { SecurityGroupResourceNode } from "./node.resources.securitygroups"; import { VirtualGatewayResourceNode } from "./node.resources.virtualgateways"; import { VmResourceNode } from "./node.resources.vms"; +import { ResourceTag } from 'outscale-api'; export class NetResourceNode extends ResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string) { - super(profile, resourceName, resourceId, "vpc", deleteNet, getNet); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "vpc", deleteNet, getNet, tags); } getContextValue(): string { @@ -41,7 +42,7 @@ export class NetResourceNode extends ResourceNode { if (typeof vm.vmId === 'undefined') { return undefined; } - return new VmResourceNode(this.profile, "", vm.vmId, "", false); + return new VmResourceNode(this.profile, "", vm.vmId, "", false, undefined); }); resourceToDelete.push(...res); } @@ -52,7 +53,7 @@ export class NetResourceNode extends ResourceNode { if (typeof lbu.loadBalancerName === 'undefined') { return undefined; } - return new ResourceNode(this.profile, "", lbu.loadBalancerName, "loadbalancers", deleteLoadBalancer, getLoadBalancer); + return new ResourceNode(this.profile, "", lbu.loadBalancerName, "loadbalancers", deleteLoadBalancer, getLoadBalancer, undefined); }); resourceToDelete.push(...res); } @@ -64,7 +65,7 @@ export class NetResourceNode extends ResourceNode { if (typeof netPeer.netPeeringId === 'undefined') { return undefined; } - return new ResourceNode(this.profile, "", netPeer.netPeeringId, "NetPeering", deleteNetPeering, getNetPeering); + return new ResourceNode(this.profile, "", netPeer.netPeeringId, "NetPeering", deleteNetPeering, getNetPeering, undefined); }); resourceToDelete.push(...res); } @@ -74,7 +75,7 @@ export class NetResourceNode extends ResourceNode { if (typeof netPeer.netPeeringId === 'undefined') { return undefined; } - return new ResourceNode(this.profile, "", netPeer.netPeeringId, "NetPeering", deleteNetPeering, getNetPeering); + return new ResourceNode(this.profile, "", netPeer.netPeeringId, "NetPeering", deleteNetPeering, getNetPeering, undefined); }); resourceToDelete.push(...res); } @@ -90,7 +91,7 @@ export class NetResourceNode extends ResourceNode { return undefined; } - return new ResourceNode(this.profile, "", nap.netAccessPointId, "NetAccessPoint", deleteNetAccessPoint, getNetAccessPoint); + return new ResourceNode(this.profile, "", nap.netAccessPointId, "NetAccessPoint", deleteNetAccessPoint, getNetAccessPoint, undefined); }); resourceToDelete.push(...res); } @@ -113,7 +114,7 @@ export class NetResourceNode extends ResourceNode { } } - return new ResourceNode(this.profile, "", nat.natServiceId, "NatService", deleteNatService, getNatService); + return new ResourceNode(this.profile, "", nat.natServiceId, "NatService", deleteNatService, getNatService, undefined); }); resourceToDelete.push(...res); } @@ -125,7 +126,7 @@ export class NetResourceNode extends ResourceNode { return undefined; } - return new RouteTableResourceNode(this.profile, "", rt.routeTableId, ""); + return new RouteTableResourceNode(this.profile, "", rt.routeTableId, "", undefined); }); resourceToDelete.push(...res); } @@ -138,7 +139,7 @@ export class NetResourceNode extends ResourceNode { if (typeof sg.securityGroupId === 'undefined') { return undefined; } - return new SecurityGroupResourceNode(this.profile, "", sg.securityGroupId); + return new SecurityGroupResourceNode(this.profile, "", sg.securityGroupId, undefined); }); resourceToDelete.push(...res); } @@ -149,7 +150,7 @@ export class NetResourceNode extends ResourceNode { if (typeof vg.virtualGatewayId === 'undefined') { return undefined; } - return new VirtualGatewayResourceNode(this.profile, "", vg.virtualGatewayId); + return new VirtualGatewayResourceNode(this.profile, "", vg.virtualGatewayId, undefined); }); resourceToDelete.push(...res); } @@ -165,7 +166,7 @@ export class NetResourceNode extends ResourceNode { publicIpIds.push(nic.linkPublicIp.publicIpId); } - return new NicResourceNode(this.profile, "", nic.nicId, ""); + return new NicResourceNode(this.profile, "", nic.nicId, "", undefined); }); resourceToDelete.push(...res); } @@ -177,7 +178,7 @@ export class NetResourceNode extends ResourceNode { return undefined; } - return new ResourceNode(this.profile, "", subnet.subnetId, "Subnet", deleteSubnet, getSubnet); + return new ResourceNode(this.profile, "", subnet.subnetId, "Subnet", deleteSubnet, getSubnet, undefined); }); resourceToDelete.push(...res); } @@ -189,7 +190,7 @@ export class NetResourceNode extends ResourceNode { return undefined; } - return new InternetServiceResourceNode(this.profile, "", is.internetServiceId, ""); + return new InternetServiceResourceNode(this.profile, "", is.internetServiceId, "", undefined); }); resourceToDelete.push(...res); } @@ -201,13 +202,13 @@ export class NetResourceNode extends ResourceNode { return undefined; } - return new ResourceNode(this.profile, "", vpn.vpnConnectionId, "VpnConnection", deleteVpnConnection, getVpnConnection); + return new ResourceNode(this.profile, "", vpn.vpnConnectionId, "VpnConnection", deleteVpnConnection, getVpnConnection, undefined); }); resourceToDelete.push(...res); } //PublicIP - const ips = publicIpIds.map((ip) => new ResourceNode(this.profile, "", ip, "eips", deleteExternalIP, getExternalIP)); + const ips = publicIpIds.map((ip) => new ResourceNode(this.profile, "", ip, "eips", deleteExternalIP, getExternalIP, undefined)); resourceToDelete.push(...ips); // Net diff --git a/src/flat/resources/node.resources.nics.ts b/src/flat/resources/node.resources.nics.ts index 1fe0b1e..3aa088f 100644 --- a/src/flat/resources/node.resources.nics.ts +++ b/src/flat/resources/node.resources.nics.ts @@ -3,12 +3,13 @@ import { deleteNic, getNic, unlinkNic } from '../../cloud/nics'; import { Profile } from '../node'; import { ResourceNode } from './node.resources'; import { LinkResourceNode } from './types/node.resources.link'; +import { ResourceTag } from 'outscale-api'; export class NicResourceNode extends ResourceNode implements LinkResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string) { - super(profile, resourceName, resourceId, "Nic", deleteNic, getNic); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "Nic", deleteNic, getNic, tags); } getContextValue(): string { diff --git a/src/flat/resources/node.resources.routetables.ts b/src/flat/resources/node.resources.routetables.ts index 7ca6f2d..116b6bf 100644 --- a/src/flat/resources/node.resources.routetables.ts +++ b/src/flat/resources/node.resources.routetables.ts @@ -9,8 +9,8 @@ import { SubResourceNode } from "./types/node.resources.subresource"; export class RouteTableResourceNode extends ResourceNode implements LinkResourceNode, SubResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string) { - super(profile, resourceName, resourceId, "routetables", deleteRouteTable, getRouteTable); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "routetables", deleteRouteTable, getRouteTable, tags); } getContextValue(): string { diff --git a/src/flat/resources/node.resources.securitygroups.ts b/src/flat/resources/node.resources.securitygroups.ts index 78d1469..58640c2 100644 --- a/src/flat/resources/node.resources.securitygroups.ts +++ b/src/flat/resources/node.resources.securitygroups.ts @@ -8,8 +8,8 @@ import { SubResourceNode } from "./types/node.resources.subresource"; export class SecurityGroupResourceNode extends ResourceNode implements SubResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string) { - super(profile, resourceName, resourceId, "securitygroups", deleteSecurityGroup, getSecurityGroup); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "securitygroups", deleteSecurityGroup, getSecurityGroup, tags); } getContextValue(): string { diff --git a/src/flat/resources/node.resources.ts b/src/flat/resources/node.resources.ts index 3698954..2fffcbe 100644 --- a/src/flat/resources/node.resources.ts +++ b/src/flat/resources/node.resources.ts @@ -1,12 +1,13 @@ import * as vscode from 'vscode'; import { ExplorerNode, ExplorerResourceNode, Profile, ResourceNodeType } from '../node'; +import { ResourceTag } from 'outscale-api'; export class ResourceNode implements ExplorerResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceType: ResourceNodeType, readonly deleteFunc: (profile: Profile, resourceid: string) => Promise, readonly getFunc: (profile: Profile, resourceid: string) => Promise) { + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceType: ResourceNodeType, readonly deleteFunc: (profile: Profile, resourceid: string) => Promise, readonly getFunc: (profile: Profile, resourceid: string) => Promise, readonly tags: Array | undefined) { } getResourceId(): Promise { @@ -55,6 +56,15 @@ export class ResourceNode implements ExplorerResourceNode { "arguments": [this] }; treeItem.contextValue = this.getContextValue(); + if (typeof this.tags !== 'undefined') { + const markdown = new vscode.MarkdownString(); + markdown.appendMarkdown("**Tags**:"); + for (const tag of this.tags) { + markdown.appendMarkdown(`\n- **${tag.key}**: ${tag.value}`); + } + + treeItem.tooltip = markdown; + } return treeItem; } diff --git a/src/flat/resources/node.resources.virtualgateways.ts b/src/flat/resources/node.resources.virtualgateways.ts index 54ba79e..b810afe 100644 --- a/src/flat/resources/node.resources.virtualgateways.ts +++ b/src/flat/resources/node.resources.virtualgateways.ts @@ -8,8 +8,8 @@ import { LinkResourceNode } from './types/node.resources.link'; export class VirtualGatewayResourceNode extends ResourceNode implements LinkResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string) { - super(profile, resourceName, resourceId, "VirtualGateway", deleteVirtualGateway, getVirtualGateway); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "VirtualGateway", deleteVirtualGateway, getVirtualGateway, tags); } getContextValue(): string { diff --git a/src/flat/resources/node.resources.vms.ts b/src/flat/resources/node.resources.vms.ts index df03686..30b462c 100644 --- a/src/flat/resources/node.resources.vms.ts +++ b/src/flat/resources/node.resources.vms.ts @@ -5,6 +5,7 @@ import { Profile } from '../node'; import { ResourceNode } from './node.resources'; import crypto = require("crypto"); import { Result } from 'true-myth'; +import { ResourceTag } from 'outscale-api'; @@ -12,8 +13,8 @@ import { Result } from 'true-myth'; export class VmResourceNode extends ResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly windows: boolean) { - super(profile, resourceName, resourceId, "vms", deleteVm, getVm); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly windows: boolean, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "vms", deleteVm, getVm, tags); } startResource(): Promise { diff --git a/src/flat/resources/node.resources.volumes.ts b/src/flat/resources/node.resources.volumes.ts index f16f702..ee1d52b 100644 --- a/src/flat/resources/node.resources.volumes.ts +++ b/src/flat/resources/node.resources.volumes.ts @@ -3,12 +3,13 @@ import { deleteVolume, getVolume, unlinkVolume } from '../../cloud/volumes'; import { Profile } from '../node'; import { ResourceNode } from './node.resources'; import { LinkResourceNode } from './types/node.resources.link'; +import { ResourceTag } from 'outscale-api'; export class VolumeResourceNode extends ResourceNode implements LinkResourceNode { - constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string) { - super(profile, resourceName, resourceId, "volumes", deleteVolume, getVolume); + constructor(readonly profile: Profile, readonly resourceName: string, readonly resourceId: string, readonly resourceState: string, readonly tags: Array | undefined) { + super(profile, resourceName, resourceId, "volumes", deleteVolume, getVolume, tags); } getContextValue(): string {