epc 1.0.2 → 1.0.3
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 +71 -54
- data/lib/epc/command/archive_command.rb +12 -0
- data/lib/epc/command/attach_libraryset_command.rb +1 -2
- data/lib/epc/command/attach_runtime_command.rb +0 -1
- data/lib/epc/command/base_command.rb +52 -63
- data/lib/epc/command/config/delete_config_command.rb +57 -0
- data/lib/epc/command/{list_config_command.rb → config/list_configs_command.rb} +1 -1
- data/lib/epc/command/config/update_config_command.rb +56 -0
- data/lib/epc/command/create_command.rb +0 -1
- data/lib/epc/command/delete_command.rb +16 -0
- data/lib/epc/command/{delete_dependency_command.rb → dependency/delete_dependency_command.rb} +14 -16
- data/lib/epc/command/deploy_command.rb +1 -2
- data/lib/epc/command/deployment/list_deployments_command.rb +49 -0
- data/lib/epc/command/deployment/show_deployment_command.rb +61 -0
- data/lib/epc/command/{update_deploymentproject_command.rb → deployment/update_deployment_command.rb} +3 -3
- data/lib/epc/command/{list_stages_command.rb → deploymentstage/list_deploymentstages_command.rb} +1 -1
- data/lib/epc/command/group/delete_group_command.rb +25 -0
- data/lib/epc/command/{list_groups_command.rb → group/list_groups_command.rb} +1 -1
- data/lib/epc/command/{show_group_command.rb → group/show_group_command.rb} +2 -9
- data/lib/epc/command/{update_group_command.rb → group/update_group_command.rb} +3 -20
- data/lib/epc/command/library/create_library_command.rb +2 -5
- data/lib/epc/command/library/delete_library_command.rb +23 -0
- data/lib/epc/command/{list_libraries_command.rb → library/list_libraries_command.rb} +1 -1
- data/lib/epc/command/librarylanguage/delete_librarylanguage_command.rb +24 -0
- data/lib/epc/command/{list_librarylanguages_command.rb → librarylanguage/list_librarylanguages_command.rb} +1 -1
- data/lib/epc/command/{update_librarylanguage_command.rb → librarylanguage/update_librarylanguage_command.rb} +6 -10
- data/lib/epc/command/libraryset/create_libraryset_command.rb +1 -6
- data/lib/epc/command/{delete_libraryset_command.rb → libraryset/delete_libraryset_command.rb} +2 -18
- data/lib/epc/command/{list_librarysets_command.rb → libraryset/list_librarysets_command.rb} +1 -1
- data/lib/epc/command/{show_libraryset_command.rb → libraryset/show_libraryset_command.rb} +2 -17
- data/lib/epc/command/{update_libraryset_command.rb → libraryset/update_libraryset_command.rb} +4 -16
- data/lib/epc/command/list_command.rb +22 -0
- data/lib/epc/command/list_metrics_command.rb +25 -0
- data/lib/epc/command/list_objecttypes_command.rb +2 -4
- data/lib/epc/command/list_versions_command.rb +0 -1
- data/lib/epc/command/{list_objectroles_command.rb → objectrole/list_objectroles_command.rb} +3 -3
- data/lib/epc/command/objectrole/update_objectrole_command.rb +14 -0
- data/lib/epc/command/{list_rolepermissions_command.rb → permission/list_permissions_command.rb} +2 -2
- data/lib/epc/command/{list_permissiongroups_command.rb → permissiongroup/list_permissiongroups_command.rb} +1 -1
- data/lib/epc/command/plugin/create_plugin_command.rb +42 -0
- data/lib/epc/command/plugin/delete_plugin_command.rb +26 -0
- data/lib/epc/command/plugin/list_plugins_command.rb +19 -0
- data/lib/epc/command/plugin/show_plugin_command.rb +29 -0
- data/lib/epc/command/plugin/update_plugin_command.rb +53 -0
- data/lib/epc/command/{archive_project_command.rb → project/archive_project_command.rb} +4 -3
- data/lib/epc/command/{delete_project_command.rb → project/delete_project_command.rb} +11 -7
- data/lib/epc/command/{list_projects_command.rb → project/list_projects_command.rb} +8 -9
- data/lib/epc/command/{show_project_command.rb → project/show_project_command.rb} +64 -29
- data/lib/epc/command/{unarchive_project_command.rb → project/unarchive_project_command.rb} +5 -4
- data/lib/epc/command/{update_project_command.rb → project/update_project_command.rb} +11 -5
- data/lib/epc/command/{list_projecttypes_command.rb → projecttype/list_projecttypes_command.rb} +1 -1
- data/lib/epc/command/{show_projecttype_command.rb → projecttype/show_projecttype_command.rb} +4 -3
- data/lib/epc/command/pull_command.rb +33 -35
- data/lib/epc/command/{delete_role_command.rb → role/delete_role_command.rb} +3 -4
- data/lib/epc/command/{list_roles_command.rb → role/list_roles_command.rb} +4 -3
- data/lib/epc/command/{show_role_command.rb → role/show_role_command.rb} +18 -10
- data/lib/epc/command/role/update_role_command.rb +95 -0
- data/lib/epc/command/{list_runtimes_command.rb → runtime/list_runtimes_command.rb} +0 -0
- data/lib/epc/command/servicedefinition/create_servicedefinition_command.rb +23 -0
- data/lib/epc/command/{list_servicedefinitions_command.rb → servicedefinition/list_servicedefinitions_command.rb} +1 -0
- data/lib/epc/command/{list_service_types_command.rb → servicetype/list_servicetypes_command.rb} +0 -0
- data/lib/epc/command/serviceversion/delete_serviceversion_command.rb +24 -0
- data/lib/epc/command/{list_serviceversions_command.rb → serviceversion/list_serviceversions_command.rb} +1 -1
- data/lib/epc/command/show_command.rb +27 -0
- data/lib/epc/command/show_instances_command.rb +33 -0
- data/lib/epc/command/show_metrics_command.rb +55 -0
- data/lib/epc/command/{archive_solution_command.rb → solution/archive_solution_command.rb} +2 -1
- data/lib/epc/command/solution/create_solution_command.rb +0 -1
- data/lib/epc/command/{delete_solution_command.rb → solution/delete_solution_command.rb} +5 -10
- data/lib/epc/command/solution/list_solutions_command.rb +1 -1
- data/lib/epc/command/{show_solution_command.rb → solution/show_solution_command.rb} +12 -7
- data/lib/epc/command/{unarchive_solution_command.rb → solution/unarchive_solution_command.rb} +1 -1
- data/lib/epc/command/solution/update_solution_command.rb +2 -1
- data/lib/epc/command/unarchive_command.rb +12 -0
- data/lib/epc/command/update_command.rb +15 -0
- data/lib/epc/command/update_rolepermissions_command.rb +2 -2
- data/lib/epc/command/{delete_user_command.rb → user/delete_user_command.rb} +4 -12
- data/lib/epc/command/{list_users_command.rb → user/list_users_command.rb} +1 -1
- data/lib/epc/command/{show_user_command.rb → user/show_user_command.rb} +3 -17
- data/lib/epc/command/{update_user_command.rb → user/update_user_command.rb} +2 -4
- data/lib/epc/config.rb +4 -1
- data/lib/epc/help.rb +50 -35
- data/lib/epc/runner.rb +16 -5
- data/lib/epc/version.rb +1 -1
- data/lib/epc/vertical_bar.rb +40 -0
- data/test/command/create_library_command_test.rb +5 -2
- data/test/command/create_libraryset_command_test.rb +1 -1
- data/test/command/create_plugin_command_test.rb +44 -0
- data/test/command/create_servicedefinition_command_test.rb +43 -0
- data/test/command/delete_config_command_test.rb +0 -11
- data/test/command/delete_dependency_command_test.rb +3 -11
- data/test/command/delete_library_command_test.rb +2 -15
- data/test/command/delete_librarylanguage_command_test.rb +2 -24
- data/test/command/delete_libraryset_command_test.rb +2 -24
- data/test/command/delete_plugin_command_test.rb +32 -0
- data/test/command/delete_project_command_test.rb +0 -6
- data/test/command/delete_role_command_test.rb +1 -1
- data/test/command/delete_serviceversion_command_test.rb +0 -22
- data/test/command/delete_solution_command_test.rb +4 -4
- data/test/command/delete_user_command_test.rb +2 -24
- data/test/command/list_config_command_test.rb +3 -3
- data/test/command/list_deployments_command_test.rb +17 -20
- data/test/command/list_deploymentstages_command_test.rb +2 -2
- data/test/command/list_metrics_command_test.rb +40 -0
- data/test/command/{list_rolepermissions_command_test.rb → list_permissions_command_test.rb} +2 -2
- data/test/command/list_plugins_command_test.rb +27 -0
- data/test/command/list_projects_command_test.rb +3 -5
- data/test/command/list_roles_command_test.rb +2 -3
- data/test/command/pull_command_test.rb +13 -9
- data/test/command/show_group_command_test.rb +1 -23
- data/test/command/show_instances_command_test.rb +33 -0
- data/test/command/show_libraryset_command_test.rb +0 -11
- data/test/command/show_metrics_command_test.rb +51 -0
- data/test/command/show_plugin_command_test.rb +28 -0
- data/test/command/show_project_command_test.rb +1 -1
- data/test/command/show_projecttype_command_test.rb +0 -5
- data/test/command/show_role_command_test.rb +1 -1
- data/test/command/show_solution_command_test.rb +1 -1
- data/test/command/show_user_command_test.rb +2 -22
- data/test/command/update_config_command_test.rb +3 -9
- data/test/command/{update_deploymentproject_command_test.rb → update_deployment_command_test.rb} +6 -11
- data/test/command/update_group_command_test.rb +1 -20
- data/test/command/update_librarylanguage_command_test.rb +0 -15
- data/test/command/update_libraryset_command_test.rb +0 -13
- data/test/command/update_plugin_command_test.rb +41 -0
- data/test/command/update_project_command_test.rb +3 -3
- data/test/command/update_role_command_test.rb +2 -1
- data/test/command/update_solution_command_test.rb +3 -9
- data/test/command/update_user_command_test.rb +0 -6
- metadata +177 -165
- data/lib/epc/command/define_service_command.rb +0 -37
- data/lib/epc/command/delete_config_command.rb +0 -63
- data/lib/epc/command/delete_group_command.rb +0 -40
- data/lib/epc/command/delete_library_command.rb +0 -30
- data/lib/epc/command/delete_librarylanguage_command.rb +0 -40
- data/lib/epc/command/delete_serviceversion_command.rb +0 -52
- data/lib/epc/command/list_approvals_command.rb +0 -27
- data/lib/epc/command/list_attachedlibraries_command.rb +0 -42
- data/lib/epc/command/list_boundservices_command.rb +0 -40
- data/lib/epc/command/list_dependencies_command.rb +0 -43
- data/lib/epc/command/list_deployments_command.rb +0 -68
- data/lib/epc/command/list_solutions_command.rb +0 -25
- data/lib/epc/command/show_deployment_command.rb +0 -57
- data/lib/epc/command/update_config_command.rb +0 -62
- data/lib/epc/command/update_role_command.rb +0 -47
- data/lib/epc/command/update_solution_command.rb +0 -45
- data/test/command/define_service_command_test.rb +0 -55
- data/test/command/delete_group_command_test.rb +0 -56
- data/test/command/list_approvals_command_test.rb +0 -41
- data/test/command/list_boundservices_command_test.rb +0 -46
- data/test/command/list_dependencies_command_test.rb +0 -46
- data/test/command/update_rolepermissions_command_test.rb +0 -54
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class DefineServiceCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(service_name = nil)
|
|
5
|
-
if service_name.nil?
|
|
6
|
-
say("You must specify a name for the service")
|
|
7
|
-
say(EPC::Help::COMMAND_USAGES[:define_service])
|
|
8
|
-
return 1
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
if @options[:service_type].nil?
|
|
12
|
-
say("You must specify a service type with -t option.")
|
|
13
|
-
return 1
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
if numeric?(@options[:service_type])
|
|
17
|
-
service_type_id = @options[:service_type].to_i
|
|
18
|
-
else
|
|
19
|
-
service_type_id = get_resource_id(EPC::Config::SERVICE_TYPES_PATH, :name, @options[:service_type])
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
if service_type_id.nil? || service_type_id == 0
|
|
23
|
-
say("#{@options[:service_type]} service type could not be found.")
|
|
24
|
-
return 1
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
status, response, headers = client.post(EPC::Config::SERVICE_DEFINITIONS_PATH, {:name => service_name, :type_id => service_type_id})
|
|
28
|
-
if status.failure?
|
|
29
|
-
say("Service definition failed with: [#{response['message']}]")
|
|
30
|
-
else
|
|
31
|
-
say("#{service_name} has been defined.")
|
|
32
|
-
end
|
|
33
|
-
return status
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
end
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class DeleteConfigCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(*args)
|
|
5
|
-
if args.empty?
|
|
6
|
-
say("You must specify the key you wish to delete.")
|
|
7
|
-
return 1
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
path = "."
|
|
11
|
-
path = File.expand_path(path)
|
|
12
|
-
|
|
13
|
-
config_type, config_id = extract_configuration_level(path, @options)
|
|
14
|
-
request_path = EPC::Config::CONFIGURATIONS_PATH+"/#{config_type}/#{config_id}"
|
|
15
|
-
|
|
16
|
-
if ["solution", "project"].include?(config_type.downcase) && !@options[:stage_name].nil?
|
|
17
|
-
request_path += "/#{@options[:stage_name]}"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
status, response, headers = client.get(request_path)
|
|
21
|
-
|
|
22
|
-
raise FatalError, "Configuration retrieval failed with [#{response[:message]}]" if status.failure?
|
|
23
|
-
|
|
24
|
-
existing_keys = response
|
|
25
|
-
|
|
26
|
-
if existing_keys.empty?
|
|
27
|
-
say("There are no configurations defined for this project.")
|
|
28
|
-
return 1
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
args.each do |key|
|
|
32
|
-
key_id = existing_keys.detect{|k| k[:name] == key }[:id] rescue nil
|
|
33
|
-
if key_id.nil?
|
|
34
|
-
say("#{key} is not defined.")
|
|
35
|
-
return 1
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
question = "Are you sure you want to delete the config value [#{key}] defined on [#{config_type}-#{config_id}"
|
|
39
|
-
if ["solution", "project"].include?(config_type.downcase) && !@options[:stage].nil?
|
|
40
|
-
question += "-#{@options[:stage]}"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
question += "]. Correct? [Yn] "
|
|
44
|
-
|
|
45
|
-
proceed = ask_yn(question)
|
|
46
|
-
if proceed.upcase == 'N'
|
|
47
|
-
next
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
status, response, headers = client.delete(EPC::Config::CONFIGURATIONS_PATH + "/#{key_id}")
|
|
51
|
-
if status.failure?
|
|
52
|
-
say("Request failed: [#{response[:message]}]")
|
|
53
|
-
else
|
|
54
|
-
say("#{key} succesfully removed.")
|
|
55
|
-
end
|
|
56
|
-
return status
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
end
|
|
63
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class DeleteGroupCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(group = nil)
|
|
5
|
-
if group.nil?
|
|
6
|
-
say("You need to specify a group id/name")
|
|
7
|
-
say(EPC::Help::COMMAND_USAGES[:delete_group])
|
|
8
|
-
return 1
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
proceed = ask_yn("Are you sure you want to delete the [#{group}] group? [Yn] ")
|
|
12
|
-
if proceed.upcase == "N"
|
|
13
|
-
return 1
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if numeric?(group)
|
|
18
|
-
group_id = group.to_i
|
|
19
|
-
else
|
|
20
|
-
group_id = get_resource_id(EPC::Config::GROUPS_PATH, :name, group)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
if group_id.nil?
|
|
24
|
-
say("Group could not be determined")
|
|
25
|
-
return 1
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
status, response, headers = client.delete(EPC::Config::GROUPS_PATH + "/#{group_id}")
|
|
29
|
-
|
|
30
|
-
if status.successful?
|
|
31
|
-
say("Group deleted")
|
|
32
|
-
else
|
|
33
|
-
say("Request failed: [#{response[:message]}]")
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
return status
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class DeleteLibraryCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(library_name = nil, version = nil, group = nil)
|
|
5
|
-
raise FatalError, "You must specify a library name" if library_name.nil?
|
|
6
|
-
|
|
7
|
-
proceed = ask_yn("Are you sure you want to delete the [#{library_name}] library? [Yn] ")
|
|
8
|
-
if proceed.upcase == 'N'
|
|
9
|
-
return 1
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
if numeric?(library_name)
|
|
13
|
-
library_id = library_name.to_i
|
|
14
|
-
else
|
|
15
|
-
library_id = retrieve_libraries([{:name => library_name, :library_version => version, :group => group}]).first rescue nil
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
raise FatalError, "Library could not be determined" if library_id.nil? || library_id == 0
|
|
19
|
-
|
|
20
|
-
status, response, headers = client.delete(EPC::Config::LIBRARIES_PATH + "/#{library_id}")
|
|
21
|
-
if status.successful?
|
|
22
|
-
say("Library deleted")
|
|
23
|
-
else
|
|
24
|
-
say("Request failed: [#{response[:message]}]")
|
|
25
|
-
end
|
|
26
|
-
return status
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
end
|
|
30
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class DeleteLibrarylanguageCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(language = nil)
|
|
5
|
-
if language.nil?
|
|
6
|
-
say("You need to specify a language id/name")
|
|
7
|
-
say(EPC::Help::COMMAND_USAGES[:delete_librarylanguage])
|
|
8
|
-
return 1
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
proceed = ask_yn("Are you sure you want to delete the [#{language}] language? [Yn] ")
|
|
12
|
-
if proceed.upcase == "N"
|
|
13
|
-
return 1
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if numeric?(language)
|
|
18
|
-
language_id = language.to_i
|
|
19
|
-
else
|
|
20
|
-
language_id = get_resource_id(EPC::Config::LIBRARY_LANGUAGES_PATH, :name, language)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
if language_id.nil?
|
|
24
|
-
say("Language could not be determined")
|
|
25
|
-
return 1
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
status, response, headers = client.delete(EPC::Config::LIBRARY_LANGUAGES_PATH + "/#{language_id}")
|
|
29
|
-
|
|
30
|
-
if status.successful?
|
|
31
|
-
say("Language deleted")
|
|
32
|
-
else
|
|
33
|
-
say("Request failed: [#{response[:message]}]")
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
return status
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class DeleteServiceversionCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(service_version = nil, definition_name = nil)
|
|
5
|
-
if service_version.nil?
|
|
6
|
-
say("You must specify a service version identifier")
|
|
7
|
-
say(EPC::Help::COMMAND_USAGES[:delete_serviceversion])
|
|
8
|
-
return 1
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
proceed = ask_yn("Are you sure you want to delete the [#{service_version}] service_version. Correct? [Yn] ")
|
|
12
|
-
if proceed.upcase == 'N'
|
|
13
|
-
return 1
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
if numeric?(service_version)
|
|
17
|
-
service_version_id = service_version.to_i
|
|
18
|
-
else
|
|
19
|
-
if definition_name.nil?
|
|
20
|
-
say("You must specify the definition name")
|
|
21
|
-
say(EPC::Help::COMMAND_USAGES[:delete_serviceversion])
|
|
22
|
-
return 1
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
status, response, headers = client.get(EPC::Config::SERVICE_VERSIONS_PATH)
|
|
27
|
-
|
|
28
|
-
if numeric?(definition_name)
|
|
29
|
-
service_version_id = response.detect{|version| version[:label] == service_version && version[:service_definition_id] == definition_name.to_i }[:id] rescue nil
|
|
30
|
-
else
|
|
31
|
-
service_version_id = response.detect{|version| version[:label] == service_version && version[:service_definition_name] == definition_name }[:id] rescue nil
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
if service_version_id.nil? || service_version_id == 0
|
|
37
|
-
say("Service version not found.")
|
|
38
|
-
return 1
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
status, response, headers = client.delete(EPC::Config::SERVICE_VERSIONS_PATH + "/#{service_version_id}")
|
|
42
|
-
|
|
43
|
-
if status.successful?
|
|
44
|
-
say("Service version deleted.")
|
|
45
|
-
else
|
|
46
|
-
say("Request failed: [#{response[:message]}]")
|
|
47
|
-
end
|
|
48
|
-
return status
|
|
49
|
-
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class ListApprovalsCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(deployment_id = nil)
|
|
5
|
-
path = File.expand_path(".")
|
|
6
|
-
|
|
7
|
-
if deployment_id.nil?
|
|
8
|
-
say("You must specify a deployment id")
|
|
9
|
-
say(EPC::Help::COMMAND_USAGES[:list_approvals])
|
|
10
|
-
return 1
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
status, response, headers = client.get(EPC::Config::DEPLOYMENTS_PATH + "/#{deployment_id}/approvals")
|
|
14
|
-
|
|
15
|
-
if status.failure?
|
|
16
|
-
say("Request failed: [#{response[:message]}]")
|
|
17
|
-
elsif response.empty?
|
|
18
|
-
say("No approvals have been defined")
|
|
19
|
-
else
|
|
20
|
-
approvals_table = EPC::TabularOutputter.new(response, [:id, :name, :approved, :approver_id, :approver_name, :confirmed_at])
|
|
21
|
-
say(approvals_table.print)
|
|
22
|
-
end
|
|
23
|
-
return status
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class ListAttachedlibrariesCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(project_name = nil)
|
|
5
|
-
path = File.expand_path(".")
|
|
6
|
-
|
|
7
|
-
solution_name = @options[:solution_name]
|
|
8
|
-
|
|
9
|
-
solution_id, solution_name = infer_solution_context(solution_name, path)
|
|
10
|
-
project_id, project_name = infer_project_context(project_name, path, solution_id)
|
|
11
|
-
|
|
12
|
-
if project_id.nil? || project_id == 0
|
|
13
|
-
say(EPC::Help::COMMAND_USAGES[:list_attachedlibraries])
|
|
14
|
-
return 1
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
status, response, headers = client.get(EPC::Config::PROJECTS_PATH + "/#{project_id}/libraries")
|
|
18
|
-
|
|
19
|
-
if status.failure?
|
|
20
|
-
say("Request failed: [#{response[:message]}]")
|
|
21
|
-
elsif response.empty?
|
|
22
|
-
say("No libraries are attached to this project.")
|
|
23
|
-
say("You can bind them with epc attach library")
|
|
24
|
-
else
|
|
25
|
-
if @options[:json].nil?
|
|
26
|
-
response.each do |resp|
|
|
27
|
-
resp[:version] = resp[:library_version]
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
libraries_table = EPC::TabularOutputter.new(response, [:id, :name, :language, :scope, :version, :group])
|
|
31
|
-
|
|
32
|
-
say("Attached libraries: ")
|
|
33
|
-
say(libraries_table.print)
|
|
34
|
-
else
|
|
35
|
-
say(response.to_json)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
return status
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
end
|
|
42
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class ListBoundservicesCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(project_name = nil)
|
|
5
|
-
path = File.expand_path(".")
|
|
6
|
-
|
|
7
|
-
solution_name = @options[:solution_name]
|
|
8
|
-
|
|
9
|
-
solution_id, solution_name = infer_solution_context(solution_name, path)
|
|
10
|
-
project_id, project_name = infer_project_context(project_name, path, solution_id)
|
|
11
|
-
|
|
12
|
-
if project_id.nil? || project_id == 0
|
|
13
|
-
say(EPC::Help::COMMAND_USAGES[:list_boundservices])
|
|
14
|
-
return 1
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
status, response, headers = client.get(EPC::Config::PROJECTS_PATH + "/#{project_id}/service_versions")
|
|
18
|
-
|
|
19
|
-
if status.failure?
|
|
20
|
-
say("Request failed: [#{response[:message]}]")
|
|
21
|
-
elsif response.empty?
|
|
22
|
-
say("No services are bound to this project.")
|
|
23
|
-
say("You can bind them with epc bind project")
|
|
24
|
-
else
|
|
25
|
-
response.each do |resp|
|
|
26
|
-
resp[:label] = resp[:service_version][:label]
|
|
27
|
-
resp[:definition_name] = resp[:service_version][:service_definition][:name]
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
services_table = EPC::TabularOutputter.new(response, [:id, :label, :definition_name])
|
|
31
|
-
|
|
32
|
-
say("Bound services:")
|
|
33
|
-
say(services_table.print)
|
|
34
|
-
end
|
|
35
|
-
return status
|
|
36
|
-
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
module EPC::Command
|
|
2
|
-
class ListDependenciesCommand < BaseCommand
|
|
3
|
-
|
|
4
|
-
def execute(project_name = nil)
|
|
5
|
-
path = File.expand_path(".")
|
|
6
|
-
|
|
7
|
-
solution_name = @options[:solution_name]
|
|
8
|
-
|
|
9
|
-
solution_id, solution_name = infer_solution_context(solution_name, path)
|
|
10
|
-
project_id, project_name = infer_project_context(project_name, path, solution_id)
|
|
11
|
-
|
|
12
|
-
if project_id.nil?
|
|
13
|
-
say("Project could not be inferred")
|
|
14
|
-
say(EPC::Help::COMMAND_USAGES[:list_dependencies])
|
|
15
|
-
return 1
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
status, response, headers = client.get(EPC::Config::PROJECTS_PATH + "/#{project_id}/list_dependencies")
|
|
19
|
-
if status.failure?
|
|
20
|
-
say("Request failed: [#{response[:message]}]")
|
|
21
|
-
elsif response.empty?
|
|
22
|
-
say("Project [#{project_name}] has no dependencies")
|
|
23
|
-
else
|
|
24
|
-
response.each do |resp|
|
|
25
|
-
resp[:dependency_kind] = dependency_type(resp[:dependency_kind])
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
dependencies_table = EPC::TabularOutputter.new(response, [:id, :dependency_id, :dependency_name, :dependency_kind])
|
|
29
|
-
say(dependencies_table.print)
|
|
30
|
-
end
|
|
31
|
-
return status
|
|
32
|
-
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
private
|
|
36
|
-
|
|
37
|
-
def dependency_type(kind)
|
|
38
|
-
return "compile" if kind == 1
|
|
39
|
-
return "runtime" if kind == 2
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
module EPC::Command
|
|
3
|
-
class ListDeploymentsCommand < BaseCommand
|
|
4
|
-
|
|
5
|
-
def execute(*args)
|
|
6
|
-
path = File.expand_path(".")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if @options[:solution_name].present?
|
|
10
|
-
name = @options[:solution_name]
|
|
11
|
-
if numeric?(name)
|
|
12
|
-
id = name.to_i
|
|
13
|
-
else
|
|
14
|
-
id = get_resource_id(EPC::Config::SOLUTIONS_PATH, :name, name)
|
|
15
|
-
end
|
|
16
|
-
url = EPC::Config::SOLUTIONS_PATH + "/#{id}/deployments"
|
|
17
|
-
elsif @options[:stage_name].present?
|
|
18
|
-
name = @options[:stage_name]
|
|
19
|
-
if numeric?(name)
|
|
20
|
-
id = name.to_i
|
|
21
|
-
else
|
|
22
|
-
id = get_resource_id(EPC::Config::DEPLOYMENT_STAGES_PATH, :name, name, :case_sensitivity => false)
|
|
23
|
-
end
|
|
24
|
-
url = EPC::Config::DEPLOYMENT_STAGES_PATH + "/#{id}/deployments"
|
|
25
|
-
|
|
26
|
-
elsif @options[:user_name].present?
|
|
27
|
-
name = @options[:user_name]
|
|
28
|
-
if numeric?(name)
|
|
29
|
-
id = name.to_i
|
|
30
|
-
else
|
|
31
|
-
id = get_resource_id(EPC::Config::USERS_PATH, :name, name)
|
|
32
|
-
end
|
|
33
|
-
url = EPC::Config::USERS_PATH + "/#{id}/deployments"
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
if id.nil?
|
|
37
|
-
if EPC::Config.is_solution_dir?(path) || EPC::Config.is_project_dir?(path)
|
|
38
|
-
id, name = infer_solution_context(nil, path)
|
|
39
|
-
if id.present?
|
|
40
|
-
url = EPC::Config::SOLUTIONS_PATH + "/#{id}/deployments"
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
raise FatalError, "Solution/stage/deployer could not be inferred." if id.nil?
|
|
46
|
-
|
|
47
|
-
status, response, headers = client.get(url)
|
|
48
|
-
|
|
49
|
-
if status.failure?
|
|
50
|
-
say("Deployments retrieval failed with [#{response[:message]}]")
|
|
51
|
-
elsif response.empty?
|
|
52
|
-
say("You have no deployments created. You can create them with epc create deployment.")
|
|
53
|
-
else
|
|
54
|
-
response = response.select{|d| d[:status] == @options[:status]} unless @options[:status].nil?
|
|
55
|
-
if response.empty?
|
|
56
|
-
say("You have no deployments created. You can create them with epc create deployment.")
|
|
57
|
-
return 0
|
|
58
|
-
end
|
|
59
|
-
response.sort!{|a, b| b[:id] <=> a[:id]}
|
|
60
|
-
deployments_table = EPC::TabularOutputter.new(response, {:id => "ID", :deployer_name => "DEPLOYER", :solution_name => "SOLUTION", :deployment_stage_name => "STAGE", :status => "STATUS"})
|
|
61
|
-
say(deployments_table.print)
|
|
62
|
-
end
|
|
63
|
-
return status
|
|
64
|
-
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
end
|
|
68
|
-
end
|