diff --git a/api/go.mod b/api/go.mod index 946888ac..96a3452c 100644 --- a/api/go.mod +++ b/api/go.mod @@ -26,7 +26,7 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/itchyny/gojq v0.12.16 github.com/kr/pretty v0.3.1 - github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525 + github.com/margo/sandbox v1.0.0-rc.2.0.20260722140011-66d5b626db1d github.com/princjef/mageutil v1.0.0 go.opentelemetry.io/otel/trace v1.44.0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 diff --git a/api/go.sum b/api/go.sum index f15e8709..c6e73471 100644 --- a/api/go.sum +++ b/api/go.sum @@ -294,10 +294,10 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= -github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d h1:DXFdb1wuAd9pVcn3gALcBT6zrrrtzteyjVPfkyfFSus= -github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0= -github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525 h1:qpAeGMpxRc69lkgQH9pP4loVF+G5QJgP5E2rVFMRxmQ= -github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0= +github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67 h1:6iDtAEYq/ctgDx2GpaFN5KWCtMxXY2EySyPKGLs+7LQ= +github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0= +github.com/margo/sandbox v1.0.0-rc.2.0.20260722140011-66d5b626db1d h1:Sg218JELyvRaQIrv43M6ePc97Aupb14kX8f2wPmArKI= +github.com/margo/sandbox v1.0.0-rc.2.0.20260722140011-66d5b626db1d/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0= github.com/matryer/is v1.3.0 h1:9qiso3jaJrOe6qBRJRBt2Ldht05qDiFP9le0JOIhRSI= github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= diff --git a/cli/cmd/margo.go b/cli/cmd/margo.go index 3fe33360..1fda1959 100644 --- a/cli/cmd/margo.go +++ b/cli/cmd/margo.go @@ -12,6 +12,7 @@ import ( nbi "github.com/margo/sandbox/non-standard/generatedCode/wfm/nbi" margoCli "github.com/margo/sandbox/poc/wfm/cli" "github.com/spf13/cobra" + "strings" ) var ( @@ -558,7 +559,7 @@ func displayDevicesTable(resp nbi.DeviceListResp) { // Set headers t.AppendHeader(table.Row{ - "ID", "Signature", "Capabilities", "Roles", "State", "CreatedAt", + "ID", "Signature", "Capabilities", "Deployment Type", "State", "CreatedAt", }) // Add data rows @@ -567,25 +568,27 @@ func displayDevicesTable(resp nbi.DeviceListResp) { continue } - var roles interface{} - roles = []string{} + var deploymentTypes interface{} + deploymentTypes = []string{} capMap, exists := device.Spec.Capabilities.(map[string]interface{}) if exists { properties, exists := capMap["properties"].(map[string]interface{}) if exists { - roles, exists = properties["roles"] + deploymentTypes, exists = properties["supportedDeploymentTypes"] if !exists { - roles = []string{} + deploymentTypes = []string{} } } } + deploymentTypeStr := strings.Trim(fmt.Sprint(deploymentTypes), "[]") + cap, _ := json.Marshal(device.Spec.Capabilities) row := table.Row{ truncateString(*device.Id, 40), truncateString(device.Spec.Signature, 28), truncateString(string(cap), 28), - roles, + deploymentTypeStr, string(device.State.Onboard), formatTime(*device.Metadata.CreationTimestamp), } @@ -604,7 +607,7 @@ func displayDevicesTable(resp nbi.DeviceListResp) { {Number: 1, WidthMax: 40}, // ID {Number: 2, WidthMax: 28}, // Signature {Number: 3, WidthMax: 28}, // Capabilities - {Number: 4, WidthMax: 28}, // Device Role + {Number: 4, WidthMax: 28}, // Deployment Type {Number: 5, WidthMax: 12}, // State {Number: 6, WidthMax: 16}, // CreatedAt }) diff --git a/cli/go.mod b/cli/go.mod index 78065cb8..41ac044e 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -54,7 +54,7 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 github.com/eclipse-symphony/symphony/api v0.0.0-00010101000000-000000000000 github.com/ghodss/yaml v1.0.0 - github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525 + github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67 github.com/princjef/mageutil v1.0.0 ) diff --git a/cli/go.sum b/cli/go.sum index 9fbe6587..6ba16e43 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -55,10 +55,8 @@ github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNB github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/lestrrat-go/sfv v1.0.0 h1:+/VOs7lhUWAwNIklow4kPYlit0fPBC6HsF+GHKXrhGM= github.com/lestrrat-go/sfv v1.0.0/go.mod h1:wawOORrbzB4Vh0QT7WtbWEbMuTbjS8OPxum1wZAYCiQ= -github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d h1:DXFdb1wuAd9pVcn3gALcBT6zrrrtzteyjVPfkyfFSus= -github.com/margo/sandbox v0.0.2-0.20260629065027-6ceab8d33a5d/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0= -github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525 h1:qpAeGMpxRc69lkgQH9pP4loVF+G5QJgP5E2rVFMRxmQ= -github.com/margo/sandbox v0.0.2-0.20260713102004-e833d1626525/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0= +github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67 h1:6iDtAEYq/ctgDx2GpaFN5KWCtMxXY2EySyPKGLs+7LQ= +github.com/margo/sandbox v1.0.0-rc.2.0.20260717072648-226903403d67/go.mod h1:H2T/Otxoc7AyLqmRdzZQosbnl30j7tCM3JsTi5ULHf0= github.com/matryer/is v1.3.0 h1:9qiso3jaJrOe6qBRJRBt2Ldht05qDiFP9le0JOIhRSI= github.com/matryer/is v1.3.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=