Closed chiefMarlin closed 2 months ago
Hey @chiefMarlin,
We utilize a lot of the Go API in our CLI and tests. You can perform a' grep' search to find occurrences of the API you're interested in.
You can find the CLI code at: AIStore CLI
For example, to locate all uses of the GetBucketInfo
API, you can run the following command:
/go/src/github.com/NVIDIA/aistore$ git grep GetBucketInfo
ais/proxy.go:// with additional preparsing step to support api.GetBucketInfo prefix (as in: ais ls --summary)
ais/prxbsumm.go:// - bsummhead <= api.GetBucketInfo(bck, QparamBinfoWithOrWithoutRemote)
ais/test/bucket_test.go:func TestGetBucketInfo(t *testing.T) {
ais/test/bucket_test.go: _, _, _, err := api.GetBucketInfo(baseParams, bck, &api.BinfoArgs{FltPresence: apc.FltPresent})
ais/test/bucket_test.go: xid, props, info, err := api.GetBucketInfo(baseParams, bck, &args)
ais/test/bucket_test.go: // undo the side effect of calling api.GetBucketInfo
ais/test/bucket_test.go: _, _, _, err := api.GetBucketInfo(baseParams, bck, &api.BinfoArgs{FltPresence: apc.FltPresent})
api/apc/query.go: // (api.GetBucketInfo)
api/apc/query.go: // NOTE: non-empty value indicates api.GetBucketInfo; "true" value further requires "with remote obj-s"
api/bsumm.go:// - is obtained via GetBucketInfo() API
api/bsumm.go:func GetBucketInfo(bp BaseParams, bck cmn.Bck, args *BinfoArgs) (string, *cmn.Bprops, *cmn.BsummResult, error) {
cmd/cli/cli/ls.go: xid, props, info, err := api.GetBucketInfo(apiBP, bck, &args)
Hi @chiefMarlin ,
For real examples, you can also explore the test cases in the ais/test directory, which contain numerous example use cases and expected outcomes for each API.
ais/tests Thats perfect! Thanks guys
Hi, Are there any examples/go tests or guides on how to use the Go API ?
Thanks in advance