Skip to content

Commit

Permalink
Merge pull request #21 from cisco-open/hh-vm-props
Browse files Browse the repository at this point in the history
Support Template Name and Description in VMs
  • Loading branch information
hughwphamill authored Nov 28, 2024
2 parents 8ddf259 + 8742c83 commit a0aa651
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 79 deletions.
2 changes: 2 additions & 0 deletions tbclient/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ type InventoryVmRemoteAccess struct {
type InventoryVm struct {
Id string `json:"id,omitempty"`
Datacenter string `json:"datacenter,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
OriginalName string `json:"originalName,omitempty"`
OriginalDescription string `json:"originalDescription,omitempty"`
CpuQty uint64 `json:"cpuQty,omitempty"`
Expand Down
34 changes: 13 additions & 21 deletions tbclient/tbclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,36 +102,27 @@ var lonDefaultNetwork = Network{
}

var inventoryVm = InventoryVm{
Id: "templatevm3",
Id: "templatevm1",
Datacenter: "LON",
OriginalName: "na-edge1",
OriginalDescription: "na-edge1",
CpuQty: 2,
MemoryMb: 4096,
Name: "vmtemplate1 name",
Description: "vmtemplate1 description",
OriginalName: "Collab-mssql1",
OriginalDescription: "Collab-mssql1",
CpuQty: 4,
MemoryMb: 8192,
NetworkInterfaces: []InventoryVmNic{
// TODO - contract needs to specify additional fields
{
InventoryNetworkId: "VLAN-PRIMARY",
Name: "Network adapter 1",
Name: "Network adapter 0",
IpAddress: "198.18.133.115",
},
{
InventoryNetworkId: "VLAN-PRIMARY",
Name: "Network adapter 2",
},
{
InventoryNetworkId: "L2-VLAN-15",
Name: "Network adapter 3",
},
{
InventoryNetworkId: "L2-VLAN-20",
Name: "Network adapter 4",
Type: "VIRTUAL_E1000",
},
},
RemoteAccess: &InventoryVmRemoteAccess{
RdpAutoLogin: true,
RdpEnabled: true,
SshEnabled: true,
RdpAutoLogin: false,
RdpEnabled: false,
SshEnabled: false,
},
}

Expand Down Expand Up @@ -1434,6 +1425,7 @@ func (suite *ContractTestSuite) TestGetAllInventoryVms() {

// Then
suite.Equal(4, len(inventoryVms))
suite.Equal(inventoryVms[2], inventoryVm)
suite.Contains(inventoryVms, inventoryVm)
}

Expand Down
16 changes: 0 additions & 16 deletions tbclient/test_stubs/mappings/vm/getAllVms_no_filter_success.json

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions tbclient/test_stubs/mappings/vm/getVirtualHardware_success.json

This file was deleted.

0 comments on commit a0aa651

Please sign in to comment.