Sha256: 1ce0e42f0ea9b26cc2bbbb9a84278d36aa8507eced083c21d3fc58068c3db9c2

Contents?: true

Size: 1.72 KB

Versions: 1

Compression:

Stored size: 1.72 KB

Contents

module CloudstackCli
  class Cli < Thor
    class_option :config
    class_option :verbose, type: :boolean

    desc "command COMMAND [arg1=val1 arg2=val2...]", "run a custom api command"
    def command(command, *args)
      client = CloudstackCli::Helper.new
      params = {'command' => command}
      args.each do |arg|
        arg = arg.split('=')
        params[arg[0]] = arg[1] 
      end
      puts JSON.pretty_generate(client.cs.send_request params)
    end
    
    desc "zone SUBCOMMAND ...ARGS", "manage zones"
    subcommand "zone", Zone

    desc "project SUBCOMMAND ...ARGS", "manage servers"
    subcommand "project", Project

    desc "server SUBCOMMAND ...ARGS", "manage servers"
    subcommand "server", Server

    desc "offering SUBCOMMAND ...ARGS", "manage offerings"
    subcommand "offering", Offering

    desc "network SUBCOMMAND ...ARGS", "manage networks"
    subcommand "network", Network

    desc "lb SUBCOMMAND ...ARGS", "manage load balancing rules"
    subcommand "lb", Lb

    desc "template SUBCOMMAND ...ARGS", "manage template"
    subcommand "template", Template

    desc "router SUBCOMMAND ...ARGS", "manage virtual routers"
    subcommand "router", Router

    desc "router SUBCOMMAND ...ARGS", "manage virtual routers"
    subcommand "router", Router

    desc "volume SUBCOMMAND ...ARGS", "manage volumes"
    subcommand "volume", Volume

    desc "stack SUBCOMMAND ...ARGS", "manage stacks"
    subcommand "stack", Stack

    desc "account SUBCOMMAND ...ARGS", "manage accounts"
    subcommand "account", Account

    desc "domain SUBCOMMAND ...ARGS", "manage domains"
    subcommand "domain", Domain

    desc "publicip SUBCOMMAND ...ARGS", "manage public ip addresses"
    subcommand "publicip", Publicip
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cloudstack-cli-0.0.1 lib/cloudstack-cli/cli.rb