Skip to content

ygnmi.Update fails when updating string leaf with string value #159

@zhang-guodong

Description

@zhang-guodong

I'm trying to use ygnmi.Update to update a string leaf in the configuration, like this:

path := exampleocpath.Root().Parent().Child().Config().One()
_, err := ygnmi.Update(context.Background(), c.client, path.ConfigQuery, "10")

However, the gNMI server returns the following error:

Update(t) at path origin:"openconfig" elem:{name:"parent"} elem:{name:"child"} elem:{name:"config"} elem:{name:"one"}: rpc error: code = Internal desc = error in creating config struct from IETF JSON data: got map[string]interface {} type for field one, expect string

Questions:

  • Is this the correct way to update a string leaf using ygnmi.Update?
  • Am I missing a required step or configuration?

Any guidance would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions