func GetAssociatedObjectList(nsId string, resourceType string, resourceId string) ([]string, error) {

	var result []string

	err := common.CheckString(nsId)
	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}

	err = common.CheckString(resourceId)
	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}
	check, err := CheckResource(nsId, resourceType, resourceId)

	if !check {
		errString := "The " + resourceType + " " + resourceId + " does not exist."
		//mapA := map[string]string{"message": errString}
		//mapB, _ := json.Marshal(mapA)
		err := fmt.Errorf(errString)
		return nil, err
	}

	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}
	fmt.Println("[Get count] " + resourceType + ", " + resourceId)

	key := common.GenResourceKey(nsId, resourceType, resourceId)
	//fmt.Println(key)

	keyValue, err := common.CBStore.Get(key)
	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}
	if keyValue != nil {
		/*
			objList := gjson.Get(keyValue.Value, "associatedObjectList")
			objList.ForEach(func(key, value gjson.Result) bool {
				result = append(result, value.String())
				return true
			})
		*/

		/*
			switch resourceType {
			case common.StrImage:
				res := TbImageInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)
				//result = res.
			case common.StrSecurityGroup:
				res := TbSecurityGroupInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)

			case common.StrSpec:
				res := TbSpecInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)

			case common.StrSSHKey:
				res := TbSshKeyInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)
				result = res.AssociatedObjectList
			case common.StrVNet:
				res := TbVNetInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)

			}
		*/

		type stringList struct {
			AssociatedObjectList []string `json:"associatedObjectList"`
		}
		res := stringList{}
		err = json.Unmarshal([]byte(keyValue.Value), &res)
		if err != nil {
			common.CBLog.Error(err)
			return nil, err
		}
		result = res.AssociatedObjectList

		return result, nil
	}
	errString := "Cannot get " + resourceType + " " + resourceId + "."
	err = fmt.Errorf(errString)
	return nil, err
}
// GetAssociatedObjectList returns the list of MCIR's associated Tumblebug objects
GetAssociatedObjectList returns the list of MCIR's associated Tumblebug objects
// GetAssociatedObjectList returns the list of MCIR ' s associated Tumblebug objects
func GetAssociatedObjectList(nsId string, resourceType string, resourceId string) ([]string, error) {
	var result []string
	err := common.CheckString(nsId)
	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}
	err = common.CheckString(resourceId)
	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}
	check, err := CheckResource(nsId, resourceType, resourceId)
	if !check {
		errString := "The " + resourceType + " " + resourceId + " does not exist."
		err := fmt.Errorf(errString)
		return nil, err
	}
	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}
	fmt.Println("[Get count] " + resourceType + ", " + resourceId)
	key := common.GenResourceKey(nsId, resourceType, resourceId)
	keyValue, err := common.CBStore.Get(key)
	if err != nil {
		common.CBLog.Error(err)
		return nil, err
	}
	if keyValue != nil {
		type stringList struct {
			AssociatedObjectList []string `json:"associatedObjectList"`
		}
		res := stringList{}
		err = json.Unmarshal([]byte(keyValue.Value), &res)
		if err != nil {
			common.CBLog.Error(err)
			return nil, err
		}
		result = res.AssociatedObjectList
		return result, nil
	}
	errString := "Cannot get " + resourceType + " " + resourceId + "."
	err = fmt.Errorf(errString)
	return nil, err
}
func GetAssociatedObjectList ( nsId string , resourceType string , resourceId string ) ( [ ] string , error ) { var result [ ] string err := common . CheckString ( nsId ) if err != nil { common . CBLog . Error ( err ) return nil , err } err = common . CheckString ( resourceId ) if err != nil { common . CBLog . Error ( err ) return nil , err } check , err := CheckResource ( nsId , resourceType , resourceId ) if ! check { errString := " " + resourceType + " " + resourceId + " " err := fmt . Errorf ( errString ) return nil , err } if err != nil { common . CBLog . Error ( err ) return nil , err } fmt . Println ( " " + resourceType + " " + resourceId ) key := common . GenResourceKey ( nsId , resourceType , resourceId ) keyValue , err := common . CBStore . Get ( key ) if err != nil { common . CBLog . Error ( err ) return nil , err } if keyValue != nil { type stringList struct { AssociatedObjectList [ ] string `json:"associatedObjectList"` } res := stringList { } err = json . Unmarshal ( [ ] byte ( keyValue . Value ) , & res ) if err != nil { common . CBLog . Error ( err ) return nil , err } result = res . AssociatedObjectList return result , nil } errString := " " + resourceType + " " + resourceId + " " err = fmt . Errorf ( errString ) return nil , err }
GetAssociatedObjectList returns the list of MCIR's associated Tumblebug objects
GetAssociatedObjectList returns the list of MCIR ' s associated Tumblebug objects
//mapA := map[string]string{"message": errString} //mapB, _ := json.Marshal(mapA) //fmt.Println(key) /*
			objList := gjson.Get(keyValue.Value, "associatedObjectList")
			objList.ForEach(func(key, value gjson.Result) bool {
				result = append(result, value.String())
				return true
			})
		*/ /*
			switch resourceType {
			case common.StrImage:
				res := TbImageInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)
				//result = res.
			case common.StrSecurityGroup:
				res := TbSecurityGroupInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)

			case common.StrSpec:
				res := TbSpecInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)

			case common.StrSSHKey:
				res := TbSshKeyInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)
				result = res.AssociatedObjectList
			case common.StrVNet:
				res := TbVNetInfo{}
				json.Unmarshal([]byte(keyValue.Value), &res)

			}
		*/