epc 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/epc.rb +25 -5
- data/lib/epc/client/json_client.rb +4 -4
- data/lib/epc/command/archive_command.rb +7 -6
- data/lib/epc/command/attachto_command.rb +13 -0
- data/lib/epc/command/base_command.rb +120 -29
- data/lib/epc/command/config/create_config_command.rb +7 -11
- data/lib/epc/command/config/delete_config_command.rb +5 -5
- data/lib/epc/command/config/list_configs_command.rb +5 -5
- data/lib/epc/command/config/update_config_command.rb +11 -10
- data/lib/epc/command/copy_command.rb +14 -0
- data/lib/epc/command/create_command.rb +9 -5
- data/lib/epc/command/delete_command.rb +9 -9
- data/lib/epc/command/{copy_deployment_command.rb → deployment/copy_deployment_command.rb} +6 -5
- data/lib/epc/command/deployment/create_deployment_command.rb +15 -15
- data/lib/epc/command/deployment/list_deployments_command.rb +2 -4
- data/lib/epc/command/deployment/show_deployment_command.rb +5 -7
- data/lib/epc/command/deployment/submit_deployment_command.rb +15 -0
- data/lib/epc/command/deployment/update_deployment_command.rb +5 -14
- data/lib/epc/command/deployment/vote_deployment_command.rb +23 -0
- data/lib/epc/command/deploymentstage/list_deploymentstages_command.rb +1 -1
- data/lib/epc/command/detachfrom_command.rb +13 -0
- data/lib/epc/command/group/create_group_command.rb +3 -3
- data/lib/epc/command/group/delete_group_command.rb +4 -5
- data/lib/epc/command/group/show_group_command.rb +2 -3
- data/lib/epc/command/group/update_group_command.rb +9 -7
- data/lib/epc/command/library/create_library_command.rb +1 -2
- data/lib/epc/command/library/delete_library_command.rb +4 -5
- data/lib/epc/command/library/list_libraries_command.rb +1 -1
- data/lib/epc/command/librarylanguage/create_librarylanguage_command.rb +1 -1
- data/lib/epc/command/librarylanguage/delete_librarylanguage_command.rb +3 -5
- data/lib/epc/command/librarylanguage/list_librarylanguages_command.rb +1 -1
- data/lib/epc/command/librarylanguage/update_librarylanguage_command.rb +4 -5
- data/lib/epc/command/libraryset/create_libraryset_command.rb +5 -4
- data/lib/epc/command/libraryset/delete_libraryset_command.rb +4 -6
- data/lib/epc/command/libraryset/list_librarysets_command.rb +2 -2
- data/lib/epc/command/libraryset/show_libraryset_command.rb +3 -3
- data/lib/epc/command/libraryset/update_libraryset_command.rb +4 -3
- data/lib/epc/command/list_command.rb +10 -14
- data/lib/epc/command/list_objecttypes_command.rb +1 -1
- data/lib/epc/command/objectrole/create_objectrole_command.rb +4 -5
- data/lib/epc/command/objectrole/list_objectroles_command.rb +3 -8
- data/lib/epc/command/objectrole/update_objectrole_command.rb +3 -1
- data/lib/epc/command/permission/list_permissions_command.rb +1 -1
- data/lib/epc/command/permissiongroup/list_permissiongroups_command.rb +1 -1
- data/lib/epc/command/plugin/create_plugin_command.rb +1 -2
- data/lib/epc/command/plugin/delete_plugin_command.rb +4 -6
- data/lib/epc/command/plugin/list_plugins_command.rb +1 -1
- data/lib/epc/command/plugin/show_plugin_command.rb +2 -5
- data/lib/epc/command/plugin/update_plugin_command.rb +2 -6
- data/lib/epc/command/project/archive_project_command.rb +3 -12
- data/lib/epc/command/project/attachto_project_command.rb +133 -0
- data/lib/epc/command/project/create_project_command.rb +6 -6
- data/lib/epc/command/project/delete_project_command.rb +3 -24
- data/lib/epc/command/project/detachfrom_project_command.rb +66 -0
- data/lib/epc/command/project/list_projects_command.rb +12 -7
- data/lib/epc/command/project/show_project_command.rb +26 -25
- data/lib/epc/command/project/show_project_snapshot_command.rb +41 -0
- data/lib/epc/command/project/unarchive_project_command.rb +3 -10
- data/lib/epc/command/project/update_project_command.rb +5 -18
- data/lib/epc/command/projecttype/create_projecttype_command.rb +37 -0
- data/lib/epc/command/projecttype/delete_projecttype_command.rb +24 -0
- data/lib/epc/command/projecttype/list_projecttypes_command.rb +1 -1
- data/lib/epc/command/projecttype/show_projecttype_command.rb +2 -4
- data/lib/epc/command/projecttype/update_projecttype_command.rb +61 -0
- data/lib/epc/command/push_command.rb +14 -8
- data/lib/epc/command/role/create_role_command.rb +26 -3
- data/lib/epc/command/role/delete_role_command.rb +3 -5
- data/lib/epc/command/role/list_roles_command.rb +7 -3
- data/lib/epc/command/role/show_role_command.rb +8 -5
- data/lib/epc/command/role/update_role_command.rb +14 -66
- data/lib/epc/command/runtime/create_runtime_command.rb +34 -0
- data/lib/epc/command/runtime/delete_runtime_command.rb +24 -0
- data/lib/epc/command/runtime/list_runtimes_command.rb +2 -2
- data/lib/epc/command/runtime/update_runtime_command.rb +49 -0
- data/lib/epc/command/runtimetype/list_runtimetypes_command.rb +17 -0
- data/lib/epc/command/servicedefinition/create_servicedefinition_command.rb +5 -6
- data/lib/epc/command/servicedefinition/delete_servicedefinition_command.rb +18 -0
- data/lib/epc/command/servicedefinition/list_servicedefinitions_command.rb +2 -2
- data/lib/epc/command/servicetype/list_servicetypes_command.rb +1 -1
- data/lib/epc/command/serviceversion/create_serviceversion_command.rb +8 -12
- data/lib/epc/command/serviceversion/delete_serviceversion_command.rb +3 -5
- data/lib/epc/command/serviceversion/list_serviceversions_command.rb +8 -1
- data/lib/epc/command/show_command.rb +8 -9
- data/lib/epc/command/show_metrics_command.rb +3 -3
- data/lib/epc/command/solution/archive_solution_command.rb +3 -10
- data/lib/epc/command/solution/create_solution_command.rb +2 -2
- data/lib/epc/command/solution/delete_solution_command.rb +3 -7
- data/lib/epc/command/solution/list_solutions_command.rb +11 -3
- data/lib/epc/command/solution/show_solution_command.rb +4 -6
- data/lib/epc/command/solution/unarchive_solution_command.rb +3 -8
- data/lib/epc/command/solution/update_solution_command.rb +4 -6
- data/lib/epc/command/submit_command.rb +16 -0
- data/lib/epc/command/unarchive_command.rb +7 -6
- data/lib/epc/command/update_command.rb +9 -8
- data/lib/epc/command/user/create_user_command.rb +2 -3
- data/lib/epc/command/user/delete_user_command.rb +3 -5
- data/lib/epc/command/user/list_users_command.rb +1 -1
- data/lib/epc/command/user/show_user_command.rb +2 -4
- data/lib/epc/command/user/update_user_command.rb +3 -14
- data/lib/epc/command/userproperty/list_user_properties_command.rb +23 -0
- data/lib/epc/command/vote_command.rb +16 -0
- data/lib/epc/config.rb +7 -1
- data/lib/epc/help.rb +51 -48
- data/lib/epc/modules/config.rb +39 -0
- data/lib/epc/modules/role.rb +133 -0
- data/lib/epc/runner.rb +23 -12
- data/lib/epc/version.rb +1 -1
- data/test/command/archive_project_command_test.rb +2 -13
- data/test/command/archive_solution_command_test.rb +4 -14
- data/test/command/copy_deployment_command_test.rb +4 -8
- data/test/command/create_config_command_test.rb +23 -23
- data/test/command/create_deployment_command_test.rb +33 -32
- data/test/command/create_group_command_test.rb +2 -2
- data/test/command/create_library_command_test.rb +6 -6
- data/test/command/create_librarylanguage_command_test.rb +3 -3
- data/test/command/create_libraryset_command_test.rb +6 -26
- data/test/command/create_objectrole_command_test.rb +4 -13
- data/test/command/create_project_command_test.rb +27 -13
- data/test/command/create_role_command_test.rb +3 -2
- data/test/command/create_runtime_command_test.rb +37 -0
- data/test/command/create_servicedefinition_command_test.rb +4 -17
- data/test/command/create_serviceversion_command_test.rb +8 -22
- data/test/command/create_solution_command_test.rb +5 -5
- data/test/command/create_user_command_test.rb +4 -4
- data/test/command/delete_config_command_test.rb +8 -15
- data/test/command/delete_library_command_test.rb +3 -4
- data/test/command/delete_librarylanguage_command_test.rb +3 -4
- data/test/command/delete_libraryset_command_test.rb +3 -4
- data/test/command/delete_plugin_command_test.rb +3 -4
- data/test/command/delete_project_command_test.rb +2 -10
- data/test/command/delete_projecttype_command_test.rb +31 -0
- data/test/command/delete_role_command_test.rb +5 -14
- data/test/command/delete_runtime_command_test.rb +31 -0
- data/test/command/delete_servicedefinition_command_test.rb +31 -0
- data/test/command/delete_serviceversion_command_test.rb +3 -2
- data/test/command/delete_solution_command_test.rb +3 -16
- data/test/command/delete_user_command_test.rb +3 -3
- data/test/command/list_config_command_test.rb +1 -0
- data/test/command/list_deployments_command_test.rb +11 -41
- data/test/command/list_objectroles_command_test.rb +4 -14
- data/test/command/list_projects_command_test.rb +0 -14
- data/test/command/list_roles_command_test.rb +3 -1
- data/test/command/list_runtimes_command_test.rb +2 -3
- data/test/command/list_runtimetypes_command_test.rb +29 -0
- data/test/command/list_userproperties_command_test.rb +33 -0
- data/test/command/push_command_test.rb +9 -1
- data/test/command/show_deployment_command_test.rb +36 -0
- data/test/command/show_group_command_test.rb +2 -1
- data/test/command/show_libraryset_command_test.rb +5 -3
- data/test/command/show_metrics_command_test.rb +4 -4
- data/test/command/show_plugin_command_test.rb +4 -4
- data/test/command/show_project_command_test.rb +5 -17
- data/test/command/show_project_snapshot_test.rb +33 -0
- data/test/command/show_projecttype_command_test.rb +5 -11
- data/test/command/show_role_command_test.rb +5 -12
- data/test/command/show_solution_command_test.rb +2 -15
- data/test/command/show_user_command_test.rb +4 -3
- data/test/command/submit_deployment_command_test.rb +4 -11
- data/test/command/unarchive_project_command_test.rb +2 -14
- data/test/command/unarchive_solution_command_test.rb +6 -16
- data/test/command/update_config_command_test.rb +14 -3
- data/test/command/update_deployment_command_test.rb +12 -26
- data/test/command/update_group_command_test.rb +2 -10
- data/test/command/update_librarylanguage_command_test.rb +5 -3
- data/test/command/update_libraryset_command_test.rb +4 -2
- data/test/command/update_plugin_command_test.rb +5 -4
- data/test/command/update_project_command_test.rb +6 -20
- data/test/command/update_role_command_test.rb +11 -8
- data/test/command/update_solution_command_test.rb +6 -12
- data/test/command/update_user_command_test.rb +3 -19
- data/test/command/vote_deployment_command_test.rb +2 -6
- metadata +66 -63
- data/lib/epc/command/attach_library_command.rb +0 -82
- data/lib/epc/command/attach_libraryset_command.rb +0 -31
- data/lib/epc/command/attach_runtime_command.rb +0 -26
- data/lib/epc/command/bind_service_command.rb +0 -35
- data/lib/epc/command/create_dependency_command.rb +0 -43
- data/lib/epc/command/dependency/delete_dependency_command.rb +0 -38
- data/lib/epc/command/detach_library_command.rb +0 -35
- data/lib/epc/command/detach_libraryset_command.rb +0 -8
- data/lib/epc/command/list_versions_command.rb +0 -38
- data/lib/epc/command/submit_deployment_command.rb +0 -19
- data/lib/epc/command/unbind_service_command.rb +0 -42
- data/lib/epc/command/undefine_service_command.rb +0 -33
- data/lib/epc/command/update_rolepermissions_command.rb +0 -83
- data/lib/epc/command/vote_deployment_command.rb +0 -29
- data/test/command/attach_library_command_test.rb +0 -124
- data/test/command/attach_libraryset_command_test.rb +0 -49
- data/test/command/attach_runtime_command_test.rb +0 -44
- data/test/command/bind_service_command_test.rb +0 -46
- data/test/command/create_dependency_command_test.rb +0 -55
- data/test/command/create_plugin_command_test.rb +0 -44
- data/test/command/delete_dependency_command_test.rb +0 -42
- data/test/command/detach_library_command_test.rb +0 -53
- data/test/command/unbind_service_command_test.rb +0 -48
- data/test/command/undefine_service_command_test.rb +0 -49
@@ -2,14 +2,12 @@ module EPC::Command
|
|
2
2
|
class UpdateSolutionCommand < BaseCommand
|
3
3
|
UPDATABLE_ATTRIBUTES = ["name"]
|
4
4
|
|
5
|
-
def execute(
|
5
|
+
def execute(args)
|
6
|
+
require_object
|
7
|
+
|
6
8
|
path = File.expand_path(".")
|
7
9
|
path = project_solution_path(path)
|
8
10
|
|
9
|
-
solution_id, solution_name = infer_solution_context(@options[:solution_name], path)
|
10
|
-
|
11
|
-
raise FatalError, "Solution could not be determined" if solution_id.nil?
|
12
|
-
|
13
11
|
args_hash = {}
|
14
12
|
args.each do |arg|
|
15
13
|
key, val = arg.split("=")
|
@@ -31,7 +29,7 @@ module EPC::Command
|
|
31
29
|
|
32
30
|
|
33
31
|
if args_hash.present?
|
34
|
-
status, response, message = client.put(EPC::Config::SOLUTIONS_PATH + "/#{
|
32
|
+
status, response, message = client.put(EPC::Config::SOLUTIONS_PATH + "/#{object_id}", args_hash)
|
35
33
|
if status.failure?
|
36
34
|
say("Update failed with: [#{response['message']}]")
|
37
35
|
else
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module EPC::Command
|
2
|
+
class SubmitCommand < BaseCommand
|
3
|
+
|
4
|
+
def execute(*args)
|
5
|
+
raise FatalError, "You need to specify the object for the command" if args.blank?
|
6
|
+
params = resolve_context(args)
|
7
|
+
@klass_name = "EPC::Command::Submit#{@object_type.to_s.gsub("-","").capitalize}Command"
|
8
|
+
command = eval(@klass_name)
|
9
|
+
command.include_module(object_type)
|
10
|
+
command = command.new(client, @options)
|
11
|
+
command.context_params = context_params
|
12
|
+
command.execute(params)
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module EPC::Command
|
2
2
|
class UnarchiveCommand < BaseCommand
|
3
3
|
|
4
|
-
def execute(
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
command = eval(
|
9
|
-
command.
|
4
|
+
def execute(*args)
|
5
|
+
raise FatalError, "You need to specify the object for the command" if args.blank?
|
6
|
+
params = resolve_context(args)
|
7
|
+
@klass_name = "EPC::Command::Unarchive#{@object_type.to_s.gsub("-","").capitalize}Command"
|
8
|
+
command = eval(@klass_name).new(client, @options)
|
9
|
+
command.context_params = context_params
|
10
|
+
command.go(params)
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
module EPC::Command
|
2
2
|
class UpdateCommand < BaseCommand
|
3
3
|
|
4
|
-
def execute(
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
command
|
10
|
-
|
11
|
-
command.
|
4
|
+
def execute(*args)
|
5
|
+
raise FatalError, "You need to specify the object for the command" if args.blank?
|
6
|
+
params = resolve_context(args, {:skip_object_resolution => Proc.new{|type, id| type.downcase == "config" || type.downcase == "objectrole"}})
|
7
|
+
@klass_name = "EPC::Command::Update#{@object_type.to_s.gsub("-","").capitalize}Command"
|
8
|
+
command = eval(@klass_name)
|
9
|
+
command.include_module(object_type)
|
10
|
+
command = command.new(client, @options)
|
11
|
+
command.context_params = context_params
|
12
|
+
command.go(params)
|
12
13
|
end
|
13
14
|
|
14
15
|
end
|
@@ -1,15 +1,13 @@
|
|
1
1
|
module EPC::Command
|
2
2
|
class DeleteUserCommand < DeleteCommand
|
3
|
-
def execute(
|
3
|
+
def execute(args = [])
|
4
4
|
|
5
|
-
proceed = ask_yn("Are you sure you want to delete the [#{
|
5
|
+
proceed = ask_yn("Are you sure you want to delete the [#{object_id}] user? [Yn] ")
|
6
6
|
if proceed.upcase == "N"
|
7
7
|
return 1
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
status, response, headers = client.delete(EPC::Config::USERS_PATH + "/#{user_id}")
|
10
|
+
status, response, headers = client.delete(EPC::Config::USERS_PATH + "/#{object_id}")
|
13
11
|
|
14
12
|
if status == 200
|
15
13
|
say("User deleted")
|
@@ -1,11 +1,9 @@
|
|
1
1
|
module EPC::Command
|
2
2
|
class ShowUserCommand < ShowCommand
|
3
3
|
|
4
|
-
def execute(
|
4
|
+
def execute(args = [])
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
status, response, headers = client.get(EPC::Config::USERS_PATH + "/#{user_id}?include=user_groups")
|
6
|
+
status, response, headers = client.get(EPC::Config::USERS_PATH + "/#{object_id}?include=user_groups")
|
9
7
|
|
10
8
|
if status != 200
|
11
9
|
say("Request failed: [#{response[:message]}]")
|
@@ -3,14 +3,10 @@ module EPC::Command
|
|
3
3
|
|
4
4
|
required_options :email, :password, :mode => :any?, :message => "You must specify the attribute to be updated: email/password"
|
5
5
|
|
6
|
-
def execute(
|
6
|
+
def execute(args)
|
7
7
|
|
8
8
|
if @options[:password].present?
|
9
|
-
|
10
|
-
email = get_resource_attribute(EPC::Config::USERS_PATH, :email, :id, user.to_i)
|
11
|
-
else
|
12
|
-
email = user
|
13
|
-
end
|
9
|
+
email = get_resource_attribute(EPC::Config::USERS_PATH, :email, :id, object_id.to_i)
|
14
10
|
raise FatalError, "User could not be determined" if email.blank?
|
15
11
|
|
16
12
|
raise FatalError, "You need to specify the password change token with the --token option" if @options[:token].blank?
|
@@ -27,19 +23,12 @@ module EPC::Command
|
|
27
23
|
end
|
28
24
|
|
29
25
|
if @options[:email].present? || @options[:name].present?
|
30
|
-
if numeric?(user)
|
31
|
-
user_id = user.to_i
|
32
|
-
else
|
33
|
-
user_id = get_resource_id(EPC::Config::USERS_PATH, :email, user)
|
34
|
-
end
|
35
|
-
|
36
|
-
raise FatalError, "User could not be determined" if user_id.blank?
|
37
26
|
|
38
27
|
params = {}
|
39
28
|
params[:email] = @options[:email] if @options[:email].present?
|
40
29
|
params[:name] = @options[:name] if @options[:name].present?
|
41
30
|
|
42
|
-
status, response, headers = client.put(EPC::Config::USERS_PATH + "/#{
|
31
|
+
status, response, headers = client.put(EPC::Config::USERS_PATH + "/#{object_id}", params)
|
43
32
|
|
44
33
|
if status.successful?
|
45
34
|
say("User updated")
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'time'
|
2
|
+
module EPC::Command
|
3
|
+
class ListUserpropertiesCommand < BaseCommand
|
4
|
+
|
5
|
+
def execute(args = [])
|
6
|
+
user_id = retrieve_identifier_for("User", EPC::Config.username)
|
7
|
+
|
8
|
+
status, response, headers = client.get(EPC::Config::ENTITY_PROPERTIES_PATH + "/for/User/#{user_id}")
|
9
|
+
|
10
|
+
if status.failure?
|
11
|
+
say("Request failed with [#{response[:message]}]")
|
12
|
+
elsif response.empty?
|
13
|
+
say("No properties found for current user.")
|
14
|
+
else
|
15
|
+
response.each {|property| property[:created_at] = Time.parse(property[:created_at]).strftime("%m/%d/%Y %I:%M%p") rescue nil }
|
16
|
+
properties_table = EPC::TabularOutputter.new(response, [:id, :name, :created_at])
|
17
|
+
say(properties_table.print)
|
18
|
+
end
|
19
|
+
return status
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module EPC::Command
|
2
|
+
class VoteCommand < BaseCommand
|
3
|
+
|
4
|
+
def execute(*args)
|
5
|
+
raise FatalError, "You need to specify the object for the command" if args.blank?
|
6
|
+
params = resolve_context(args)
|
7
|
+
@klass_name = "EPC::Command::Vote#{@object_type.to_s.gsub("-","").capitalize}Command"
|
8
|
+
command = eval(@klass_name)
|
9
|
+
command.include_module(object_type)
|
10
|
+
command = command.new(client, @options)
|
11
|
+
command.context_params = context_params
|
12
|
+
command.execute(params)
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
data/lib/epc/config.rb
CHANGED
@@ -41,6 +41,7 @@ module EPC
|
|
41
41
|
METRICS_PATH = "#{SCOPE}/metrics"
|
42
42
|
INSTANCES_PATH = "#{SCOPE}/deployed_projects"
|
43
43
|
PLUGINS_PATH = "#{SCOPE}/plugins"
|
44
|
+
ENTITY_PROPERTIES_PATH = "#{SCOPE}/entity_properties"
|
44
45
|
|
45
46
|
class << self
|
46
47
|
def target_file
|
@@ -138,7 +139,12 @@ module EPC
|
|
138
139
|
def remove_auth_token
|
139
140
|
FileUtils.rm_f(File.expand_path(token_file))
|
140
141
|
end
|
141
|
-
|
142
|
+
|
143
|
+
def module_exists?(class_name)
|
144
|
+
return EPC::Command.const_defined?(class_name)
|
145
|
+
rescue NameError
|
146
|
+
return false
|
147
|
+
end
|
142
148
|
|
143
149
|
def underscore(camel_cased_word)
|
144
150
|
camel_cased_word.to_s.gsub(/::/, '/').
|
data/lib/epc/help.rb
CHANGED
@@ -4,7 +4,7 @@ module EPC
|
|
4
4
|
:info => 'epc info',
|
5
5
|
:target => 'epc target <url>',
|
6
6
|
:login => 'epc login <email> [--passwd PASS]',
|
7
|
-
:list_solutions => 'epc list solutions',
|
7
|
+
:list_solutions => 'epc list solutions [--archived]',
|
8
8
|
:create_solution => 'epc create solution <name>',
|
9
9
|
:show_solution => 'epc show Solution:solution_identifier',
|
10
10
|
:update_solution => 'epc update Solution:solution_identifier name=value',
|
@@ -12,40 +12,33 @@ module EPC
|
|
12
12
|
:archive_solution => 'epc archive Solution:solution_identifier',
|
13
13
|
:unarchive_solution => 'epc unarchive Solution:solution_identifier',
|
14
14
|
:refresh_solution => 'epc refresh solution [SOLUTION]',
|
15
|
-
:list_projects => 'epc list projects [Solution:solution_id]',
|
16
|
-
:create_project => 'epc create project <name> [uri-name] <--type PROJECT_TYPE>',
|
15
|
+
:list_projects => 'epc list projects [Solution:solution_id] [--archived]',
|
16
|
+
:create_project => 'epc create project <name> [uri-name] <--type PROJECT_TYPE> <--memory MEMORY>',
|
17
17
|
:show_project => 'epc show Project:project_identifier',
|
18
18
|
:update_project => 'epc update Project:project_identifier <attribute=value>',
|
19
|
-
:delete_project => 'epc delete
|
19
|
+
:delete_project => 'epc delete Project:project_identifier [--force]',
|
20
20
|
:attach_runtime => 'epc attach runtime <runtime_id> [-p PROJECT] [--stage STAGE]',
|
21
21
|
:list_servicetypes => 'epc list service-types',
|
22
|
-
:create_servicedefinition => 'epc create
|
23
|
-
:
|
24
|
-
:list_servicedefinitions => 'epc list
|
25
|
-
:create_serviceversion => 'epc create
|
26
|
-
:list_serviceversions => 'epc list
|
27
|
-
:delete_serviceversion => 'epc delete
|
28
|
-
:bind_service => 'epc bind service [-s SOLUTION] [-p PROJECT] <service version>',
|
29
|
-
:unbind_service => 'epc unbind service [-s SOLUTION] [-p PROJECT] <service version>',
|
30
|
-
:list_boundservices => 'epc list bound-services [-s SOLUTION] <PROJECT>',
|
22
|
+
:create_servicedefinition => 'epc create ServiceDefinition ServiceType:service_type_identifier <service_name>',
|
23
|
+
:delete_servicedefinition => 'epc delete ServiceDefinition:service_definition_identifier',
|
24
|
+
:list_servicedefinitions => 'epc list ServiceDefinitions',
|
25
|
+
:create_serviceversion => 'epc create ServiceVersion <ServiceDefinition:service_definition_identifier> <label> [--up-script file] [--down-script file]',
|
26
|
+
:list_serviceversions => 'epc list ServiceVersions',
|
27
|
+
:delete_serviceversion => 'epc delete ServiceVersion:service_version_identifier',
|
31
28
|
:create_user => 'epc create user <email> [--name NAME]',
|
32
|
-
:push => 'epc push [PROJECT NAME] [--note NOTE] [--timeout value | --nopoll]',
|
29
|
+
:push => 'epc push [PROJECT NAME] [--note NOTE] [--timeout value | --nopoll] [--direct-deploy file]',
|
33
30
|
:pull => 'epc pull [SOLUTION]',
|
34
31
|
:build => 'epc build [project_name=version] [--note NOTE] [--timeout value | --nopoll]',
|
35
|
-
:list_deploymentconfigs => 'epc list deployment-configs [--stage STAGE] [-p PROJECT]',
|
36
32
|
:list_deploymentstages => 'epc list stages',
|
37
|
-
:create_deployment => 'epc create
|
33
|
+
:create_deployment => 'epc create Deployment Solution:solution_identifier <stage name: development|testing|staging|production> [-p project_id:version:instances:runtime_memory] [--replaces deployment_id]',
|
38
34
|
:show_deployment => 'epc show Deployment:deployment_identifier',
|
39
|
-
:submit_deployment => 'epc submit
|
35
|
+
:submit_deployment => 'epc submit Deployment:deployment_identifier',
|
40
36
|
:list_deployments => 'epc list deployments [<Solution:solution_id> | <DeploymentStage:deployment_stage_id> | <User:user_id>]',
|
41
37
|
:copy_deployment => 'epc copy deployment <DEPLOYMENT_ID> <STAGE>',
|
42
|
-
:approve_deployment => 'epc approve
|
43
|
-
:deny_deployment => 'epc deny
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:delete_dependency => 'epc delete dependency [-s SOLUTION] [-p PROJECT] <DEPENDENCY_ID>',
|
47
|
-
:create_library => 'epc create library <name> <language> <version> <group> [-f file] [--scope runtime | compile | provided | test]',
|
48
|
-
:list_libraries => 'epc list libraries',
|
38
|
+
:approve_deployment => 'epc approve Deployment:deployment_identifier',
|
39
|
+
:deny_deployment => 'epc deny Deployment:deployment_identifier',
|
40
|
+
:create_library => 'epc create Library <name> <language> <version> <group> [-f file] [--scope runtime | compile | provided | test]',
|
41
|
+
:list_libraries => 'epc list Libraries',
|
49
42
|
:delete_library => 'epc delete Library:library_identifier',
|
50
43
|
:attach_library => 'epc attach library [-s SOLUTION] [-p PROJECT] <name> <version> <group> [-f FILE] [--pom POM FILE]',
|
51
44
|
:detach_library => 'epc detach library [-s SOLUTION] [-p PROJECT] <LIBRARY>',
|
@@ -55,12 +48,11 @@ module EPC
|
|
55
48
|
:renew => 'epc renew',
|
56
49
|
:logout => 'epc logout',
|
57
50
|
:create_config => 'epc create config <TargetType:TargetId> [--required] [--no_override] [--value-type TYPE] name=value',
|
58
|
-
:
|
51
|
+
:list_configs => 'epc list config <TargetType:TargetType>',
|
59
52
|
:delete_config => 'epc delete Config:key_identifier <TargetType:TargetId>',
|
60
53
|
:list_projecttypes => 'epc list project-types',
|
61
54
|
:show_projecttype => 'epc show ProjectType:project_type_identifier',
|
62
55
|
:update_deployment => 'epc update Deployment:deployment_identifier Project:project_identifier [--instances instance_count] [--uris comma_separated_uris]',
|
63
|
-
:list_versions => 'epc list versions [-s SOLUTION] PROJECT',
|
64
56
|
:update_config => 'epc update Config:config_identifier TargetType:TargetId [--required] [--no_override] name=value',
|
65
57
|
:archive_project => 'epc archive Project:project_identifier',
|
66
58
|
:unarchive_project => 'epc unarchive Project:project_identifier',
|
@@ -71,40 +63,47 @@ module EPC
|
|
71
63
|
:update_group => 'epc update Group:group_identifier:group_identifier [--add-user USER_ID] [--remove-user USER_ID]',
|
72
64
|
:show_group => 'epc show Group:group_identifier',
|
73
65
|
:list_roles => 'epc list roles [User:user_id]',
|
74
|
-
:list_objectroles => 'epc list
|
75
|
-
:delete_role => 'epc delete
|
66
|
+
:list_objectroles => 'epc list ObjectRoles <ObjectType:ObjectId>',
|
67
|
+
:delete_role => 'epc delete Role',
|
76
68
|
: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]',
|
77
69
|
: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]',
|
78
|
-
:create_role => 'epc create role <name>',
|
70
|
+
:create_role => 'epc create role <name> [--file json]',
|
79
71
|
:create_objectrole => 'epc create role <name> <ObjectType:ObjectId>',
|
80
72
|
:show_role => 'epc show Role:role_identifier [users|groups|grants]',
|
81
73
|
:list_users => 'epc list users',
|
82
|
-
:delete_user => 'epc delete
|
74
|
+
:delete_user => 'epc delete User:user_identifier',
|
83
75
|
:show_user => 'epc show User:user_identifier',
|
84
|
-
:create_librarylanguage => 'epc create
|
85
|
-
:list_librarylanguages => 'epc list
|
76
|
+
:create_librarylanguage => 'epc create LibraryLanguage <name>',
|
77
|
+
:list_librarylanguages => 'epc list LibraryLanguages',
|
86
78
|
:delete_librarylanguage => 'epc delete LibraryLanguage:language_identifier',
|
87
79
|
:update_librarylanguage => 'epc update LibraryLanguage:language_identifier <new-name>',
|
88
|
-
:create_libraryset => 'epc create
|
80
|
+
:create_libraryset => 'epc create LibrarySet <name> <language> [--file file]',
|
89
81
|
:show_libraryset => 'epc show LibrarySet:libraryset_identifier [--json]',
|
90
|
-
:list_librarysets => 'epc list
|
82
|
+
:list_librarysets => 'epc list LibrarySets',
|
91
83
|
:update_libraryset => 'epc update LibrarySet:library-set_identifier [--add-library id|name:version:group] [--remove-library id|name:version:group] [--file file]',
|
92
|
-
:delete_libraryset => 'epc delete
|
93
|
-
:attach_libraryset => 'epc attach library-set name|id [-s solution] [-p project]',
|
94
|
-
:detach_libraryset => 'epc detach library-set name|id [-s solution] [-p project]',
|
84
|
+
:delete_libraryset => 'epc delete LibrarySet:library_set_identifier [-y]',
|
95
85
|
:request_passwordchange => 'epc request password-change <email>',
|
96
86
|
:update_user => 'epc update User:user_identifier [--passwd password] [--token token] [--email new_email] [--name new_name]',
|
97
87
|
:list_metrics => 'epc list metrics [--target target]',
|
98
88
|
:show_metrics => 'epc show metrics <id> <metric list> [--start start] [--stop stop] [--step step] [--graph]',
|
99
89
|
:show_instances => 'epc show instances <deployed-project-id>',
|
100
|
-
:list_permissions => 'epc list
|
101
|
-
:
|
102
|
-
:
|
103
|
-
:list_objecttypes => 'epc list object-types',
|
90
|
+
:list_permissions => 'epc list Permissions',
|
91
|
+
:list_permissiongroups => 'epc list PermissionGroups',
|
92
|
+
:list_objecttypes => 'epc list ObjectTypes',
|
104
93
|
:create_plugin => 'epc create plugin <name> <version> <group> [--inherited] [--extensions] [--executions executions|file:path_to_executions_file] [--configuration configuration|file:path_to_configuration_file]',
|
105
94
|
:show_plugin => 'epc show Plugin:Name:Version:Group',
|
106
95
|
:list_plugins => 'epc list plugins',
|
107
|
-
:update_plugin => 'epc update Plugin:Name:Version:Group attribute=new value'
|
96
|
+
:update_plugin => 'epc update Plugin:Name:Version:Group attribute=new value',
|
97
|
+
:attachto_project => 'epc attach-to Project:project_identifier [Library|LibrarySet|ServiceVersion|Dependency]:[library_identifier|library_set_identifier|service_version_identifier|dependency_identifier]',
|
98
|
+
:detachfrom_project => 'epc detach-from Project:project_identifier [Library|LibrarySet|ServiceVersion|Dependency]:[library_identifier|library_set_identifier|service_version_identifier|dependency_identifier]',
|
99
|
+
:list_runtimetypes => 'epc list RuntimeTypes',
|
100
|
+
:create_runtime => 'epc create Runtime RuntimeType:runtime_type_identifier name target deployment_stage username password [--agility_topology id] [--agility-environment id]',
|
101
|
+
:update_runtime => 'epc update Runtime:runtime_identifier attribute=new_value',
|
102
|
+
:delete_runtime => 'epc delete Runtime:runtime_identifier',
|
103
|
+
:create_projecttype => 'epc create ProjectType name runtime framework build-type build-packaging deployable runtime-env-types',
|
104
|
+
:delete_projecttype => 'epc delete ProjectType:project_type_identifier',
|
105
|
+
:update_projecttype => 'epc update ProjectType:project_type_identifier attribute=value',
|
106
|
+
:snapshot => 'epc snapshot project_id:project_version'
|
108
107
|
}
|
109
108
|
|
110
109
|
def display_usage
|
@@ -156,10 +155,10 @@ Currently available epc commands are:
|
|
156
155
|
delete solution Deletes the solution from the system and removes
|
157
156
|
local metadata files.
|
158
157
|
Does not remove local directories.
|
159
|
-
archive solution Archives the solution.
|
158
|
+
archive solution Archives the solution. Archived solutions do
|
160
159
|
not appear when listing solutions.
|
161
|
-
unarchive solution
|
162
|
-
The solution will appear in
|
160
|
+
unarchive solution Unarchives solution.
|
161
|
+
The solution will appear in solutions listing.
|
163
162
|
refresh solution Retrieves and stores attributes for a solution.
|
164
163
|
|
165
164
|
pull Downloads and extracts a solution skeleton
|
@@ -173,6 +172,8 @@ Currently available epc commands are:
|
|
173
172
|
update project Updates the specified attributes.
|
174
173
|
delete project Deletes the project.Removes only the
|
175
174
|
metadata files.
|
175
|
+
epc snapshot Returns a snapshot of the project and it's associations
|
176
|
+
for a given version.
|
176
177
|
All other files are left intact.
|
177
178
|
epc create dependency Creates a dependency such as parent_name_or_id will
|
178
179
|
depend on dependency_name_or_id.
|
@@ -186,9 +187,11 @@ Currently available epc commands are:
|
|
186
187
|
epc list bound-services Lists the services bound to the project
|
187
188
|
attach runtime Sets the runtime environment the project
|
188
189
|
will run on at deployment.
|
190
|
+
create ProjectType Creates a project type with the given options.
|
189
191
|
list project-types Lists available project types.
|
190
192
|
show project-type Show details about a project type
|
191
|
-
|
193
|
+
update ProjectType Updates a project type with the given options.
|
194
|
+
delete ProjectType Removes a project type from the system.
|
192
195
|
|
193
196
|
|
194
197
|
Services
|
@@ -203,8 +206,8 @@ Currently available epc commands are:
|
|
203
206
|
|
204
207
|
|
205
208
|
Deployments
|
206
|
-
push
|
207
|
-
|
209
|
+
push Pushes project code to the repository
|
210
|
+
and builds as needed
|
208
211
|
build Builds a previously pushed project
|
209
212
|
show deployment Retrieves detailed information about
|
210
213
|
the deployment
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module EPC::Command
|
2
|
+
module Config
|
3
|
+
|
4
|
+
def self.included(base)
|
5
|
+
base.send :include, InstanceMethods
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
module InstanceMethods
|
10
|
+
def extract_configuration_level(path, target)
|
11
|
+
config_type, config_id = target rescue [nil, nil]
|
12
|
+
|
13
|
+
if config_id.nil?
|
14
|
+
if EPC::Config.is_project_dir?(path)
|
15
|
+
config_id = EPC::Config.get_project_value(path, "id")
|
16
|
+
config_type = "Project"
|
17
|
+
elsif EPC::Config.is_solution_dir?(path)
|
18
|
+
config_id = EPC::Config.get_solution_value(path, "id")
|
19
|
+
config_type = "Solution"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
return [config_type, config_id]
|
24
|
+
end
|
25
|
+
|
26
|
+
def parse_config_value_file(file, config_type, config_id)
|
27
|
+
params = []
|
28
|
+
params = EPC::Config.read_content_as_json(file)
|
29
|
+
params.each do |param|
|
30
|
+
if param[:configurable_type].nil? || param[:configurable_id].nil?
|
31
|
+
param[:configurable_type] = config_type
|
32
|
+
param[:configurable_id] = config_id
|
33
|
+
end
|
34
|
+
end
|
35
|
+
params
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|