Implement CLI for python-savannaclient

Registered by Sergey Lukjanov

Requirements -
 . MUST accept --os-username/env[OS_USERNAME] & --os-password/env[OS_PASSWORD] & --os-tenant-name/env[OS_TENANT_NAME] & --os-auth-url/env[OS_AUTH_URL] for authentication
 . MUST accept --service-type & --endpoint-type and perform keystone catalog lookup

 -> GET /v1.0/{tenant_id}/plugins
plugin-show --name <plugin> [--version <version>]
 -> GET /v1.0/{tenant_id}/plugins/{plugin_name}[/{version}]

==Image Registry==
image-list [--tag <tag>]*
 -> GET /v1.0/{tenant_id}/images[?tags=tag]*
image-show --name <image>|--id <image_id>
 -> GET /v1.0/{tenant_id}/images/{image_id}
image-register --name <image>|--id <image_id> [--username <name>] [--description <desc>]
 -> POST /v1.0/{tenant_id}/images
image-unregister --name <image>|--id <image_id>
 -> DELETE /v1.0/{tenant_id}/images/{image_id}
image-add-tag --name <image>|--id <image_id> --tag <tag>+
 -> POST /v1.0/{tenant_id}/images/{image_id}/tag
image-remove-tag --name <image>|--id <image_id> --tag <tag>+
 -> POST /v1.0/{tenant_id}/images/{image_id}/untag

==Node Group Templates==
 -> GET /v1.0/{tenant_id}/node-group-templates
node-group-template-show --name <node_group_template>|--id <node_group_template_id> [--json]
 -> GET /v1.0/{tenant_id}/node-group-templates/{node_group_template_id}
node-group-template-create [--json <file>]
node-group-template-delete --name <node_group>|--id <node_group_template_id>
 -> DELETE /v1.0/{tenant_id}/node-group-templates/<node_group_template_id>

==Cluster Templates==
 -> GET /v1.0/{tenant_id}/cluster-templates
cluster-template-show --name <cluster_template>|--id <cluster_template_id> [--json]
 -> GET /v1.0/{tenant_id}/cluster-templates/{cluster_template_id}
cluster-template-create [--json <file>]
cluster-template-delete --name <cluster>|--id <cluster_template_id>
 -> DELETED /v1.0/{tenant_id}/cluster-templates/{cluster_template_id}

 -> GET /v1.0/{tenant_id}/clusters
cluster-show --name <cluster>|--id <cluster_id> [--json]
 -> GET /v1.0/{tenant_id}/clusters/{cluster_id}
cluster-create [--json <file>]
 * two operations, resize and add
 * resize existing group w/ new size
 * add new group
cluster-delete --name <cluster>|--id <cluster_id>
 -> DELETE /v1.0/{tenant_id}/clusters/{cluster_id}

==Data Sources==
-> GET /data-sources
data-source-show --name <name>|--id <id>
-> GET /data-sources/{id}
data-source-create --name <name> --type <type> --url <url> [--user <user> --password <password>] [--description <desc>]
NB: user & password if type is swift
-> POST /data-sources
data-source-delete --name <name>|--id <id>
-> DELETE /data-sources/{id}

==Job Binary Internals==
-> GET /job-binary-internals
job-binary-data-show -- skip
job-binary-data-create [--file <file>]
NB: name param is required
-> PUT_FILE /job-binary-internals
job-binary-data-delete --id <id>
-> DELETE /job-binary-internals/{id}

==Job Binaries==
-> GET /job-binaries
job-binary-show --name <name>|--id <id>
-> GET /job-binaries/{id}
job-binary-create --name <name> --url <url> [--user <user> --password <password>] [--description <desc>]
NB: user & password if url proto is swift-internal
NB: param for credentials should be "credentials" (like data-source) not "extra"
-> POST /job-binaries
job-binary-delete --name <name>|--id <id>
-> DELETE /job-binaries/{id}

-> GET /jobs
job-template-show --name <name>|--id <id>
-> GET /jobs/{id}
job-template-create --name <name> --type <Pig|Hive|MapReduce|Java> --mains <array of string> --libs <array of string>
-> POST /jobs
job-template-delete --name <name>|--id <id>
-> DELETE /jobs/{id}

==Job Executions==
-> GET /job-executions
job-show --id <id>
-> GET /job-executions/{id}
job-create --job-template <id> --cluster <id> --input-data <id> --output-data <id> [--param <name=value>] [--arg <arg>] [--config <name=value>]
-> POST /jobs/{job_template_id}/execute
job-update -- skip
job-delete --id <id>
-> DELETE /job-executions/{id}

 . Do we provide a 'run' command that can create a template, create a job, wait for completion? -> bp cli-edp-run-cmd
 . Given the complexity of the templates, we likely want a way to dump/load them. 9 Jan 2014 meeting, this was agreed.
 . Consistency says to use -delete instead of -destroy. Agreed in 9 Jan 2014 meeting.
 . All the cmd roots be singular (plugin-list over plugins-list)
 . -I'm flexible on dash vs space, i.e. images-list vs images list- Not flexible on this anymore, dash is the way forward
 . We should enable tab completion instead of providing short arguments -> bp cli-tab-completion
 . Typo in rest_api_v1.0 3.4 should not have {image_id}? No, the image_id is a param passed via url instead of data.
 . Why does Cluster template create need node group name and id? ->
 . Can POST cluster-templates really take a node-group-template spec? If so, I'm don't think we should expose that functionality in the CLI.
 . Can POST clusters really take a full cluster-template spec? If so, I'm don't think we should expose that functionality in the CLI.
 . We have complexity in the node-group-template name w/i the cluster-template, might not match

Blueprint information

Sergey Lukjanov
Matthew Farrellee
Matthew Farrellee
Series goal:
Accepted for 0.5.x
Milestone target:
milestone icon 0.5.0
Started by
Matthew Farrellee
Completed by
Matthew Farrellee

Related branches



Gerrit topic:,topic:bp/python-savannaclient-cli,n,z

Addressed by:
    Add initial Savanna CLI

Addressed by:
    Add initial image-* commands to CLI

Addressed by:
    Add initial cluster-* commands to CLI

Addressed by:
    Add initial node-group-template-* commands to CLI

Addressed by:
    Add initial cluster-template-* commands to CLI

Addressed by:
    Make plugin commands singular

Addressed by:
    Add node-group-template-show command to CLI

Addressed by:
    Add cluster-template-show command to CLI

Addressed by:
    Refactor display of node group template

Addressed by:
    Refactor display of cluster template

Addressed by:
    Refactor display of cluster

Addressed by:
    Add --json option to node-group-template-show

Addressed by:
    Add --json option to cluster-template-show

Addressed by:
    Add --json option to cluster-show

Addressed by:
    Add node-group-template-create to CLI

Addressed by:
    Add cluster-template-create to CLI

Addressed by:
    Add cluster-create to CLI

Addressed by:
    Add data-source-list to CLI

Addressed by:
    Add data-source-show to CLI

Addressed by:
    Add data-source-delete to CLI

Addressed by:
    Add job-binary-data-list to CLI

Addressed by:
    Add job-binary-data-delete to CLI

Addressed by:
    Add job-binary-list to CLI

Addressed by:
    Add job-binary-show to CLI

Addressed by:
    Add job-binary-delete to CLI

Addressed by:
    Add job-template-list to CLI

Addressed by:
    Add job-template-show to CLI

Addressed by:
    Add job-template-delete to CLI

Addressed by:
    Add job-list to CLI

Addressed by:
    Add job-show to CLI

Addressed by:
    Add job-delete to CLI

Addressed by:
    Refactor display of job-binary-data elements

Addressed by:
    Add job-binary-data-create to CLI

Addressed by:
    Refactor display of a single data-source

Addressed by:
    Add data-source-create to CLI

Gerrit topic:,topic:bug/1272130,n,z

Addressed by:
    Refactor display of a job binary

Addressed by:
    Add job-binary-create to CLI

Addressed by:
    Add job-create to CLI


Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.