Module: Morpheus::Cli
- Defined in:
- lib/morpheus/cli.rb,
lib/morpheus/cli/version.rb,
lib/morpheus/cli/cli_command.rb,
lib/morpheus/cli/credentials.rb,
lib/morpheus/cli/cli_registry.rb,
lib/morpheus/cli/option_types.rb,
lib/morpheus/cli/option_parser.rb
Defined Under Namespace
Modules: AccountsHelper, CliCommand, ExpressionParser, InfrastructureHelper, LibraryHelper, MonitoringHelper, OptionTypes, PrintHelper, ProcessesHelper, ProvisioningHelper, WhoamiHelper Classes: AccountGroupsCommand, Accounts, AliasCommand, AppTemplates, Apps, ArchivesCommand, BlueprintsCommand, BootScriptsCommand, CliRegistry, CloudDatastoresCommand, Clouds, ColoringCommand, CommandError, ContainersCommand, Credentials, CurlCommand, CypherCommand, DashboardCommand, Deployments, Deploys, DotFile, Echo, EditProfileCommand, EditRcCommand, ErrorHandler, ExecuteSchedulesCommand, ExecutionRequestCommand, ExitCommand, FileCopyRequestCommand, Groups, Hosts, ImageBuilderCommand, InstanceTypes, Instances, KeyPairs, LibraryContainerScriptsCommand, LibraryContainerTemplatesCommand, LibraryContainerTypesCommand, LibraryInstanceTypesCommand, LibraryLayoutsCommand, LibraryOptionListsCommand, LibraryOptionTypesCommand, LibraryPackagesCommand, LibraryUpgradesCommand, License, LoadBalancers, LogLevelCommand, Login, Logout, ManCommand, MonitoringAppsCommand, MonitoringChecksCommand, MonitoringContactsCommand, MonitoringGroupsCommand, MonitoringIncidentsCommand, NetworkDomainsCommand, NetworkGroupsCommand, NetworkPoolServersCommand, NetworkPoolsCommand, NetworkProxiesCommand, NetworkServicesCommand, NetworksCommand, OptionParser, PoliciesCommand, PowerSchedulesCommand, PreseedScriptsCommand, Processes, RecentActivityCommand, Remote, Roles, SecurityGroupRules, SecurityGroups, SetPromptCommand, Shell, Sleep, SourceCommand, SslVerificationCommand, StorageProvidersCommand, Tasks, UserGroupsCommand, UserSettingsCommand, UserSourcesCommand, Users, VersionCommand, VirtualImages, Whoami, Workflows
Constant Summary collapse
- VERSION =
"3.6.0"
Class Method Summary collapse
- .home_directory ⇒ Object
-
.home_directory=(fn) ⇒ Object
the home directory, where morpheus-cli stores things.
-
.load! ⇒ Object
load all the well known commands and utilties they need.
- .windows? ⇒ Boolean
Class Method Details
.home_directory ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/morpheus/cli.rb', line 18 def self.home_directory if @@home_directory @@home_directory elsif ENV['MORPHEUS_CLI_HOME'] @@home_directory = ENV['MORPHEUS_CLI_HOME'] else @@home_directory = File.join(Dir.home, ".morpheus") end end |
.home_directory=(fn) ⇒ Object
the home directory, where morpheus-cli stores things
14 15 16 |
# File 'lib/morpheus/cli.rb', line 14 def self.home_directory=(fn) @@home_directory = fn end |
.load! ⇒ Object
load all the well known commands and utilties they need
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/morpheus/cli.rb', line 43 def self.load!() # load interfaces require 'morpheus/api/api_client.rb' Dir[File.dirname(__FILE__) + "/api/**/*.rb"].each {|file| load file } # load mixins Dir[File.dirname(__FILE__) + "/cli/mixins/*.rb"].each {|file| load file } # load commands # Dir[File.dirname(__FILE__) + "/cli/*.rb"].each {|file| load file } # utilites require 'morpheus/cli/cli_registry.rb' require 'morpheus/cli/expression_parser.rb' require 'morpheus/cli/dot_file.rb' require 'morpheus/cli/command_error' load 'morpheus/cli/cli_command.rb' load 'morpheus/cli/option_types.rb' load 'morpheus/cli/credentials.rb' # all standard commands Dir[File.dirname(__FILE__) + "/cli/commands/standard/**/*.rb"].each {|file| load file } # shell scripting commands load 'morpheus/cli/source_command.rb' load 'morpheus/cli/echo_command.rb' load 'morpheus/cli/sleep_command.rb' load 'morpheus/cli/coloring_command.rb' load 'morpheus/cli/log_level_command.rb' load 'morpheus/cli/ssl_verification_command.rb' load 'morpheus/cli/edit_profile_command.rb' load 'morpheus/cli/edit_rc_command.rb' # all the known commands load 'morpheus/cli/remote.rb' load 'morpheus/cli/login.rb' load 'morpheus/cli/logout.rb' load 'morpheus/cli/whoami.rb' load 'morpheus/cli/user_settings_command.rb' load 'morpheus/cli/dashboard_command.rb' load 'morpheus/cli/power_schedules_command.rb' load 'morpheus/cli/execute_schedules_command.rb' load 'morpheus/cli/recent_activity_command.rb' load 'morpheus/cli/groups.rb' load 'morpheus/cli/clouds.rb' load 'morpheus/cli/cloud_datastores_command.rb' load 'morpheus/cli/hosts.rb' load 'morpheus/cli/load_balancers.rb' load 'morpheus/cli/shell.rb' load 'morpheus/cli/tasks.rb' load 'morpheus/cli/workflows.rb' load 'morpheus/cli/deployments.rb' load 'morpheus/cli/instances.rb' load 'morpheus/cli/containers_command.rb' load 'morpheus/cli/apps.rb' load 'morpheus/cli/blueprints_command.rb' load 'morpheus/cli/app_templates.rb' # deprecated load 'morpheus/cli/deploys.rb' load 'morpheus/cli/license.rb' load 'morpheus/cli/instance_types.rb' load 'morpheus/cli/security_groups.rb' load 'morpheus/cli/security_group_rules.rb' load 'morpheus/cli/accounts.rb' load 'morpheus/cli/account_groups_command.rb' load 'morpheus/cli/users.rb' load 'morpheus/cli/user_groups_command.rb' load 'morpheus/cli/user_sources_command.rb' load 'morpheus/cli/roles.rb' load 'morpheus/cli/key_pairs.rb' load 'morpheus/cli/virtual_images.rb' # load 'morpheus/cli/library.rb' # gone until we collapse these again load 'morpheus/cli/library_instance_types_command.rb' load 'morpheus/cli/library_layouts_command.rb' load 'morpheus/cli/library_upgrades_command.rb' load 'morpheus/cli/library_container_types_command.rb' load 'morpheus/cli/library_container_scripts_command.rb' load 'morpheus/cli/library_container_templates_command.rb' load 'morpheus/cli/library_option_types_command.rb' load 'morpheus/cli/library_option_lists_command.rb' load 'morpheus/cli/packages_command.rb' load 'morpheus/cli/version_command.rb' load 'morpheus/cli/alias_command.rb' # todo: combine checks, incidents, apps, and goups under monitoring? # `monitoring apps|groups` still needed, # maybe they should go under the apps and groups commands instead? # load 'morpheus/cli/monitoring_command.rb' load 'morpheus/cli/monitoring_incidents_command.rb' load 'morpheus/cli/monitoring_checks_command.rb' load 'morpheus/cli/monitoring_contacts_command.rb' load 'morpheus/cli/monitoring_groups_command.rb' load 'morpheus/cli/monitoring_apps_command.rb' load 'morpheus/cli/policies_command.rb' load 'morpheus/cli/networks_command.rb' load 'morpheus/cli/network_groups_command.rb' load 'morpheus/cli/network_pools_command.rb' load 'morpheus/cli/network_services_command.rb' load 'morpheus/cli/network_pool_servers_command.rb' load 'morpheus/cli/network_domains_command.rb' load 'morpheus/cli/network_proxies_command.rb' load 'morpheus/cli/cypher_command.rb' load 'morpheus/cli/image_builder_command.rb' load 'morpheus/cli/preseed_scripts_command.rb' load 'morpheus/cli/boot_scripts_command.rb' load 'morpheus/cli/archives_command.rb' load 'morpheus/cli/storage_providers_command.rb' load 'morpheus/cli/execution_request_command.rb' load 'morpheus/cli/file_copy_request_command.rb' load 'morpheus/cli/processes_command.rb' # nice to have commands load 'morpheus/cli/curl_command.rb' load 'morpheus/cli/set_prompt_command.rb' load 'morpheus/cli/man_command.rb' # please implement me # Your new commands go here... end |
.windows? ⇒ Boolean
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/morpheus/cli.rb', line 28 def self.windows? if defined?(@@is_windows) return @@is_windows end @@is_windows = false begin require 'rbconfig' @@is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) rescue => ex # $stderr.puts "unable to determine if this is a Windows machine." end return @@is_windows end |