文档首页 > > Python SDK参考> 常见问题> 如何运行SDK安装包中的示例代码

如何运行SDK安装包中的示例代码

分享
更新时间: 2019/07/31 11:23
  1. 参考快速开始部分安装SDK。
  2. vi编辑gcs.conf, 配置IAM Endpoint和GCS Endpoint,配置认证信息。

    [endpoint]
    iam_endpoint = "*** Provide IAM endpoint, such as 'iam.cn-north-1.myhuaweicloud.com' ***"
    gcs_endpoint = "*** Provide GCS endpoint, such as 'gcs.cn-north-1.myhuaweicloud.com' ***"
    # AKSK Authentication, Recommended practice
    [AKSK]
    ak = "*** Provide your Access Key ID ***"
    sk = "*** Provide your Secret Access Key ***"
    region = "*** Provide region ****"
    project_name = "*** Provide your project name ***"
    # username Authentication
    [user]
    username = "*** Provide your username ***" 
    password = "*** Provide your password ***"
    domain_name = "*** Provide your domain name ***"
    project_name = "*** Provide your project name ***"

  3. 查看cli功能

    $python gcs_cli.py
    
    Usage:       gcs_cli.py 
                 gcs_cli.py build-config
                 gcs_cli.py create-execution
                 gcs_cli.py create-workflow
                 gcs_cli.py delete-execution
                 gcs_cli.py delete-workflow
                 gcs_cli.py download-workflow
                 gcs_cli.py gcs
                 gcs_cli.py get-environment
                 gcs_cli.py get-environments
                 gcs_cli.py get-execution
                 gcs_cli.py get-execution-events
                 gcs_cli.py get-execution-inputs
                 gcs_cli.py get-execution-outputs
                 gcs_cli.py get-executions
                 gcs_cli.py get-tool
                 gcs_cli.py get-tools
                 gcs_cli.py get-workflow
                 gcs_cli.py get-workflow-inputs
                 gcs_cli.py get-workflow-tools
                 gcs_cli.py get-workflows
                 gcs_cli.py preview-execution
                 gcs_cli.py update-workflow

  4. 执行功能,例如查看环境信息列表

    $python gcs_cli.py get-workflows
    {
      "workflow": [
        {
          "id": "f4b97571-ffd0-1f35-9104-aad3714b968e",
          "name": "sdfsdfsdfdsf",
          "description": "",
          "vendor": "w00369910",
          "scope": "domain",
          "domain": "w00369910",
          "domain_id": "bf8441478cb64f40a6b56c4395d0b3e5",
          "project_id": "30a8c4d564864b818a9c45a87c3a854a",
          "create_at": "2018-10-22T14:45:33Z",
          "update_at": "2018-10-22T14:45:33Z",
          "workflow_url": "https://geneworkflows-myhwclouds-bf8441478cb64f40a6b56c4395d0b3e5.obs.myhwclouds.com:443/sdfsdfsdfdsf/test-workflow.yaml",
          "logo": ""
        },
        {
          "id": "02b133de-7d46-46c7-4761-730b1eec8efe",
          "name": "gatk4-best-practices-recommend",
          "description": "GATK 4.0正式版,Broad Institute 官方最佳实践流程,用于全基因组测序比对、去重、碱基校正以及突变检测",
          "vendor": "基因容器团队",
          "scope": "public",
          "domain": "op_svc_gcs_container",
          "domain_id": "e412ccc945e74b0299764d0f70ec4220",
          "project_id": "d409545c036f4cd3b377338f81b68282",
          "create_at": "2018-08-29T08:21:56Z",
          "update_at": "2018-08-29T08:21:56Z",
          "workflow_url": "https://geneworkflows-149-e412ccc945e74b0299764d0f70ec4220.192.149.46.200:443/gatk4-best-practices-recommend/gatk4-pipeline-4.0.4.0-gene-workflow.yaml",
          "logo": ""
        }
      ],
      "total_num": 2
    }

分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

跳转到云社区