Revision 9d84caa4 kamaki/cli/commands/astakos.py

b/kamaki/cli/commands/astakos.py
52 52
resource_commands = CommandTree(
53 53
    'resource', 'Astakos/Account API commands for resources')
54 54
project_commands = CommandTree('project', 'Astakos project API commands')
55
membership_commands = CommandTree(
56
    'membership', 'Astakos project membership API commands')
55 57

  
56 58

  
57 59
#  Optional
......
64 66

  
65 67
_commands = [
66 68
    user_commands, quota_commands, resource_commands, project_commands,
67
    service_commands, commission_commands, endpoint_commands]
69
    service_commands, commission_commands, endpoint_commands,
70
    membership_commands]
68 71

  
69 72

  
70 73
def with_temp_token(func):
......
821 824
    action = 'cancel'
822 825

  
823 826

  
824
@command(project_commands)
825
class project_membership(_init_synnefo_astakosclient):
827
@command(membership_commands)
828
class membership(_init_synnefo_astakosclient):
826 829
    """Project membership management commands"""
827 830

  
828 831

  
829
@command(project_commands)
830
class project_membership_list(_init_synnefo_astakosclient, _optional_json):
832
@command(membership_commands)
833
class membership_list(_init_synnefo_astakosclient, _optional_json):
831 834
    """List all memberships"""
832 835

  
833 836
    arguments = dict(
......
844 847
        self._run()
845 848

  
846 849

  
847
@command(project_commands)
848
class project_membership_info(_init_synnefo_astakosclient, _optional_json):
850
@command(membership_commands)
851
class membership_info(_init_synnefo_astakosclient, _optional_json):
849 852
    """Details on a membership"""
850 853

  
851 854
    @errors.generic.all
......
874 877
        self._run(membership_id, quote_a_reason)
875 878

  
876 879

  
877
@command(project_commands)
878
class project_membership_leave(_membership_action):
880
@command(membership_commands)
881
class membership_leave(_membership_action):
879 882
    """Leave a project you have membership to"""
880 883
    action = 'leave'
881 884

  
882 885

  
883
@command(project_commands)
884
class project_membership_cancel(_membership_action):
886
@command(membership_commands)
887
class membership_cancel(_membership_action):
885 888
    """Cancel your (probably pending) membership to a project"""
886 889
    action = 'cancel'
887 890

  
888 891

  
889
@command(project_commands)
890
class project_membership_accept(_membership_action):
892
@command(membership_commands)
893
class membership_accept(_membership_action):
891 894
    """Accept a membership for a project you manage"""
892 895
    action = 'accept'
893 896

  
894 897

  
895
@command(project_commands)
896
class project_membership_reject(_membership_action):
898
@command(membership_commands)
899
class membership_reject(_membership_action):
897 900
    """Reject a membership for a project you manage"""
898 901
    action = 'reject'
899 902

  
900 903

  
901
@command(project_commands)
902
class project_membership_remove(_membership_action):
904
@command(membership_commands)
905
class membership_remove(_membership_action):
903 906
    """Remove a membership for a project you manage"""
904 907
    action = 'remove'
905 908

  
906 909

  
907
@command(project_commands)
908
class project_membership_join(_init_synnefo_astakosclient):
910
@command(membership_commands)
911
class membership_join(_init_synnefo_astakosclient):
909 912
    """Join a project"""
910 913

  
911 914
    @errors.generic.all
......
914 917
        self.writeln(self.client.join_project(project_id))
915 918

  
916 919
    def main(self, project_id):
917
        super(project_membership_join, self)._run()
920
        super(membership_join, self)._run()
918 921
        self._run(project_id)
919 922

  
920 923

  
921
@command(project_commands)
922
class project_membership_enroll(_init_synnefo_astakosclient):
924
@command(membership_commands)
925
class membership_enroll(_init_synnefo_astakosclient):
923 926
    """Enroll somebody to a project you manage"""
924 927

  
925 928
    @errors.generic.all
......
928 931
        self.writeln(self.client.enroll_member(project_id, email))
929 932

  
930 933
    def main(self, project_id, email):
931
        super(project_membership_join, self)._run()
934
        super(membership_join, self)._run()
932 935
        self._run(project_id, email)

Also available in: Unified diff