~soren/nova/lp658257

« back to all changes in this revision

Viewing changes to nova/db/api.py

  • Committer: Tarmac
  • Author(s): Soren Hansen
  • Date: 2010-10-04 19:23:38 UTC
  • mfrom: (306.3.5 redisectomy)
  • Revision ID: hudson@openstack.org-20101004192338-ga19zarvlnbmvk2g
A shiny, new Auth driver backed by SQLAlchemy. Read it and weep. I did.

Show diffs side-by-side

added added

removed removed

Lines of Context:
570
570
###################
571
571
 
572
572
 
 
573
def user_get(context, id):
 
574
    """Get user by id"""
 
575
    return IMPL.user_get(context, id)
 
576
 
 
577
 
 
578
def user_get_by_uid(context, uid):
 
579
    """Get user by uid"""
 
580
    return IMPL.user_get_by_uid(context, uid)
 
581
 
 
582
 
 
583
def user_get_by_access_key(context, access_key):
 
584
    """Get user by access key"""
 
585
    return IMPL.user_get_by_access_key(context, access_key)
 
586
 
 
587
 
 
588
def user_create(context, values):
 
589
    """Create a new user"""
 
590
    return IMPL.user_create(context, values)
 
591
 
 
592
 
 
593
def user_delete(context, id):
 
594
    """Delete a user"""
 
595
    return IMPL.user_delete(context, id)
 
596
 
 
597
 
 
598
def user_get_all(context):
 
599
    """Create a new user"""
 
600
    return IMPL.user_get_all(context)
 
601
 
 
602
 
 
603
def user_add_role(context, user_id, role):
 
604
    """Add another global role for user"""
 
605
    return IMPL.user_add_role(context, user_id, role)
 
606
 
 
607
 
 
608
def user_remove_role(context, user_id, role):
 
609
    """Remove global role from user"""
 
610
    return IMPL.user_remove_role(context, user_id, role)
 
611
 
 
612
 
 
613
def user_get_roles(context, user_id):
 
614
    """Get global roles for user"""
 
615
    return IMPL.user_get_roles(context, user_id)
 
616
 
 
617
 
 
618
def user_add_project_role(context, user_id, project_id, role):
 
619
    """Add project role for user"""
 
620
    return IMPL.user_add_project_role(context, user_id, project_id, role)
 
621
 
 
622
 
 
623
def user_remove_project_role(context, user_id, project_id, role):
 
624
    """Remove project role from user"""
 
625
    return IMPL.user_remove_project_role(context, user_id, project_id, role)
 
626
 
 
627
 
 
628
def user_get_roles_for_project(context, user_id, project_id):
 
629
    """Return list of roles a user holds on project"""
 
630
    return IMPL.user_get_roles_for_project(context, user_id, project_id)
 
631
 
 
632
 
 
633
def user_update(context, user_id, values):
 
634
    """Update user"""
 
635
    return IMPL.user_update(context, user_id, values)
 
636
 
 
637
 
 
638
def project_get(context, id):
 
639
    """Get project by id"""
 
640
    return IMPL.project_get(context, id)
 
641
 
 
642
 
 
643
def project_create(context, values):
 
644
    """Create a new project"""
 
645
    return IMPL.project_create(context, values)
 
646
 
 
647
 
 
648
def project_add_member(context, project_id, user_id):
 
649
    """Add user to project"""
 
650
    return IMPL.project_add_member(context, project_id, user_id)
 
651
 
 
652
 
 
653
def project_get_all(context):
 
654
    """Get all projects"""
 
655
    return IMPL.project_get_all(context)
 
656
 
 
657
 
 
658
def project_get_by_user(context, user_id):
 
659
    """Get all projects of which the given user is a member"""
 
660
    return IMPL.project_get_by_user(context, user_id)
 
661
 
 
662
 
 
663
def project_remove_member(context, project_id, user_id):
 
664
    """Remove the given user from the given project"""
 
665
    return IMPL.project_remove_member(context, project_id, user_id)
 
666
 
 
667
 
 
668
def project_update(context, project_id, values):
 
669
    """Update Remove the given user from the given project"""
 
670
    return IMPL.project_update(context, project_id, values)
 
671
 
 
672
 
 
673
def project_delete(context, project_id):
 
674
    """Delete project"""
 
675
    return IMPL.project_delete(context, project_id)
 
676
 
 
677
 
 
678
###################
 
679
 
 
680
 
573
681
def host_get_networks(context, host):
574
682
    """Return all networks for which the given host is the designated
575
683
    network host
576
684
    """
577
685
    return IMPL.host_get_networks(context, host)
578
686
 
579