Module: EPC::Help

Included in:
Runner
Defined in:
lib/epc/help.rb

Constant Summary collapse

COMMAND_USAGES =
{
  :info                       => 'epc info',
  :target                     => 'epc target <url>',
  :login                      => 'epc login <email> [--passwd PASS]',
  :list_solutions             => 'epc list solutions [--archived]',
  :create_solution            => 'epc create solution <name>',
  :show_solution              => 'epc show Solution:solution_identifier',
  :update_solution            => 'epc update Solution:solution_identifier name=value',
  :delete_solution            => 'epc delete solution SOLUTION',
  :archive_solution           => 'epc archive Solution:solution_identifier',
  :unarchive_solution         => 'epc unarchive Solution:solution_identifier',
  :refresh_solution           => 'epc refresh solution [SOLUTION]',
  :list_projects              => 'epc list projects [Solution:solution_id] [--archived]',
  :create_project             => 'epc create project <name> [uri-name] <--type PROJECT_TYPE> <--memory MEMORY>',
  :show_project               => 'epc show Project:project_identifier',
  :update_project             => 'epc update Project:project_identifier <attribute=value>',
  :delete_project             => 'epc delete Project:project_identifier [--force]',
  :attach_runtime             => 'epc attach runtime <runtime_id> [-p PROJECT] [--stage STAGE]',
  :list_servicetypes          => 'epc list service-types', 
  :create_servicedefinition   => 'epc create ServiceDefinition ServiceType:service_type_identifier <service_name>', 
  :delete_servicedefinition   => 'epc delete ServiceDefinition:service_definition_identifier', 
  :list_servicedefinitions    => 'epc list ServiceDefinitions',
  :create_serviceversion      => 'epc create ServiceVersion <ServiceDefinition:service_definition_identifier> <label> [--up-script file] [--down-script file]',
  :list_serviceversions       => 'epc list ServiceVersions',
  :delete_serviceversion      => 'epc delete ServiceVersion:service_version_identifier',
  :create_user                => 'epc create user <email> [--name NAME]',
  :push                       => 'epc push [Solution:solution_name Project:project_name] [--note NOTE] [--timeout value | --nopoll] [--direct-deploy file]',
  :pull                       => 'epc pull [SOLUTION]',
  :build                      => 'epc build [project_name=version] [--note NOTE] [--timeout value | --nopoll]',
  :list_deploymentstages      => 'epc list stages',
  :create_deployment          => 'epc create Deployment Solution:solution_identifier <stage name: development|testing|staging|production> [-p project_id:version:instances:runtime_memory] [--replaces deployment_id]',
  :show_deployment            => 'epc show Deployment:deployment_identifier',
  :submit_deployment          => 'epc submit Deployment:deployment_identifier',
  :list_deployments           => 'epc list deployments [<Solution:solution_id> | <DeploymentStage:deployment_stage_id> | <User:user_id>]',
  :copy_deployment            => 'epc copy deployment <DEPLOYMENT_ID> <STAGE>',
  :approve_deployment         => 'epc approve Deployment:deployment_identifier',
  :deny_deployment            => 'epc deny Deployment:deployment_identifier',
  :create_library             => 'epc create Library <name> <language> <version> <group> [-f file] [--scope runtime | compile | provided | test]',
  :list_libraries             => 'epc list Libraries',
  :delete_library             => 'epc delete Library:library_identifier',
  :attach_library             => 'epc attach library [-s SOLUTION] [-p PROJECT] <name> <version> <group> [-f FILE] [--pom POM FILE]',
  :detach_library             => 'epc detach library [-s SOLUTION] [-p PROJECT] <LIBRARY>',
  :deploy                     => 'epc deploy [stage] [-d DEPLOYMENT_ID] [--timeout value | --nopoll]',
  :undeploy                   => 'epc undeploy [-s SOLUTION] <DEPLOYMENT_ID>',
  :list_approvals             => 'epc list approvals <DEPLOYMENT_ID>',
  :renew                      => 'epc renew',
  :logout                     => 'epc logout',
  :create_config              => 'epc create config <TargetType:TargetId> [--required] [--no_override] [--value-type TYPE] name=value',
  :list_configs               => 'epc list config <TargetType:TargetType>',
  :delete_config              => 'epc delete Config:key_identifier <TargetType:TargetId>',
  :list_projecttypes          => 'epc list project-types',
  :show_projecttype           => 'epc show ProjectType:project_type_identifier',
  :update_deployment          => 'epc update Deployment:deployment_identifier Project:project_identifier [--instances instance_count] [--uris comma_separated_uris]',
  :update_config              => 'epc update Config:config_identifier TargetType:TargetId [--required] [--no_override] name=value',
  :archive_project            => 'epc archive Project:project_identifier',
  :unarchive_project          => 'epc unarchive Project:project_identifier',
  :list_attachedlibraries     => 'epc list attached-libraries [-s SOLUTION] [PROJECT] [--json]',
  :create_group               => 'epc create group <name>',
  :delete_group               => 'epc delete group <GROUP>',
  :list_groups                => 'epc list groups',
  :update_group               => 'epc update Group:group_identifier:group_identifier [--add-user USER_ID] [--remove-user USER_ID]',
  :show_group                 => 'epc show Group:group_identifier',
  :list_roles                 => 'epc list roles [User:user_id]',
  :list_objectroles           => 'epc list ObjectRoles <ObjectType:ObjectId>',
  :delete_role                => 'epc delete Role',
  :update_role                => 'epc update Role:role_identifier [--add-user USER_ID] [--remove-user USER_ID] [--add-grant ObjectType:action:ObjectId] [--remove-grant ObjectType:action:ObjectId> [--file json]',
  :update_objectrole          => 'epc update ObjectRole:ObjectType:ObjectID:role_identifier [--add-user USER_ID] [--remove-user USER_ID] [--add-grant ObjectType:action:ObjectId] [--remove-grant ObjectType:action:ObjectId> [--file json]',
  :create_role                => 'epc create Role <name> [--file json]',
  :create_objectrole          => 'epc create Objectrole <ObjectType:ObjectId> <name>',
  :show_role                  => 'epc show Role:role_identifier [users|groups|grants]',
  :list_users                 => 'epc list users',
  :delete_user                => 'epc delete User:user_identifier',
  :show_user                  => 'epc show User:user_identifier',
  :create_librarylanguage     => 'epc create LibraryLanguage <name>',
  :list_librarylanguages      => 'epc list LibraryLanguages',
  :delete_librarylanguage     => 'epc delete LibraryLanguage:language_identifier',
  :update_librarylanguage     => 'epc update LibraryLanguage:language_identifier <new-name>',
  :create_libraryset          => 'epc create LibrarySet <name> <language> [--file file]',
  :show_libraryset            => 'epc show LibrarySet:libraryset_identifier [--json]',
  :list_librarysets           => 'epc list LibrarySets',
  :update_libraryset          => 'epc update LibrarySet:library-set_identifier [--add-library id|name:version:group] [--remove-library id|name:version:group] [--file file]',
  :delete_libraryset          => 'epc delete LibrarySet:library_set_identifier [-y]',
  :request_passwordchange     => 'epc request password-change <email>',
  :update_user                => 'epc update User:user_identifier [--passwd password] [--token token] [--email new_email] [--name new_name]',
  :list_metrics               => 'epc list metrics [--target target]',
  :show_metrics               => 'epc show metrics <id> <metric list> [--start start] [--stop stop] [--step step] [--graph]',
  :show_instances             => 'epc show instances <deployed-project-id>',
  :list_permissions           => 'epc list Permissions',
  :list_permissiongroups      => 'epc list PermissionGroups',
  :list_objecttypes           => 'epc list ObjectTypes',
  :create_plugin              => 'epc create plugin <name> <version> <group> [--inherited] [--extensions] [--executions executions|file:path_to_executions_file] [--configuration configuration|file:path_to_configuration_file]',
  :show_plugin                => 'epc show Plugin:Name:Version:Group',
  :list_plugins               => 'epc list plugins',
  :update_plugin              => 'epc update Plugin:Name:Version:Group attribute=new value',
  :attachto_project           => 'epc attach-to Project:project_identifier [Library|LibrarySet|ServiceVersion|Dependency]:[library_identifier|library_set_identifier|service_version_identifier|dependency_identifier]',
  :detachfrom_project         => 'epc detach-from Project:project_identifier [Library|LibrarySet|ServiceVersion|Dependency]:[library_identifier|library_set_identifier|service_version_identifier|dependency_identifier]',
  :list_runtimetypes          => 'epc list RuntimeTypes',
  :create_runtime             => 'epc create Runtime RuntimeType:runtime_type_identifier name target deployment_stage username password [--agility-topology id] [--agility-environment id]',
  :update_runtime             => 'epc update Runtime:runtime_identifier attribute=new_value',
  :delete_runtime             => 'epc delete Runtime:runtime_identifier',
  :create_projecttype         => 'epc create ProjectType name runtime framework build-type build-packaging deployable runtime-env-types',
  :delete_projecttype         => 'epc delete ProjectType:project_type_identifier',
  :update_projecttype         => 'epc update ProjectType:project_type_identifier attribute=value',
  :snapshot                   => 'epc snapshot project_id:project_version',
  :set_userproperty           => 'epc set UserProperty [name=value] [--file FILE]',
  :list_userproperties        => 'epc list UserProperties',
  :get_userproperty           => 'epc get UserProperty[:property] [--all] [--file FILE]',
  :delete_userproperty        => 'epc delete UserProperty[:property] [--all] [-y]'
}

Instance Method Summary collapse

Instance Method Details

#display_command_usage(*commands) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/epc/help.rb', line 122

def display_command_usage(*commands)
  if commands.empty?
    say verbose_usage
    return
  end
  key = commands.join('_').gsub("-", "").downcase.to_sym
  if COMMAND_USAGES.keys.include?(key)
    say("Usage: #{COMMAND_USAGES[key]}")
  else
    say("No such command: #{commands.join(' ')}")
  end      
end

#display_usageObject



113
114
115
116
# File 'lib/epc/help.rb', line 113

def display_usage
  say(usage)
  exit
end

#display_verbose_usageObject



118
119
120
# File 'lib/epc/help.rb', line 118

def display_verbose_usage
  say(verbose_usage)
end