Feature #8498

[SDKs] GoSDK arvadosclient parameters are more transparent

Added by Joshua Randall almost 3 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
SDKs
Target version:
Start date:
02/19/2016
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

Currently, one passes a generic 'arvadosclient.Dict' (actually a 'map[string]interface{}') to an API request in order to specify parameters of the request.

It would be nice if there was a more structured (and semantically meaningful) interface to set the parameters.

The sort of thing I would like to do would be to be able to take something currently written like this (example extracted from datamanager):

    fieldsWanted := []string{"manifest_text",
        "owner_uuid",
        "uuid",
        "redundancy",
        "modified_at"}

    sdkParams := arvadosclient.Dict{
        "select":  fieldsWanted,
        "order":   []string{"modified_at ASC"},
        "filters": [][]string{[]string{"modified_at", ">=", "1900-01-01T00:00:00Z"}}}

    sdkParams["filters"].([][]string)[0][2] = latestModificationDate.Format(time.RFC3339)

And instead write it rather more like:

    import arv "git.curoverse.com/arvados.git/sdk/go/arvadosclient" 
    listParams := arv.ListParams(
        arv.Select("manifest_text", "owner_uuid", "uuid", "redundancy", "modified_at"),
        arv.Order("modified_at ASC"),
        arv.Filters(arv.Filter{"modified_at", ">=", "1900-01-01T00:00:00Z"})
    )
    listParams.Filters[0].value = latestModificationDate.Format(time.RFC3339)

History

#1 Updated by Brett Smith almost 3 years ago

  • Subject changed from more transparent arvadosclient parameters (Go SDK) to [SDKs] GoSDK arvadosclient parameters are more transparent

#2 Updated by Brett Smith almost 3 years ago

  • Target version set to Arvados Future Sprints

Also available in: Atom PDF