Skip to content

Commit 5610fc5

Browse files
committed
added Plot, other fixes
1 parent 051e2d3 commit 5610fc5

8 files changed

Lines changed: 35 additions & 16 deletions

File tree

cmd/addressblock.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,18 @@ var addressblockCreateCmd = &cobra.Command{
9696
Short: "Create New AddressBlock",
9797
RunE: func(cmd *cobra.Command, args []string) error {
9898
o := contractorClient.UtilitiesAddressBlockNew()
99-
o.Name = &detailName
100-
o.Subnet = &detailSubnet
101-
o.Prefix = &detailPrefix
99+
if detailName != "" {
100+
o.Name = &detailName
101+
}
102+
103+
if detailSubnet != "" {
104+
o.Subnet = &detailSubnet
105+
}
106+
107+
if detailPrefix != 0 {
108+
o.Prefix = &detailPrefix
109+
}
110+
102111
if detailGatewayOffset != 0 {
103112
o.GatewayOffset = &detailGatewayOffset
104113
}

cmd/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var detailSubnet, detailReason, detailPXE string
2525
var detailPrefix, detailGatewayOffset, detailOffset int
2626
var scriptFile string
2727
var detailAddParent, detailDeleteParent, detailAddFoundationBluePrint, detailDeleteFoundationBluePrint, detailAddType, detailDeleteType, detailAddIfaceName, detailDeleteIfaceName string
28-
var detailName, detailDescription, detailParent string
28+
var detailName, detailDescription, detailParent, detailCorners string
2929
var detailZone int
3030
var detailDatacenter, detailCluster string
3131
var detailHost int

cmd/complex_LibVirt.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ var complexLibVirtCreateCmd = &cobra.Command{
6161
ctx := cmd.Context()
6262

6363
o := contractorClient.LibvirtLibVirtComplexNew()
64-
o.BuiltPercentage = nil
6564
o.Name = &detailName
6665
o.Description = &detailDescription
6766

@@ -74,7 +73,6 @@ var complexLibVirtCreateCmd = &cobra.Command{
7473
}
7574

7675
if detailMember != 0 {
77-
7876
s, err := contractorClient.BuildingStructureGet(ctx, detailMember)
7977
if err != nil {
8078
return err

cmd/complex_VirtualBox.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ var complexVirtualBoxCreateCmd = &cobra.Command{
6363
ctx := cmd.Context()
6464

6565
o := contractorClient.VirtualboxVirtualBoxComplexNew()
66-
o.BuiltPercentage = nil
6766
o.Name = &detailName
6867
o.Description = &detailDescription
6968
o.VirtualboxUsername = &detailUsername
@@ -78,7 +77,6 @@ var complexVirtualBoxCreateCmd = &cobra.Command{
7877
}
7978

8079
if detailMember != 0 {
81-
8280
s, err := contractorClient.BuildingStructureGet(ctx, detailMember)
8381
if err != nil {
8482
return err

cmd/foundation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ var foundationInterfaceListCmd = &cobra.Command{
182182
return *(rl[i].(*contractor.UtilitiesRealNetworkInterface).ID) < *(rl[j].(*contractor.UtilitiesRealNetworkInterface).ID)
183183
})
184184

185-
outputList(rl, []string{"Id", "Name", "Physical Location", "MAC", "Is Provisioning", "Network", "Link Name", "PXE", "Created", "Update"}, "{{.GetURI | extractID}} {{.Name}} {{.PhysicalLocation}} {{.Mac}} {{.IsProvisioning}} {{.Network | extractID}} {{.LinkName}} {{.Pxe| extractID}} {{.Created}} {{.Updated}}\n")
185+
outputList(rl, []string{"Id", "Name", "Physical Location", "MAC", "Is Provisioning", "Network", "Link Name", "PXE", "Created", "Update"}, "{{.GetURI | extractID}} {{.Name}} {{.PhysicalLocation}} {{.Mac}} {{.IsProvisioning}} {{.Network | extractID}} {{.LinkName}} {{or .Pxe \":<None>\" | extractID}} {{.Created}} {{.Updated}}\n")
186186

187187
return nil
188188
},

cmd/network.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,14 @@ var networkCreateCmd = &cobra.Command{
105105
Short: "Create New Network",
106106
RunE: func(cmd *cobra.Command, args []string) error {
107107
o := contractorClient.UtilitiesNetworkNew()
108-
o.Name = &detailName
109-
o.Mtu = &detailMTU
108+
109+
if detailName != "" {
110+
o.Name = &detailName
111+
}
112+
113+
if detailMTU != 0 {
114+
o.Mtu = &detailMTU
115+
}
110116

111117
ctx := cmd.Context()
112118

@@ -230,7 +236,9 @@ var networkAddressBlockCreateCmd = &cobra.Command{
230236

231237
o := contractorClient.UtilitiesNetworkAddressBlockNew()
232238
o.Network = cinp.StringAddr(r.GetURI())
233-
o.Vlan = &detailVlan
239+
if detailVlan != -1 {
240+
o.Vlan = &detailVlan
241+
}
234242

235243
if detailAddressBlock != 0 {
236244
r, err := contractorClient.UtilitiesAddressBlockGet(ctx, detailAddressBlock)
@@ -326,7 +334,7 @@ func init() {
326334
networkUpdateCmd.Flags().IntVarP(&detailMTU, "mtu", "m", 0, "Update the MTU of the Network with the value")
327335

328336
networkAddressBlockCreateCmd.Flags().IntVarP(&detailAddressBlock, "addressblock", "a", 0, "AddressBlock to Link to")
329-
networkAddressBlockCreateCmd.Flags().IntVarP(&detailVlan, "vlan", "v", 0, "VLan the Addressblock is tagged as")
337+
networkAddressBlockCreateCmd.Flags().IntVarP(&detailVlan, "vlan", "v", -1, "VLan the Addressblock is tagged as")
330338

331339
networkAddressBlockUpdateCmd.Flags().IntVarP(&detailVlan, "vlan", "v", -1, "VLan the Addressblock is tagged as")
332340

cmd/site.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var siteGetCmd = &cobra.Command{
7171
outputDetail(o, `Id: {{.GetURI | extractID}}
7272
Name: {{.Name}}
7373
Description: {{.Description}}
74-
Parent: {{.Parent | extractID}}
74+
Parent: {{or .Parent ":<None>:" | extractID}}
7575
Zone: {{.Zone | extractID}}
7676
Config Values: {{.ConfigValues}}
7777
Created: {{.Created}}
@@ -115,7 +115,7 @@ var siteCreateCmd = &cobra.Command{
115115
outputDetail(o, `Id: {{.GetURI | extractID}}
116116
Name: {{.Name}}
117117
Description: {{.Description}}
118-
Parent: {{.Parent | extractID}}
118+
Parent: {{or .Parent ":<None>:" | extractID}}
119119
Zone: {{.Zone | extractID}}
120120
Config Values: {{.ConfigValues}}
121121
Created: {{.Created}}
@@ -165,7 +165,7 @@ var siteUpdateCmd = &cobra.Command{
165165
outputDetail(o, `Id: {{.GetURI | extractID}}
166166
Name: {{.Name}}
167167
Description: {{.Description}}
168-
Parent: {{.Parent | extractID}}
168+
Parent: {{or .Parent ":<None>:" | extractID}}
169169
Zone: {{.Zone | extractID}}
170170
Config Values: {{.ConfigValues}}
171171
Created: {{.Created}}

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
contractorcli (0.18.1-1) noble; urgency=medium
2+
3+
* Added Plot
4+
5+
-- Peter Howe <pnhowe@gmail.com> Thu, 16 Oct 2025 12:14:03 -0600
6+
17
contractorcli (0.18.0-1) noble; urgency=medium
28

39
* Added LibVirtFoundation and Complex

0 commit comments

Comments
 (0)