Giter Site home page Giter Site logo

cdis-data-client's Introduction

gen3-client

Build Status GitHub release (latest SemVer)

gen3-client is a command-line tool for downloading, uploading, and submitting data files to and from a Gen3 data commons.

Read more about what it does and how to use it in the gen3-client user guide.

gen3-client is built on Cobra, a library providing a simple interface to create powerful modern CLI interfaces similar to git & go tools. Read more about Cobra here.

Installation

(The following instruction is for compiling and installing the gen3-client from source code. There are also binary executables can be found at here)

First, install Go and the Go tools if you have not already done so. Set up your workspace and your GOPATH.

Then:

go get -d github.com/uc-cdis/gen3-client
go install

TODO: Remove after GitHub repo is renamed For now, the above actually won't work because the GitHub repo needs to be renamed. Do this instead:

mkdir -p $GOPATH/src/github.com/uc-cdis
cd $GOPATH/src/github.com/uc-cdis
git clone [email protected]:uc-cdis/cdis-data-client.git
mv cdis-data-client gen3-client
cd gen3-client
go get -d ./...
go install .

Now you should have gen3-client successfully installed. For a comprehensive instruction on how to configure and use gen3-client for uploading / downloading object files, please refer to the gen3-client user guide.

Enabling New Gen3 Object Management API

Some Gen3 data commons support uploading files through the new Gen3 Object Management API.

NOTE: The service powering this API is sometimes referred to as our object "Shepherd"

To enable gen3-client to upload using the Gen3 Object Management API, pass the use-shepherd=true to gen3-client configure, e.g.:

$ gen3-client configure --profile=myprofile --cred=/path/to/cred --apiendpoint=https://example.com --use-shepherd=true

If this flag is set, the gen3-client will attempt to use the Gen3 Object Management API to upload files, falling back to Fence/Indexd in case of failure.

You may also need to configure the version of the Gen3 Object Management API that the client will interact with. This is set to a default of Gen3 Object Management API v2.0.0, but can be raised or lowered by passing the min-shepherd-version flag to gen3-client configure, e.g.:

$ gen3-client configure --profile=myprofile --cred=/path/to/cred --apiendpoint=https://example.com --use-shepherd=true --min-shepherd-version=1.3.0

Uploading Additional File Object Metadata to Gen3 Object Management API

The Gen3 Object Management API supports uploading additional public access file object metadata when uploading data files.

WARNING: Additional File Object Metadata is exposed publically and thus should not be controlled/sensitive data

You can upload file metadata using the gen3-client upload command with the --metadata flag. E.g.:

gen3-client upload --profile=my-profile --upload-path=/path/to/myfile.bam --metadata

This will tell gen3-client to look for a metadata file myfile_metadata.json in the same folder as myfile.bam. A metadata file should be located in the same folder as the file to be uploaded, and should be named [filename]_metadata.json.

The metadata file should be a JSON file in the format:

{
    "authz": ["/example/authz/resource"],
    "aliases": ["example_alias"],
    "metadata": {
        "any": {
            "arbitrary": ["json", "metadata"]
        }
    }
}

The aliases and metadata properties are optional. Some Gen3 data commons require the authz property to be specified in order to upload a data file.

If you do not know what authz to use, you can look at your Profile tab or /identity page of the Gen3 data commons you are uploading to. You will see a list of authz resources in the format /example/authz/resource: these are the authz resources you have access to.

cdis-data-client's People

Contributors

mfshao avatar giangbui avatar zflamig avatar ronaldhshi avatar philloooo avatar thanh-nguyen-dang avatar binamb avatar haraprasadj avatar lbeckman314 avatar avantol13 avatar bwalsh avatar paulineribeyre avatar rnerella92 avatar mpingram avatar m0nhawk avatar atharvar28 avatar bedfordwest avatar rgschmitz1 avatar cterrazas2 avatar themarcelor avatar michaellukowski avatar nss10 avatar vpsx avatar vzpgb avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.