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.
Files changed (152) hide show
  1. data/lib/epc.rb +71 -54
  2. data/lib/epc/command/archive_command.rb +12 -0
  3. data/lib/epc/command/attach_libraryset_command.rb +1 -2
  4. data/lib/epc/command/attach_runtime_command.rb +0 -1
  5. data/lib/epc/command/base_command.rb +52 -63
  6. data/lib/epc/command/config/delete_config_command.rb +57 -0
  7. data/lib/epc/command/{list_config_command.rb → config/list_configs_command.rb} +1 -1
  8. data/lib/epc/command/config/update_config_command.rb +56 -0
  9. data/lib/epc/command/create_command.rb +0 -1
  10. data/lib/epc/command/delete_command.rb +16 -0
  11. data/lib/epc/command/{delete_dependency_command.rb → dependency/delete_dependency_command.rb} +14 -16
  12. data/lib/epc/command/deploy_command.rb +1 -2
  13. data/lib/epc/command/deployment/list_deployments_command.rb +49 -0
  14. data/lib/epc/command/deployment/show_deployment_command.rb +61 -0
  15. data/lib/epc/command/{update_deploymentproject_command.rb → deployment/update_deployment_command.rb} +3 -3
  16. data/lib/epc/command/{list_stages_command.rb → deploymentstage/list_deploymentstages_command.rb} +1 -1
  17. data/lib/epc/command/group/delete_group_command.rb +25 -0
  18. data/lib/epc/command/{list_groups_command.rb → group/list_groups_command.rb} +1 -1
  19. data/lib/epc/command/{show_group_command.rb → group/show_group_command.rb} +2 -9
  20. data/lib/epc/command/{update_group_command.rb → group/update_group_command.rb} +3 -20
  21. data/lib/epc/command/library/create_library_command.rb +2 -5
  22. data/lib/epc/command/library/delete_library_command.rb +23 -0
  23. data/lib/epc/command/{list_libraries_command.rb → library/list_libraries_command.rb} +1 -1
  24. data/lib/epc/command/librarylanguage/delete_librarylanguage_command.rb +24 -0
  25. data/lib/epc/command/{list_librarylanguages_command.rb → librarylanguage/list_librarylanguages_command.rb} +1 -1
  26. data/lib/epc/command/{update_librarylanguage_command.rb → librarylanguage/update_librarylanguage_command.rb} +6 -10
  27. data/lib/epc/command/libraryset/create_libraryset_command.rb +1 -6
  28. data/lib/epc/command/{delete_libraryset_command.rb → libraryset/delete_libraryset_command.rb} +2 -18
  29. data/lib/epc/command/{list_librarysets_command.rb → libraryset/list_librarysets_command.rb} +1 -1
  30. data/lib/epc/command/{show_libraryset_command.rb → libraryset/show_libraryset_command.rb} +2 -17
  31. data/lib/epc/command/{update_libraryset_command.rb → libraryset/update_libraryset_command.rb} +4 -16
  32. data/lib/epc/command/list_command.rb +22 -0
  33. data/lib/epc/command/list_metrics_command.rb +25 -0
  34. data/lib/epc/command/list_objecttypes_command.rb +2 -4
  35. data/lib/epc/command/list_versions_command.rb +0 -1
  36. data/lib/epc/command/{list_objectroles_command.rb → objectrole/list_objectroles_command.rb} +3 -3
  37. data/lib/epc/command/objectrole/update_objectrole_command.rb +14 -0
  38. data/lib/epc/command/{list_rolepermissions_command.rb → permission/list_permissions_command.rb} +2 -2
  39. data/lib/epc/command/{list_permissiongroups_command.rb → permissiongroup/list_permissiongroups_command.rb} +1 -1
  40. data/lib/epc/command/plugin/create_plugin_command.rb +42 -0
  41. data/lib/epc/command/plugin/delete_plugin_command.rb +26 -0
  42. data/lib/epc/command/plugin/list_plugins_command.rb +19 -0
  43. data/lib/epc/command/plugin/show_plugin_command.rb +29 -0
  44. data/lib/epc/command/plugin/update_plugin_command.rb +53 -0
  45. data/lib/epc/command/{archive_project_command.rb → project/archive_project_command.rb} +4 -3
  46. data/lib/epc/command/{delete_project_command.rb → project/delete_project_command.rb} +11 -7
  47. data/lib/epc/command/{list_projects_command.rb → project/list_projects_command.rb} +8 -9
  48. data/lib/epc/command/{show_project_command.rb → project/show_project_command.rb} +64 -29
  49. data/lib/epc/command/{unarchive_project_command.rb → project/unarchive_project_command.rb} +5 -4
  50. data/lib/epc/command/{update_project_command.rb → project/update_project_command.rb} +11 -5
  51. data/lib/epc/command/{list_projecttypes_command.rb → projecttype/list_projecttypes_command.rb} +1 -1
  52. data/lib/epc/command/{show_projecttype_command.rb → projecttype/show_projecttype_command.rb} +4 -3
  53. data/lib/epc/command/pull_command.rb +33 -35
  54. data/lib/epc/command/{delete_role_command.rb → role/delete_role_command.rb} +3 -4
  55. data/lib/epc/command/{list_roles_command.rb → role/list_roles_command.rb} +4 -3
  56. data/lib/epc/command/{show_role_command.rb → role/show_role_command.rb} +18 -10
  57. data/lib/epc/command/role/update_role_command.rb +95 -0
  58. data/lib/epc/command/{list_runtimes_command.rb → runtime/list_runtimes_command.rb} +0 -0
  59. data/lib/epc/command/servicedefinition/create_servicedefinition_command.rb +23 -0
  60. data/lib/epc/command/{list_servicedefinitions_command.rb → servicedefinition/list_servicedefinitions_command.rb} +1 -0
  61. data/lib/epc/command/{list_service_types_command.rb → servicetype/list_servicetypes_command.rb} +0 -0
  62. data/lib/epc/command/serviceversion/delete_serviceversion_command.rb +24 -0
  63. data/lib/epc/command/{list_serviceversions_command.rb → serviceversion/list_serviceversions_command.rb} +1 -1
  64. data/lib/epc/command/show_command.rb +27 -0
  65. data/lib/epc/command/show_instances_command.rb +33 -0
  66. data/lib/epc/command/show_metrics_command.rb +55 -0
  67. data/lib/epc/command/{archive_solution_command.rb → solution/archive_solution_command.rb} +2 -1
  68. data/lib/epc/command/solution/create_solution_command.rb +0 -1
  69. data/lib/epc/command/{delete_solution_command.rb → solution/delete_solution_command.rb} +5 -10
  70. data/lib/epc/command/solution/list_solutions_command.rb +1 -1
  71. data/lib/epc/command/{show_solution_command.rb → solution/show_solution_command.rb} +12 -7
  72. data/lib/epc/command/{unarchive_solution_command.rb → solution/unarchive_solution_command.rb} +1 -1
  73. data/lib/epc/command/solution/update_solution_command.rb +2 -1
  74. data/lib/epc/command/unarchive_command.rb +12 -0
  75. data/lib/epc/command/update_command.rb +15 -0
  76. data/lib/epc/command/update_rolepermissions_command.rb +2 -2
  77. data/lib/epc/command/{delete_user_command.rb → user/delete_user_command.rb} +4 -12
  78. data/lib/epc/command/{list_users_command.rb → user/list_users_command.rb} +1 -1
  79. data/lib/epc/command/{show_user_command.rb → user/show_user_command.rb} +3 -17
  80. data/lib/epc/command/{update_user_command.rb → user/update_user_command.rb} +2 -4
  81. data/lib/epc/config.rb +4 -1
  82. data/lib/epc/help.rb +50 -35
  83. data/lib/epc/runner.rb +16 -5
  84. data/lib/epc/version.rb +1 -1
  85. data/lib/epc/vertical_bar.rb +40 -0
  86. data/test/command/create_library_command_test.rb +5 -2
  87. data/test/command/create_libraryset_command_test.rb +1 -1
  88. data/test/command/create_plugin_command_test.rb +44 -0
  89. data/test/command/create_servicedefinition_command_test.rb +43 -0
  90. data/test/command/delete_config_command_test.rb +0 -11
  91. data/test/command/delete_dependency_command_test.rb +3 -11
  92. data/test/command/delete_library_command_test.rb +2 -15
  93. data/test/command/delete_librarylanguage_command_test.rb +2 -24
  94. data/test/command/delete_libraryset_command_test.rb +2 -24
  95. data/test/command/delete_plugin_command_test.rb +32 -0
  96. data/test/command/delete_project_command_test.rb +0 -6
  97. data/test/command/delete_role_command_test.rb +1 -1
  98. data/test/command/delete_serviceversion_command_test.rb +0 -22
  99. data/test/command/delete_solution_command_test.rb +4 -4
  100. data/test/command/delete_user_command_test.rb +2 -24
  101. data/test/command/list_config_command_test.rb +3 -3
  102. data/test/command/list_deployments_command_test.rb +17 -20
  103. data/test/command/list_deploymentstages_command_test.rb +2 -2
  104. data/test/command/list_metrics_command_test.rb +40 -0
  105. data/test/command/{list_rolepermissions_command_test.rb → list_permissions_command_test.rb} +2 -2
  106. data/test/command/list_plugins_command_test.rb +27 -0
  107. data/test/command/list_projects_command_test.rb +3 -5
  108. data/test/command/list_roles_command_test.rb +2 -3
  109. data/test/command/pull_command_test.rb +13 -9
  110. data/test/command/show_group_command_test.rb +1 -23
  111. data/test/command/show_instances_command_test.rb +33 -0
  112. data/test/command/show_libraryset_command_test.rb +0 -11
  113. data/test/command/show_metrics_command_test.rb +51 -0
  114. data/test/command/show_plugin_command_test.rb +28 -0
  115. data/test/command/show_project_command_test.rb +1 -1
  116. data/test/command/show_projecttype_command_test.rb +0 -5
  117. data/test/command/show_role_command_test.rb +1 -1
  118. data/test/command/show_solution_command_test.rb +1 -1
  119. data/test/command/show_user_command_test.rb +2 -22
  120. data/test/command/update_config_command_test.rb +3 -9
  121. data/test/command/{update_deploymentproject_command_test.rb → update_deployment_command_test.rb} +6 -11
  122. data/test/command/update_group_command_test.rb +1 -20
  123. data/test/command/update_librarylanguage_command_test.rb +0 -15
  124. data/test/command/update_libraryset_command_test.rb +0 -13
  125. data/test/command/update_plugin_command_test.rb +41 -0
  126. data/test/command/update_project_command_test.rb +3 -3
  127. data/test/command/update_role_command_test.rb +2 -1
  128. data/test/command/update_solution_command_test.rb +3 -9
  129. data/test/command/update_user_command_test.rb +0 -6
  130. metadata +177 -165
  131. data/lib/epc/command/define_service_command.rb +0 -37
  132. data/lib/epc/command/delete_config_command.rb +0 -63
  133. data/lib/epc/command/delete_group_command.rb +0 -40
  134. data/lib/epc/command/delete_library_command.rb +0 -30
  135. data/lib/epc/command/delete_librarylanguage_command.rb +0 -40
  136. data/lib/epc/command/delete_serviceversion_command.rb +0 -52
  137. data/lib/epc/command/list_approvals_command.rb +0 -27
  138. data/lib/epc/command/list_attachedlibraries_command.rb +0 -42
  139. data/lib/epc/command/list_boundservices_command.rb +0 -40
  140. data/lib/epc/command/list_dependencies_command.rb +0 -43
  141. data/lib/epc/command/list_deployments_command.rb +0 -68
  142. data/lib/epc/command/list_solutions_command.rb +0 -25
  143. data/lib/epc/command/show_deployment_command.rb +0 -57
  144. data/lib/epc/command/update_config_command.rb +0 -62
  145. data/lib/epc/command/update_role_command.rb +0 -47
  146. data/lib/epc/command/update_solution_command.rb +0 -45
  147. data/test/command/define_service_command_test.rb +0 -55
  148. data/test/command/delete_group_command_test.rb +0 -56
  149. data/test/command/list_approvals_command_test.rb +0 -41
  150. data/test/command/list_boundservices_command_test.rb +0 -46
  151. data/test/command/list_dependencies_command_test.rb +0 -46
  152. data/test/command/update_rolepermissions_command_test.rb +0 -54
data/lib/epc.rb CHANGED
@@ -9,6 +9,7 @@ module EPC
9
9
  autoload(:PersistentAttributes, "#{ROOT}/epc/persistent_attributes")
10
10
  autoload(:Runner, "#{ROOT}/epc/runner")
11
11
  autoload(:TabularOutputter, "#{ROOT}/epc/tabular_outputter")
12
+ autoload(:VerticalBar, "#{ROOT}/epc/vertical_bar")
12
13
 
13
14
  module Error
14
15
  autoload(:BasicError, "#{ROOT}/epc/error/basic_error")
@@ -26,52 +27,52 @@ module EPC
26
27
  module Command
27
28
  autoload(:BaseCommand, "#{ROOT}/epc/command/base_command")
28
29
  autoload(:BuildCommand, "#{ROOT}/epc/command/build_command")
29
- autoload(:ListConfigCommand, "#{ROOT}/epc/command/list_config_command")
30
+ autoload(:ListConfigsCommand, "#{ROOT}/epc/command/config/list_configs_command")
30
31
  autoload(:CreateConfigCommand, "#{ROOT}/epc/command/config/create_config_command")
31
- autoload(:UpdateConfigCommand, "#{ROOT}/epc/command/update_config_command")
32
- autoload(:DeleteConfigCommand, "#{ROOT}/epc/command/delete_config_command")
33
- autoload(:ListRuntimesCommand, "#{ROOT}/epc/command/list_runtimes_command")
34
- autoload(:ListProjectsCommand, "#{ROOT}/epc/command/list_projects_command")
32
+ autoload(:UpdateConfigCommand, "#{ROOT}/epc/command/config/update_config_command")
33
+ autoload(:DeleteConfigCommand, "#{ROOT}/epc/command/config/delete_config_command")
34
+ autoload(:ListRuntimesCommand, "#{ROOT}/epc/command/runtime/list_runtimes_command")
35
+ autoload(:ListProjectsCommand, "#{ROOT}/epc/command/project/list_projects_command")
35
36
  autoload(:CreateProjectCommand, "#{ROOT}/epc/command/project/create_project_command")
36
- autoload(:ShowProjectCommand, "#{ROOT}/epc/command/show_project_command")
37
- autoload(:UpdateProjectCommand, "#{ROOT}/epc/command/update_project_command")
38
- autoload(:DeleteProjectCommand, "#{ROOT}/epc/command/delete_project_command")
37
+ autoload(:ShowProjectCommand, "#{ROOT}/epc/command/project/show_project_command")
38
+ autoload(:UpdateProjectCommand, "#{ROOT}/epc/command/project/update_project_command")
39
+ autoload(:DeleteProjectCommand, "#{ROOT}/epc/command/project/delete_project_command")
39
40
  autoload(:AttachRuntimeCommand, "#{ROOT}/epc/command/attach_runtime_command")
40
41
  autoload(:CreateSolutionCommand, "#{ROOT}/epc/command/solution/create_solution_command")
41
- autoload(:ListSolutionsCommand, "#{ROOT}/epc/command/list_solutions_command")
42
- autoload(:ShowSolutionCommand, "#{ROOT}/epc/command/show_solution_command")
42
+ autoload(:ListSolutionsCommand, "#{ROOT}/epc/command/solution/list_solutions_command")
43
+ autoload(:ShowSolutionCommand, "#{ROOT}/epc/command/solution/show_solution_command")
43
44
  autoload(:RefreshSolutionCommand, "#{ROOT}/epc/command/refresh_solution_command")
44
- autoload(:DeleteSolutionCommand, "#{ROOT}/epc/command/delete_solution_command")
45
- autoload(:UpdateSolutionCommand, "#{ROOT}/epc/command/update_solution_command")
46
- autoload(:ArchiveSolutionCommand, "#{ROOT}/epc/command/archive_solution_command")
47
- autoload(:UnarchiveSolutionCommand, "#{ROOT}/epc/command/unarchive_solution_command")
48
- autoload(:ListServicetypesCommand, "#{ROOT}/epc/command/list_service_types_command")
49
- autoload(:DefineServiceCommand, "#{ROOT}/epc/command/define_service_command")
45
+ autoload(:DeleteSolutionCommand, "#{ROOT}/epc/command/solution/delete_solution_command")
46
+ autoload(:UpdateSolutionCommand, "#{ROOT}/epc/command/solution/update_solution_command")
47
+ autoload(:ArchiveSolutionCommand, "#{ROOT}/epc/command/solution/archive_solution_command")
48
+ autoload(:UnarchiveSolutionCommand, "#{ROOT}/epc/command/solution/unarchive_solution_command")
49
+ autoload(:ListServicetypesCommand, "#{ROOT}/epc/command/servicetype/list_servicetypes_command")
50
+ autoload(:CreateServicedefinitionCommand, "#{ROOT}/epc/command/servicedefinition/create_servicedefinition_command")
50
51
  autoload(:UndefineServiceCommand, "#{ROOT}/epc/command/undefine_service_command")
51
- autoload(:ListServicedefinitionsCommand, "#{ROOT}/epc/command/list_servicedefinitions_command")
52
+ autoload(:ListServicedefinitionsCommand, "#{ROOT}/epc/command/servicedefinition/list_servicedefinitions_command")
52
53
  autoload(:CreateServiceversionCommand, "#{ROOT}/epc/command/serviceversion/create_serviceversion_command")
53
- autoload(:ListServiceversionsCommand, "#{ROOT}/epc/command/list_serviceversions_command")
54
- autoload(:DeleteServiceversionCommand, "#{ROOT}/epc/command/delete_serviceversion_command")
54
+ autoload(:ListServiceversionsCommand, "#{ROOT}/epc/command/serviceversion/list_serviceversions_command")
55
+ autoload(:DeleteServiceversionCommand, "#{ROOT}/epc/command/serviceversion/delete_serviceversion_command")
55
56
  autoload(:BindServiceCommand, "#{ROOT}/epc/command/bind_service_command")
56
57
  autoload(:UnbindServiceCommand, "#{ROOT}/epc/command/unbind_service_command")
57
58
  autoload(:ListBoundservicesCommand, "#{ROOT}/epc/command/list_boundservices_command")
58
59
  autoload(:CreateUserCommand, "#{ROOT}/epc/command/user/create_user_command")
59
60
  autoload(:CreateDeploymentCommand, "#{ROOT}/epc/command/deployment/create_deployment_command")
60
- autoload(:ShowDeploymentCommand, "#{ROOT}/epc/command/show_deployment_command")
61
+ autoload(:ShowDeploymentCommand, "#{ROOT}/epc/command/deployment/show_deployment_command")
61
62
  autoload(:SubmitDeploymentCommand, "#{ROOT}/epc/command/submit_deployment_command")
62
63
  autoload(:VoteDeploymentCommand, "#{ROOT}/epc/command/vote_deployment_command")
63
- autoload(:ListDeploymentsCommand, "#{ROOT}/epc/command/list_deployments_command")
64
- autoload(:ListStagesCommand, "#{ROOT}/epc/command/list_stages_command")
64
+ autoload(:ListDeploymentsCommand, "#{ROOT}/epc/command/deployment/list_deployments_command")
65
+ autoload(:ListDeploymentstagesCommand, "#{ROOT}/epc/command/deploymentstage/list_deploymentstages_command")
65
66
  autoload(:DeployCommand, "#{ROOT}/epc/command/deploy_command")
66
67
  autoload(:UndeployCommand, "#{ROOT}/epc/command/undeploy_command")
67
68
  autoload(:CopyDeploymentCommand, "#{ROOT}/epc/command/copy_deployment_command")
68
69
  autoload(:ListApprovalsCommand, "#{ROOT}/epc/command/list_approvals_command")
69
70
  autoload(:CreateDependencyCommand, "#{ROOT}/epc/command/create_dependency_command")
70
71
  autoload(:ListDependenciesCommand, "#{ROOT}/epc/command/list_dependencies_command")
71
- autoload(:DeleteDependencyCommand, "#{ROOT}/epc/command/delete_dependency_command")
72
+ autoload(:DeleteDependencyCommand, "#{ROOT}/epc/command/dependency/delete_dependency_command")
72
73
  autoload(:CreateLibraryCommand, "#{ROOT}/epc/command/library/create_library_command")
73
- autoload(:ListLibrariesCommand, "#{ROOT}/epc/command/list_libraries_command")
74
- autoload(:DeleteLibraryCommand, "#{ROOT}/epc/command/delete_library_command")
74
+ autoload(:ListLibrariesCommand, "#{ROOT}/epc/command/library/list_libraries_command")
75
+ autoload(:DeleteLibraryCommand, "#{ROOT}/epc/command/library/delete_library_command")
75
76
  autoload(:AttachLibraryCommand, "#{ROOT}/epc/command/attach_library_command")
76
77
  autoload(:DetachLibraryCommand, "#{ROOT}/epc/command/detach_library_command")
77
78
  autoload(:LoginCommand, "#{ROOT}/epc/command/login_command")
@@ -80,47 +81,63 @@ module EPC
80
81
  autoload(:PushCommand, "#{ROOT}/epc/command/push_command")
81
82
  autoload(:RenewCommand, "#{ROOT}/epc/command/renew_command")
82
83
  autoload(:TargetCommand, "#{ROOT}/epc/command/target_command")
83
- autoload(:ListProjecttypesCommand, "#{ROOT}/epc/command/list_projecttypes_command")
84
- autoload(:ShowProjecttypeCommand, "#{ROOT}/epc/command/show_projecttype_command")
85
- autoload(:UpdateDeploymentprojectCommand, "#{ROOT}/epc/command/update_deploymentproject_command")
84
+ autoload(:ListProjecttypesCommand, "#{ROOT}/epc/command/projecttype/list_projecttypes_command")
85
+ autoload(:ShowProjecttypeCommand, "#{ROOT}/epc/command/projecttype/show_projecttype_command")
86
+ autoload(:UpdateDeploymentCommand, "#{ROOT}/epc/command/deployment/update_deployment_command")
86
87
  autoload(:InfoCommand, "#{ROOT}/epc/command/info_command")
87
88
  autoload(:ListVersionsCommand, "#{ROOT}/epc/command/list_versions_command")
88
- autoload(:ArchiveProjectCommand, "#{ROOT}/epc/command/archive_project_command")
89
- autoload(:UnarchiveProjectCommand, "#{ROOT}/epc/command/unarchive_project_command")
89
+ autoload(:ArchiveProjectCommand, "#{ROOT}/epc/command/project/archive_project_command")
90
+ autoload(:UnarchiveProjectCommand, "#{ROOT}/epc/command/project/unarchive_project_command")
90
91
  autoload(:ListAttachedlibrariesCommand, "#{ROOT}/epc/command/list_attachedlibraries_command")
91
92
  autoload(:CreateGroupCommand, "#{ROOT}/epc/command/group/create_group_command")
92
- autoload(:DeleteGroupCommand, "#{ROOT}/epc/command/delete_group_command")
93
- autoload(:ListGroupsCommand, "#{ROOT}/epc/command/list_groups_command")
94
- autoload(:UpdateGroupCommand, "#{ROOT}/epc/command/update_group_command")
95
- autoload(:ShowGroupCommand, "#{ROOT}/epc/command/show_group_command")
96
- autoload(:ListRolesCommand, "#{ROOT}/epc/command/list_roles_command")
97
- autoload(:DeleteRoleCommand, "#{ROOT}/epc/command/delete_role_command")
98
- autoload(:UpdateRoleCommand, "#{ROOT}/epc/command/update_role_command")
99
- autoload(:ShowRoleCommand, "#{ROOT}/epc/command/show_role_command")
100
- autoload(:ListRolepermissionsCommand, "#{ROOT}/epc/command/list_rolepermissions_command")
101
- autoload(:ListUsersCommand, "#{ROOT}/epc/command/list_users_command")
102
- autoload(:DeleteUserCommand, "#{ROOT}/epc/command/delete_user_command")
103
- autoload(:UpdateUserCommand, "#{ROOT}/epc/command/update_user_command")
104
- autoload(:ShowUserCommand, "#{ROOT}/epc/command/show_user_command")
93
+ autoload(:DeleteGroupCommand, "#{ROOT}/epc/command/group/delete_group_command")
94
+ autoload(:ListGroupsCommand, "#{ROOT}/epc/command/group/list_groups_command")
95
+ autoload(:UpdateGroupCommand, "#{ROOT}/epc/command/group/update_group_command")
96
+ autoload(:ShowGroupCommand, "#{ROOT}/epc/command/group/show_group_command")
97
+ autoload(:ListRolesCommand, "#{ROOT}/epc/command/role/list_roles_command")
98
+ autoload(:DeleteRoleCommand, "#{ROOT}/epc/command/role/delete_role_command")
99
+ autoload(:UpdateRoleCommand, "#{ROOT}/epc/command/role/update_role_command")
100
+ autoload(:UpdateObjectroleCommand, "#{ROOT}/epc/command/objectrole/update_objectrole_command")
101
+ autoload(:ShowRoleCommand, "#{ROOT}/epc/command/role/show_role_command")
102
+ autoload(:ListPermissionsCommand, "#{ROOT}/epc/command/permission/list_permissions_command")
103
+ autoload(:ListUsersCommand, "#{ROOT}/epc/command/user/list_users_command")
104
+ autoload(:DeleteUserCommand, "#{ROOT}/epc/command/user/delete_user_command")
105
+ autoload(:UpdateUserCommand, "#{ROOT}/epc/command/user/update_user_command")
106
+ autoload(:ShowUserCommand, "#{ROOT}/epc/command/user/show_user_command")
105
107
  autoload(:CreateLibrarylanguageCommand, "#{ROOT}/epc/command/librarylanguage/create_librarylanguage_command")
106
- autoload(:ListLibrarylanguagesCommand, "#{ROOT}/epc/command/list_librarylanguages_command")
107
- autoload(:DeleteLibrarylanguageCommand, "#{ROOT}/epc/command/delete_librarylanguage_command")
108
- autoload(:UpdateLibrarylanguageCommand, "#{ROOT}/epc/command/update_librarylanguage_command")
108
+ autoload(:ListLibrarylanguagesCommand, "#{ROOT}/epc/command/librarylanguage/list_librarylanguages_command")
109
+ autoload(:DeleteLibrarylanguageCommand, "#{ROOT}/epc/command/librarylanguage/delete_librarylanguage_command")
110
+ autoload(:UpdateLibrarylanguageCommand, "#{ROOT}/epc/command/librarylanguage/update_librarylanguage_command")
109
111
  autoload(:CreateLibrarysetCommand, "#{ROOT}/epc/command/libraryset/create_libraryset_command")
110
- autoload(:ShowLibrarysetCommand, "#{ROOT}/epc/command/show_libraryset_command")
111
- autoload(:ListLibrarysetsCommand, "#{ROOT}/epc/command/list_librarysets_command")
112
- autoload(:UpdateLibrarysetCommand, "#{ROOT}/epc/command/update_libraryset_command")
113
- autoload(:DeleteLibrarysetCommand, "#{ROOT}/epc/command/delete_libraryset_command")
112
+ autoload(:ShowLibrarysetCommand, "#{ROOT}/epc/command/libraryset/show_libraryset_command")
113
+ autoload(:ListLibrarysetsCommand, "#{ROOT}/epc/command/libraryset/list_librarysets_command")
114
+ autoload(:UpdateLibrarysetCommand, "#{ROOT}/epc/command/libraryset/update_libraryset_command")
115
+ autoload(:DeleteLibrarysetCommand, "#{ROOT}/epc/command/libraryset/delete_libraryset_command")
114
116
  autoload(:AttachLibrarysetCommand, "#{ROOT}/epc/command/attach_libraryset_command")
115
117
  autoload(:DetachLibrarysetCommand, "#{ROOT}/epc/command/detach_libraryset_command")
116
118
  autoload(:RequestPasswordchangeCommand, "#{ROOT}/epc/command/request_passwordchange_command")
117
- autoload(:ListObjectrolesCommand, "#{ROOT}/epc/command/list_objectroles_command")
119
+ autoload(:ListObjectrolesCommand, "#{ROOT}/epc/command/objectrole/list_objectroles_command")
118
120
  autoload(:CreateRoleCommand, "#{ROOT}/epc/command/role/create_role_command")
119
121
  autoload(:CreateObjectroleCommand, "#{ROOT}/epc/command/objectrole/create_objectrole_command")
120
- autoload(:UpdateRolepermissionsCommand, "#{ROOT}/epc/command/update_rolepermissions_command")
121
- autoload(:ListPermissiongroupsCommand, "#{ROOT}/epc/command/list_permissiongroups_command")
122
+ autoload(:ListMetricsCommand, "#{ROOT}/epc/command/list_metrics_command")
123
+ autoload(:ShowInstancesCommand, "#{ROOT}/epc/command/show_instances_command")
124
+ autoload(:ShowMetricsCommand, "#{ROOT}/epc/command/show_metrics_command")
125
+ autoload(:UpdatePermissionCommand, "#{ROOT}/epc/command/permission/update_permission_command")
126
+ autoload(:ListPermissiongroupsCommand, "#{ROOT}/epc/command/permissiongroup/list_permissiongroups_command")
122
127
  autoload(:ListObjecttypesCommand, "#{ROOT}/epc/command/list_objecttypes_command")
123
- autoload(:CreateCommand, "#{ROOT}/epc/command/create_command")
128
+ autoload(:CreatePluginCommand, "#{ROOT}/epc/command/plugin/create_plugin_command")
129
+ autoload(:ListPluginsCommand, "#{ROOT}/epc/command/plugin/list_plugins_command")
130
+ autoload(:ShowPluginCommand, "#{ROOT}/epc/command/plugin/show_plugin_command")
131
+ autoload(:UpdatePluginCommand, "#{ROOT}/epc/command/plugin/update_plugin_command")
132
+ autoload(:DeletePluginCommand, "#{ROOT}/epc/command/plugin/delete_plugin_command")
133
+
124
134
 
135
+ autoload(:CreateCommand, "#{ROOT}/epc/command/create_command")
136
+ autoload(:ListCommand, "#{ROOT}/epc/command/list_command")
137
+ autoload(:ShowCommand, "#{ROOT}/epc/command/show_command")
138
+ autoload(:UpdateCommand, "#{ROOT}/epc/command/update_command")
139
+ autoload(:DeleteCommand, "#{ROOT}/epc/command/delete_command")
140
+ autoload(:ArchiveCommand, "#{ROOT}/epc/command/archive_command")
141
+ autoload(:UnarchiveCommand, "#{ROOT}/epc/command/unarchive_command")
125
142
  end
126
143
  end
@@ -0,0 +1,12 @@
1
+ module EPC::Command
2
+ class ArchiveCommand < BaseCommand
3
+
4
+ def execute(object = nil)
5
+ @object_type, @object_id = @object.split(":") rescue [nil, nil]
6
+ raise FatalError, "Object incorrectly specified" if @object_type.blank?
7
+ klass = "EPC::Command::Archive#{@object_type.to_s.gsub("-","").capitalize}Command"
8
+ command = eval(klass).new(client, @options)
9
+ command.go(@object_id)
10
+ end
11
+ end
12
+ end
@@ -1,6 +1,5 @@
1
1
  module EPC::Command
2
2
  class AttachLibrarysetCommand < BaseCommand
3
- required_arguments_count 1, :message => "You must specify a library-set"
4
3
 
5
4
  def execute(set = nil)
6
5
  path = File.expand_path(".")
@@ -9,7 +8,7 @@ module EPC::Command
9
8
 
10
9
  raise InputError, "Project could not be inferred" if project_id.nil?
11
10
 
12
- set_id = retrieve_library_set_identifier(set)
11
+ set_id = retrieve_identifier_for("LibrarySet", set)
13
12
 
14
13
  if @options[:detach].present? && @options[:detach]
15
14
  status, response, headers = client.delete(EPC::Config::PROJECTS_PATH + "/#{project_id}/detach_set/#{set_id}")
@@ -1,6 +1,5 @@
1
1
  module EPC::Command
2
2
  class AttachRuntimeCommand < BaseCommand
3
- required_arguments_count 1, :message => "You must specify a runtime id"
4
3
  required_options :stage, :mode => :any?, :message => "You must specify the stage"
5
4
 
6
5
  def execute(runtime = nil)
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'pathname'
3
+ require 'cgi'
3
4
 
4
5
  module EPC
5
6
  module Command
@@ -11,34 +12,20 @@ module EPC
11
12
  attr_reader :options
12
13
 
13
14
  @@retrieval_rules = {
14
- :system_role => {
15
- :match_attribute => :name,
16
- :required_attribute => :id,
15
+ :Role => {
17
16
  :required_type => :numeric,
18
- :source => EPC::Config::ROLES_PATH + "/system/true"
19
17
  },
20
- :user => {
21
- :match_attribute => :name,
22
- :required_attribute => :id,
18
+ :User => {
23
19
  :required_type => :numeric,
24
- :source => EPC::Config::USERS_PATH
25
20
  },
26
- :user_group => {
27
- :match_attribute => :name,
28
- :required_attribute => :id,
21
+ :UserGroup => {
29
22
  :required_type => :numeric,
30
- :source => EPC::Config::GROUPS_PATH
31
23
  },
32
- :library_set => {
33
- :match_attribute => :name,
34
- :required_attribute => :id,
24
+ :LibrarySet => {
35
25
  :required_type => :numeric,
36
- :source => EPC::Config::LIBRARY_SETS_PATH
37
-
38
26
  }
39
27
  }
40
28
 
41
- @@required_arguments = {:count => 0}
42
29
  @@required_options = []
43
30
 
44
31
  SLEEP_TIME = 1
@@ -47,34 +34,11 @@ module EPC
47
34
  TICKER_TICKS = 25/SLEEP_TIME
48
35
  GIVEUP_TICKS = 120/SLEEP_TIME
49
36
 
50
- def method_missing(method, *args, &block)
51
- if method.to_s =~ /^retrieve_(.+)_identifier$/
52
- retrieve_identifier_for($1, *args, &block)
53
- else
54
- super
55
- end
56
- end
57
-
58
- def respond_to?(meth)
59
- if meth.to_s =~ /^retrieve_.*_identifier$/
60
- true
61
- else
62
- super
63
- end
64
- end
65
-
66
37
  def self.inherited(subklass)
67
38
  # Here login is required for all commands that inherit
68
39
  subklass.require_login
69
40
  end
70
41
 
71
- def self.required_arguments_count(count, options_hash = {})
72
- opt = {
73
- :message => "Please specify all the mandatory arguments"
74
- }.merge(options_hash)
75
- @@required_arguments = {:count => count, :message => opt[:message]}
76
- end
77
-
78
42
  def self.required_options(*opts, opt_hash)
79
43
  options_hash = {
80
44
  :mode => :any?,
@@ -96,7 +60,6 @@ module EPC
96
60
  say("You must be logged in to run this command")
97
61
  return 1
98
62
  else
99
- check_requirements(*args)
100
63
  return translate_status_to_exit_code(execute(*args))
101
64
  end
102
65
  end
@@ -139,11 +102,9 @@ module EPC
139
102
  value.respond_to?(:empty?) ? value.empty? : !value
140
103
  end
141
104
 
142
- def check_requirements(*args)
143
- raise FatalError, @@required_arguments[:message] if args.size < @@required_arguments[:count]
144
- @@required_options.each do |req_opt|
145
- raise FatalError, req_opt[:message] unless req_opt[:name].map{|opt| @options[opt].present?}.send(req_opt[:mode])
146
- end
105
+ def check_params
106
+ return if ["solution", "project"].include?(@object_type.downcase)
107
+ raise FatalError, "You need to specify the #{@object_type.downcase} identifier" if @object_id.blank?
147
108
  end
148
109
 
149
110
  def numeric?(value)
@@ -207,23 +168,42 @@ module EPC
207
168
  end
208
169
 
209
170
  def object_types
210
- return ["solution", "project"]
211
- end
212
-
213
- def retrieve_identifier_for(entity, *args, &block)
171
+ return %q(
172
+ config
173
+ dependency
174
+ deployment
175
+ deploymentstage
176
+ group
177
+ library
178
+ librarylanguage
179
+ libraryset
180
+ objectrole
181
+ permission
182
+ permissiongroup
183
+ plugin
184
+ project
185
+ projecttype
186
+ role
187
+ runtime
188
+ servicedefinition
189
+ servicetype
190
+ serviceversion
191
+ solution
192
+ user
193
+ )
194
+
195
+ end
196
+
197
+ def retrieve_identifier_for(entity, *args)
214
198
  entity = entity.to_sym
215
- match_value = args.first
199
+ match_value = args.join(":")
216
200
  raise InternalError if match_value.blank?
217
- raise InternalError unless @@retrieval_rules.keys.include?(entity)
218
- rule = @@retrieval_rules[entity]
201
+ rule = @@retrieval_rules[entity.to_sym] || {:required_type => :numeric}
219
202
  if rule[:required_type] == :numeric
220
203
  if numeric?(match_value)
221
204
  return match_value.to_i
222
- elsif
223
- entity_identifier = get_resource_attribute(rule[:source],
224
- rule[:required_attribute],
225
- rule[:match_attribute],
226
- match_value)
205
+ else
206
+ return identify_resource(entity, match_value)
227
207
  end
228
208
  end
229
209
 
@@ -231,8 +211,18 @@ module EPC
231
211
  return entity_identifier
232
212
  end
233
213
 
214
+ def identify_resource(object_type, object_identifier)
215
+ obj_identifier = CGI.escape(object_identifier).gsub(".", "%2e")
216
+ status, response, headers = client.get(EPC::Config::OBJECT_TYPES_PATH + "/identify/#{object_type}/#{obj_identifier}")
217
+ if status.successful?
218
+ return response[:id]
219
+ else
220
+ raise InputError, "Request failed: [#{object_type.capitalize} not found]"
221
+ end
222
+ end
223
+
234
224
  def infer_solution_context(s_identifier, path, options = {})
235
- if s_identifier.nil?
225
+ if s_identifier.blank?
236
226
  if EPC::Config.is_solution_dir?(path)
237
227
  solution_id = EPC::Config.get_solution_value(path, "id")
238
228
  solution_name = EPC::Config.get_solution_value(path, "name")
@@ -278,7 +268,7 @@ module EPC
278
268
  # OPTIONS:
279
269
  # :get_project_name : for when you have a numeric project_id, but you also want the name
280
270
  def infer_project_context(p_identifier, path, s_identifier = nil, options = {})
281
- if p_identifier.nil?
271
+ if p_identifier.blank?
282
272
 
283
273
  if EPC::Config.is_project_dir?(path)
284
274
  project_id = EPC::Config.get_project_value(path, "id")
@@ -291,7 +281,7 @@ module EPC
291
281
  else
292
282
 
293
283
  if numeric?(p_identifier)
294
- if !options[:get_project_name].nil? && options[:get_project_name] && !s_identifier.nil?
284
+ if !options[:get_project_name].nil? && options[:get_project_name] && s_identifier.present?
295
285
  project_name = get_resource_name(EPC::Config::SOLUTIONS_PATH + "/#{s_identifier}/projects?include=archived", :id, p_identifier)
296
286
  end
297
287
  return p_identifier, project_name
@@ -339,7 +329,6 @@ module EPC
339
329
  ids
340
330
  end
341
331
 
342
-
343
332
  def get_resource_name(url, field, field_value)
344
333
  return get_resource_attribute(url, :name, field, field_value.to_i)
345
334
  end
@@ -0,0 +1,57 @@
1
+ module EPC::Command
2
+ class DeleteConfigCommand < DeleteCommand
3
+
4
+ def execute(key = nil, target = nil, *args)
5
+
6
+ path = "."
7
+ path = File.expand_path(path)
8
+
9
+ config_type, config_id = extract_configuration_level(path, target)
10
+ request_path = EPC::Config::CONFIGURATIONS_PATH+"/#{config_type}/#{config_id}"
11
+
12
+ if ["solution", "project"].include?(config_type.downcase) && !@options[:stage_name].nil?
13
+ request_path += "/#{@options[:stage_name]}"
14
+ end
15
+
16
+ status, response, headers = client.get(request_path)
17
+
18
+ raise FatalError, "Configuration retrieval failed with [#{response[:message]}]" if status.failure?
19
+
20
+ existing_keys = response
21
+
22
+ if existing_keys.empty?
23
+ say("There are no configurations defined for this project.")
24
+ return 1
25
+ end
26
+
27
+ key_id = existing_keys.detect{|k| k[:name] == key }[:id] rescue nil
28
+ if key_id.nil?
29
+ say("#{key} is not defined.")
30
+ return 1
31
+ end
32
+
33
+ question = "Are you sure you want to delete the config value [#{key}] defined on [#{config_type}-#{config_id}"
34
+ if ["solution", "project"].include?(config_type.downcase) && !@options[:stage].nil?
35
+ question += "-#{@options[:stage]}"
36
+ end
37
+
38
+ question += "]. Correct? [Yn] "
39
+
40
+ proceed = ask_yn(question)
41
+ if proceed.upcase == 'N'
42
+ return 1
43
+ end
44
+
45
+ status, response, headers = client.delete(EPC::Config::CONFIGURATIONS_PATH + "/#{key_id}")
46
+ if status.failure?
47
+ say("Request failed: [#{response[:message]}]")
48
+ else
49
+ say("#{key} succesfully removed.")
50
+ end
51
+ return status
52
+
53
+
54
+ end
55
+
56
+ end
57
+ end