Commit be428c87 authored by Yann Garcia's avatar Yann Garcia
Browse files

Finalyze MEC-016 support; Cleanup logs

parent 38f37623
Loading
Loading
Loading
Loading
+61 −0
Original line number Diff line number Diff line
{
    "appList":
        [
            {
                "appInfoList":
                    [
                        {
                            "appDId": "appDId1",
                            "appName": "appName1",
                            "appProvider": "appProvider1",
                            "appSoftVersion": "appSoftVersion1",
                            "appDVersion": "appDVersion1",
                            "appDescription": "appDescription1",
                            "appLocation":
                                [
                                    {
                                        "area":
                                            {
                                                "coordinates":
                                                    [
                                                        [
                                                            [7.43166,43.736156],[7.431723,43.736115],[7.431162,43.735607],[7.430685,43.73518]
                                                        ]
                                                    ]
                                            },
                                        "countryCode": "countryCode1"
                                    },
                                    {
                                        "civicAddressElement": 
                                            [
                                                {
                                                    "caType": 2,
                                                    "caValue": "Value2"
                                                },
                                                {
                                                    "caType": 20,
                                                    "caValue": "Value20"
                                                }
                                            ]
                                    }
                                ],
                            "appCharcs":
                                [
                                    {
                                        "memory": 2048,
                                        "storage": 2048,
                                        "latency": 2048,
                                        "bandwidth": 2048,
                                        "serviceCont": 1
                                    }
                                ],
                            "cmd": "uptime",
                            "args":null
                        }
                    ],
                    "vendorSpecificExt": {
                        "vendorId": "vendorId1"
                    }
            }
        ]
}
+62 −0
Original line number Diff line number Diff line
{
    "appList":
        [
            {
                "appInfoList":
                    [
                        {
                            "appDId": "onboarded-demo4",
                            "appName": "onboarded-demo4",
                            "appProvider": "ETSI",
                            "appSoftVersion": "v0.1.0",
                            "appDVersion": "v0.1.0",
                            "appDescription": "Basic HTTP Ping Pong",
                            "appLocation":
                                [
                                    {
                                        "area":
                                            {
                                                "coordinates":
                                                    [
                                                        [
                                                            [7.420433,43.729942],[7.420659,43.73036],[7.420621,43.731045],[7.420922,43.73129]
                                                        ],
                                                        [
                                                            [7.43166,43.736156],[7.431723,43.736115],[7.431162,43.735607],[7.430685,43.73518]
                                                        ]
                                                    ]
                                            },
                                        "civicAddressElement": 
                                            [
                                                {
                                                    "caType": 1,
                                                    "caValue": "A1"
                                                },
                                                {
                                                    "caType": 2,
                                                    "caValue": "A2"
                                                }
                                            ],
                                        "countryCode": "492"
                                    }
                                ],
                            "appCharcs":
                                [
                                    {
                                        "memory": 1024,
                                        "storage": 1024,
                                        "latency": 1024,
                                        "bandwidth": 1024,
                                        "serviceCont": 0
                                    }
                                ],
                            "cmd": "/onboardedapp/onboarded-demo/onboarded-demo4",
                            "args":null
                        }
                    ],
                    "vendorSpecificExt": {
                        "vendorId": "ETSI"
                    }
            }
        ]
}
+21 −23
Original line number Diff line number Diff line
@@ -1327,8 +1327,6 @@ func validateApplicationList(appInfoListEntry *ApplicationList, appInfoList Appl
}

func validateAppContext(appContextEntry *AppContext, appContext AppContext) bool {
	log.Debug(">>> validateAppContext: appContextEntry: ", appContextEntry)
	log.Debug(">>> validateAppContext: appContext: ", appContext)

	if appContextEntry == nil {
		fmt.Println("appContextEntry == nil")
+4 −4
Original line number Diff line number Diff line
@@ -40,9 +40,9 @@ var cbCmd = &cobra.Command{

// Create and start a container
func DockerRun(image string, port string, timeout time.Duration) (dockerId string, out string, err error) {
	log.Debug(">>> DockerRun: port: ", port)
	log.Debug(">>> DockerRun: image: ", image)
	log.Debug(">>> DockerRun: timeout: ", timeout)
	// log.Debug(">>> DockerRun: port: ", port)
	// log.Debug(">>> DockerRun: image: ", image)
	// log.Debug(">>> DockerRun: timeout: ", timeout)

	// Sanity checks
	if image == "" {
@@ -84,7 +84,7 @@ func DockerRun(image string, port string, timeout time.Duration) (dockerId strin

// Create and start a container
func DockerTerminate(dockerId string, timeout time.Duration) (out string, err error) {
	log.Debug(">>> DockerTerminate: ", dockerId)
	//log.Debug(">>> DockerTerminate: ", dockerId)

	// Sanity checks
	if dockerId == "" {
+3 −4
Original line number Diff line number Diff line
@@ -29,12 +29,11 @@ import (
)

func cmdExec(cli string) (appExecEntry AppExecEntry, err error) {
	fmt.Println(">>> cmdExec: ", cli)
	parts := strings.Fields(cli)
	head := parts[0]
	parts = parts[1:]
	fmt.Println("cmdExec: head: ", head)
	fmt.Println("cmdExec: parts: ", parts)
	// fmt.Println("cmdExec: head: ", head)
	// fmt.Println("cmdExec: parts: ", parts)

	appExecEntry.cmd = exec.Command(head, parts...)
	appExecEntry.stdout = new(bytes.Buffer)
Loading