2016-03-31

Start building an IoT gateway HTTPS program on the Ubuntu Linux platform



Many ARM IoT platforms support Ubuntu Linux. Once we've selected an IoT gateway hardware board, we then can put this image into the board and start running Ubuntu. This Ubuntu on an IoT board actually is just like your desktop PC. It provides web browser, editors,.., and so on. Once we link the board into internet and enable the auto ethernet from the desktop, we can start our development of the https application program.

First, we should download an openssl example program:

http://www.ibm.com/developerworks/linux/library/l-openssl.html

Then we can start the trial as follows:

-Edit sources.list file
$ sudo vi /etc/apt/sources.list
Insert the following lines:
deb http://ports.ubuntu.com/ubuntu-ports/ trusty main universe restricted
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe


-Update apt-get
$ sudo apt-get update

-Install gcc and libxml2
$ sudo apt-get install gcc
$ sudo apt-get install libxml2-dev


-Compile program
$ gcc test.c -I/usr/include/libxml2 -lxml2 -o test

-Test program
$ ./test


-Install libssl,pkg-config

$ sudo apt-get install libssl
$ sudo apt-get install pkg-config


-Check libs needed by libssl

$ pkg-config --libs libssl
-lssl -lcrypto



-Compile and link libs

$ gcc nossl.c -I/usr/include -lssl -lcrypto

2016-03-29

The Key Components of a Perfect Pitch to Your Investors

    There is an article  "The 7 Key Components of a Perfect Elevator Pitch" posted by Noah Parsons at the bplans website. It mentions that there are seven key components that must be listed on our pitch to the investors. We'd better cover these seven topics on an A4 size paper as an abstract and present it to our target audiences within 60 seconds. 60 divided by 7, that's about eight seconds for each topic.  It means that one or two sentences for each topic.

    Most of the time we always started with what do we want to do, what our products/services are. But the first thing we should think about is: what is the problem we'd like to solve. If no problem can be solved by our products then there will be no feasible business to do.

    Once we have a problem to solve, then we can describe how do our products/services solve it. And to whom do we sell our products/services.

    Goals are clear now. We now need to find out who is standing between customers and us. They are the barriers of our business. We must identify them to differentiate ourselves and create a unique selling point.

   Finally, we should describe who are our team members, how much money we are going to spend and how long will we achieve our goals.



Reference:

http://articles.bplans.com/the-7-key-components-of-a-perfect-elevator-pitch/

My Notes:
-Problem
-Solution
-Target market
-Competition
-Team
-Financial summary
-Milestones

 

 

 

 

 


2016-03-24

CubicPower New York Maze: a 3D street VR viewer

Let's try to click the CubicPower New York Maze Index-Aa as follows:

http://www.cubicpower.idv.tw/BigData/NewYorkMaze/locations/Aa.htm

We can see lots of names with an Aa prefix and the street names  like:


New York Maze index-Aa


  • AA Bus-E Broadway New York
  • AA Ichiban Sushi-7th Ave New York
  • AA Ichiban-W 28th St New York
  • AA Nails Spa-Pine St New York
  • AA Stylist Barber Shop-34th Ave New York
  • AAA Ami Vegetarian-2nd Ave New York
  • AAA Architectural Hardware-W 46th St New York
  • Aaa Auto Body Shop-W 38th St New York
  • AAA Cleaners-Ave A New York
  • AAA Dental PC-W 48th St New York
  • Aaa Glass Plus-Avenue C New York
  • AAA Ichiban Sushi-Orchard St New York
  • AAA Laundry-2nd Ave New York
  • AAA Marrakech-E 7th Street New York
  • AAA Range INC-W-37th St New York
  • Aaa Super Nail Salon Incorporated-3rd Ave New York
  • AAA Towing Service-351st New York
  • AAA-Broadway New York
  • A AAA Alliance Moving Inc-St 102 Albemarle New York
  • A A A Apple Dell Gateway Repair & Data Recovery-W 71st Street New York
  • A A A Federal Home & Building Inspections-York
  • AABC Plumbing-East 112 St New York
  • Aabc Plumbing-W 35th St New York
  • AAC Realty Corporation-Flatbush Ave New York
  •  ......


    Click any of them like AA Bus, then we can see a map at the top of the screen and a 3D WebGL VR scene of street beneath.



    Click the 3D view,hold the left button and move the mouse forward. Actually you are moving the camera forward. Then try to move the camera backward. You will see a bigger view angle of the street.


     Or, you can also use the up, down ,left or right keys to move the camera around the street.
    Finally, let's keep pressing the down key and see what's happening.



    2016-03-20

    Future Value Interest Factor Of Annuity (FVIFA) Calculator

    Future Value Interest Factor Of Annuity (FVIFA) Calculator is used to compute an annuity. An annuity is a series of equal payments at regular intervals.For example, if we pay one dollar at the start of  every 5 periods with an interest rate of 5% period, we can input these two numbers into the calculator and click Send button. Then we can get a returned number 5.525631. It means that  at the end of 5 periods, we will have 5.525631 dollars.

    http://www.cubicpower.idv.tw/php/Mobile/EN/FutureValueInterestFactorOfAnnuityMobile.php




    2016-03-18

    CubicPower Future Value Interest Factor (FVIF) calculator

    Future Value Interest Factor (FVIF) is used to compute the future value of money. We simply need to input the interest rate and period and click Send button. Then we can see a red number on the top of the screen. This FVIF number means that one dollar over that period of time will become how much in this interest rate.  If we want to calculate 10000 dollars will become how much, we simply multiply this FVIF number by 10000.

    We can try it now from the CubicPower:

    http://www.cubicpower.idv.tw/php/Mobile/EN/FutureValueInterestFactorMobile.php


    2016-03-17

    CubicPower online IRR (Internal Rate of Return) Calculator

     CubicPower online IRR (Internal Rate of Return) Calculator is a very useful tool for different applications. By inputting cash flows of many periods, the app will compute the equivalent return rate of the whole period of time.
    The first application of IRR is for the project financial planning. To balance, whether the project is worth to invest,a good IRR number is very important.
    The next application is for insurance. If we want to evaluate the interest rate of an insurance plan, we can input the money we pay and the money returned from the insurance company of all periods and the press execute to get an IRR number from the CubicPower online IRR Calculator.

    http://www.cubicpower.idv.tw/php/Mobile/EN/InternalRateOfReturnMobileEN.php

    .

    2016-03-13

    Openstack code study of keystone auth and catalog

    Here we study the keystone functional units: auth and catalog.
    The auth takes  care of oauth1,password,saml2 and token.
    The catalog handles kvs and sql back end drivers for the functions create/update/delete/list of the data by region, service and endpoint.

    The classes and methods of auth and catalog are listed as follows:(Click the def link can see the detailed python code on the CubicPower.)

    \OpenStack\keystone-2014.1\keystone\auth\controllers.py

    def load_auth_methods():
    def get_auth_method(method_name):
    class AuthInfo(object):
        def create(context, auth=None):
        def __init__(self, context, auth=None):
        def _assert_project_is_enabled(self, project_ref):
        def _assert_domain_is_enabled(self, domain_ref):
        def _lookup_domain(self, domain_info):
        def _lookup_project(self, project_info):
        def _lookup_trust(self, trust_info):
        def _validate_and_normalize_scope_data(self):
        def _validate_auth_methods(self):
        def _validate_and_normalize_auth_data(self):
        def get_method_names(self):
        def get_method_data(self, method):
        def get_scope(self):
        def set_scope(self, domain_id=None, project_id=None, trust=None):
    class Auth(controller.V3Controller):
        def __init__(self, *args, **kw):
        def authenticate_for_token(self, context, auth=None):
        def _check_and_set_default_scoping(self, auth_info, auth_context):
        def authenticate(self, context, auth_info, auth_context):
        def check_token(self, context):
        def revoke_token(self, context):
        def validate_token(self, context):
        def revocation_list(self, context, auth=None):
    def render_token_data_response(token_id, token_data, created=False):

    \OpenStack\keystone-2014.1\keystone\auth\core.py

    class AuthMethodHandler(object):
        def __init__(self):
        def authenticate(self, context, auth_payload, auth_context):

    \OpenStack\keystone-2014.1\keystone\auth\plugins\external.py

    class Base(auth.AuthMethodHandler):
        def authenticate(self, context, auth_info, auth_context):
        def _authenticate(self, remote_user, context):
    class DefaultDomain(Base):
        def _authenticate(self, remote_user, context):
    class Domain(Base):
        def _authenticate(self, remote_user, context):
    class ExternalDefault(DefaultDomain):
        def __init__(self):
    class ExternalDomain(Domain):
        def __init__(self):
    class LegacyDefaultDomain(Base):
        def __init__(self):
        def _authenticate(self, remote_user, context):
    class LegacyDomain(Base):
        def __init__(self):
        def _authenticate(self, remote_user, context):

    \OpenStack\keystone-2014.1\keystone\auth\plugins\oauth1.py

    class OAuth(auth.AuthMethodHandler):
        def authenticate(self, context, auth_info, auth_context):

    \OpenStack\keystone-2014.1\keystone\auth\plugins\password.py

    class UserAuthInfo(object):
        def create(auth_payload):
        def __init__(self):
        def _assert_domain_is_enabled(self, domain_ref):
        def _assert_user_is_enabled(self, user_ref):
        def _lookup_domain(self, domain_info):
        def _validate_and_normalize_auth_data(self, auth_payload):
    class Password(auth.AuthMethodHandler):
        def authenticate(self, context, auth_payload, user_context):

    \OpenStack\keystone-2014.1\keystone\auth\plugins\saml2.py

    class Saml2(auth.AuthMethodHandler):
        def authenticate(self, context, auth_payload, auth_context):
        def _handle_scoped_token(self, auth_payload):
        def _handle_unscoped_token(self, context, auth_payload):
        def _validate_expiration(self, token_ref):
        def _validate_groups(self, group_ids, mapping_id):
        def _get_assertion_params_from_env(self, context):

    \OpenStack\keystone-2014.1\keystone\auth\plugins\token.py

    class Token(auth.AuthMethodHandler):
        def __init__(self):
        def authenticate(self, context, auth_payload, user_context):

    \OpenStack\keystone-2014.1\keystone\auth\plugins\__init__.py

    \OpenStack\keystone-2014.1\keystone\auth\routers.py

    def append_v3_routers(mapper, routers):

    \OpenStack\keystone-2014.1\keystone\auth\__init__.py

    \OpenStack\keystone-2014.1\keystone\catalog\backends\kvs.py

    class Catalog(kvs.Base, catalog.Driver):
        def get_catalog(self, user_id, tenant_id, metadata=None):
        def _delete_child_regions(self, region_id):
        def _check_parent_region(self, region_ref):
        def create_region(self, region):
        def list_regions(self):
        def get_region(self, region_id):
        def update_region(self, region_id, region):
        def delete_region(self, region_id):
        def create_service(self, service_id, service):
        def list_services(self, hints):
        def get_service(self, service_id):
        def update_service(self, service_id, service):
        def delete_service(self, service_id):
        def create_endpoint(self, endpoint_id, endpoint):
        def list_endpoints(self, hints):
        def get_endpoint(self, endpoint_id):
        def update_endpoint(self, endpoint_id, endpoint):
        def delete_endpoint(self, endpoint_id):
        def _create_catalog(self, user_id, tenant_id, data):
        def get_v3_catalog(self, user_id, tenant_id, metadata=None):

    \OpenStack\keystone-2014.1\keystone\catalog\backends\sql.py

    class Region(sql.ModelBase, sql.DictBase):
    class Service(sql.ModelBase, sql.DictBase):
    class Endpoint(sql.ModelBase, sql.DictBase):
    class Catalog(catalog.Driver):
        def db_sync(self, version=None):
        def list_regions(self):
        def _get_region(self, session, region_id):
        def _delete_child_regions(self, session, region_id):
        def _check_parent_region(self, session, region_ref):
        def get_region(self, region_id):
        def delete_region(self, region_id):
        def create_region(self, region_ref):
        def update_region(self, region_id, region_ref):
        def list_services(self, hints):
        def _get_service(self, session, service_id):
        def get_service(self, service_id):
        def delete_service(self, service_id):
        def create_service(self, service_id, service_ref):
        def update_service(self, service_id, service_ref):
        def create_endpoint(self, endpoint_id, endpoint_ref):
        def delete_endpoint(self, endpoint_id):
        def _get_endpoint(self, session, endpoint_id):
        def get_endpoint(self, endpoint_id):
        def list_endpoints(self, hints):
        def update_endpoint(self, endpoint_id, endpoint_ref):
        def get_catalog(self, user_id, tenant_id, metadata=None):
        def get_v3_catalog(self, user_id, tenant_id, metadata=None):
            def make_v3_endpoint(endpoint):

    \OpenStack\keystone-2014.1\keystone\catalog\backends\templated.py

    def parse_templates(template_lines):
    class Catalog(kvs.Catalog):
        def __init__(self, templates=None):
        def _load_templates(self, template_file):
        def get_catalog(self, user_id, tenant_id, metadata=None):
        def get_v3_catalog(self, user_id, tenant_id, metadata=None):
    class TemplatedCatalog(Catalog):

    \OpenStack\keystone-2014.1\keystone\catalog\backends\__init__.py

    \OpenStack\keystone-2014.1\keystone\catalog\controllers.py

    class Service(controller.V2Controller):
        def get_services(self, context):
        def get_service(self, context, service_id):
        def delete_service(self, context, service_id):
        def create_service(self, context, OS_KSADM_service):
    class Endpoint(controller.V2Controller):
        def get_endpoints(self, context):
        def create_endpoint(self, context, endpoint):
        def delete_endpoint(self, context, endpoint_id):
    class RegionV3(controller.V3Controller):
        def create_region_with_id(self, context, region_id, region):
        def create_region(self, context, region):
        def list_regions(self, context):
        def get_region(self, context, region_id):
        def update_region(self, context, region_id, region):
        def delete_region(self, context, region_id):
    class ServiceV3(controller.V3Controller):
        def __init__(self):
        def _validate_service(self, service):
        def create_service(self, context, service):
        def list_services(self, context, filters):
        def get_service(self, context, service_id):
        def update_service(self, context, service_id, service):
        def delete_service(self, context, service_id):
    class EndpointV3(controller.V3Controller):
        def __init__(self):
        def filter_endpoint(cls, ref):
        def wrap_member(cls, context, ref):
        def _validate_endpoint(self, endpoint):
        def create_endpoint(self, context, endpoint):
        def list_endpoints(self, context, filters):
        def get_endpoint(self, context, endpoint_id):
        def update_endpoint(self, context, endpoint_id, endpoint):
        def delete_endpoint(self, context, endpoint_id):

    \OpenStack\keystone-2014.1\keystone\catalog\core.py

    def format_url(url, data):
    class Manager(manager.Manager):
        def __init__(self):
        def create_region(self, region_ref):
        def get_region(self, region_id):
        def delete_region(self, region_id):
        def create_service(self, service_id, service_ref):
        def get_service(self, service_id):
        def delete_service(self, service_id):
        def list_services(self, hints=None):
        def create_endpoint(self, endpoint_id, endpoint_ref):
        def delete_endpoint(self, endpoint_id):
        def get_endpoint(self, endpoint_id):
        def list_endpoints(self, hints=None):
        def get_catalog(self, user_id, tenant_id, metadata=None):
    class Driver(object):
        def _get_list_limit(self):
        def create_region(self, region_ref):
        def list_regions(self):
        def get_region(self, region_id):
        def update_region(self, region_id):
        def delete_region(self, region_id):
        def create_service(self, service_id, service_ref):
        def list_services(self):
        def get_service(self, service_id):
        def update_service(self, service_id):
        def delete_service(self, service_id):
        def create_endpoint(self, endpoint_id, endpoint_ref):
        def get_endpoint(self, endpoint_id):
        def list_endpoints(self):
        def update_endpoint(self, endpoint_id, endpoint_ref):
        def delete_endpoint(self, endpoint_id):
        def get_catalog(self, user_id, tenant_id, metadata=None):
        def get_v3_catalog(self, user_id, tenant_id, metadata=None):

    \OpenStack\keystone-2014.1\keystone\catalog\routers.py

    def append_v3_routers(mapper, routers):

    \OpenStack\keystone-2014.1\keystone\catalog\__init__.py

    2016-03-11

    CubicPower Channel Q: Robot Math-1 plus 1 equals 2

    To get the concept of number,we can map the 1 to one block. And then map the 2 to two blocks.
    Therefore  "1 plus 1 equals 2" means that adding one block to another block will get two blocks.


    Another way is to count fingers. One finger plus one finger equals to two fingers.

    CubicPower Channel Q-Addition(Chao-Yih Hsia Animation)

















    Setup a WordPress LAMP Web Server on your Raspberry Pi

    The Raspberry Pi is one of the most popular ARM CPU boards for makers. Although it's not as powerful as a desktop PC, but it's still able to act as a web server. Just a little bit slow. .

    Once we've set up our own Wordpress site, we also have a LAMP(Linux, Apache, MySQL, PHP) stack on our board. We can put our PHP programs to collect data from the devices and store them into the local database.

    There is a formal tutorial page on the Raspberry Pi web site as follows:



    My Summarized Notes:

    Install Apache

    sudo apt-get install apache2 -y
     

    Changing the default web page

    cd /var/www/html 
    ls -al
     sudo chown pi: index.html
      

    Install PHP

    sudo apt-get install php5 libapache2-mod-php5 -y
      

    Install MySQL

    sudo apt-get install mysql-server php5-mysql -y
      

    Download and Extract WordPress


    cd /var/www/html/ 
    sudo chown pi: . 
    sudo rm * 
    wget http://wordpress.org/latest.tar.gz

     
    tar xzf latest.tar.gz
    mv wordpress/* .
    rm -rf wordpress latest.tar.gz
     

    Set up your WordPress Database


    mysql -uroot -ppassword  
     mysql> create database wordpress;

    Exit out of the MySQL prompt with Ctrl + D.

    WordPress Configuration

    Find out your Pi's IP address
    hostname -I

    Navigate to
    http://YOUR-IP-ADDRESS


    ......

    2016-03-10

    OpenStack Code Study: keystone-2014.1

    [Mark Hsia's Blog] OpenStack Code Study: keystone-2014.1

    Keystone is in charge of login and privilege control of the OpenStack.
    Here we list the python class and def declarations of the Keystone. It could be easily understood, which parts of the function have done by keystone.

    First, we show  \keystone\assignment. Three types of back end drivers are included here: kvs, ldap and sql. They take care of creating,deleting,updating,listing the project/role/grant/user/group/domain.

    Clicking the link will bring you to the python code of that function on the CubicPower.

    OpenStack Study: keystone

    OpenStack Index

    \OpenStack\keystone-2014.1\keystone\assignment\backends\kvs.py

    class Assignment(kvs.Base, assignment.Driver):
        def get_project(self, tenant_id):
        def _build_project_refs(self):
        def list_projects(self, hints):
        def list_projects_in_domain(self, domain_id):
        def get_project_by_name(self, tenant_name, domain_id):
        def list_user_ids_for_project(self, tenant_id):
        def _get_metadata(self, user_id=None, tenant_id=None, domain_id=None, group_id=None):
        def get_role(self, role_id):
        def list_roles(self, hints):
        def _list_roles(self):
        def list_projects_for_user(self, user_id, group_ids, hints):
        def get_roles_for_groups(self, group_ids, project_id=None, domain_id=None):
        def list_projects_for_groups(self, group_ids):
        def list_domains_for_groups(self, group_ids):
        def add_role_to_user_and_project(self, user_id, tenant_id, role_id):
        def remove_role_from_user_and_project(self, user_id, tenant_id, role_id):
        def list_role_assignments(self):
        def create_project(self, tenant_id, tenant):
        def update_project(self, tenant_id, tenant):
        def delete_project(self, tenant_id):
        def _create_metadata(self, user_id, tenant_id, metadata, domain_id=None, group_id=None):
        def _update_metadata(self, user_id, tenant_id, metadata, domain_id=None, group_id=None):
        def create_role(self, role_id, role):
        def update_role(self, role_id, role):
        def delete_role(self, role_id):
        def create_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def list_grants(self, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def get_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def delete_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def create_domain(self, domain_id, domain):
        def list_domains(self, hints):
        def get_domain(self, domain_id):
        def get_domain_by_name(self, domain_name):
        def update_domain(self, domain_id, domain):
        def delete_domain(self, domain_id):
        def delete_user(self, user_id):
        def delete_group(self, group_id):

    \OpenStack\keystone-2014.1\keystone\assignment\backends\ldap.py

    class Assignment(assignment.Driver):
        def __init__(self):
        def get_project(self, tenant_id):
        def list_projects(self, hints):
        def list_projects_in_domain(self, domain_id):
        def get_project_by_name(self, tenant_name, domain_id):
        def create_project(self, tenant_id, tenant):
        def update_project(self, tenant_id, tenant):
        def _get_metadata(self, user_id=None, tenant_id=None, domain_id=None, group_id=None):
            def _get_roles_for_just_user_and_project(user_id, tenant_id):
            def _get_roles_for_group_and_project(group_id, project_id):
        def get_role(self, role_id):
        def list_roles(self, hints):
        def list_projects_for_user(self, user_id, group_ids, hints):
        def get_roles_for_groups(self, group_ids, project_id=None, domain_id=None):
        def list_projects_for_groups(self, group_ids):
        def list_domains_for_groups(self, group_ids):
        def list_user_ids_for_project(self, tenant_id):
        def _subrole_id_to_dn(self, role_id, tenant_id):
        def add_role_to_user_and_project(self, user_id, tenant_id, role_id):
        def _add_role_to_group_and_project(self, group_id, tenant_id, role_id):
        def create_role(self, role_id, role):
        def delete_role(self, role_id):
        def delete_project(self, tenant_id):
        def remove_role_from_user_and_project(self, user_id, tenant_id, role_id):
        def _remove_role_from_group_and_project(self, group_id, tenant_id, role_id):
        def update_role(self, role_id, role):
        def create_domain(self, domain_id, domain):
        def get_domain(self, domain_id):
        def update_domain(self, domain_id, domain):
        def delete_domain(self, domain_id):
        def list_domains(self, hints):
        def delete_user(self, user_id):
        def delete_group(self, group_id):
        def create_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def get_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def delete_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def list_grants(self, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def get_domain_by_name(self, domain_name):
        def list_role_assignments(self):
    class ProjectApi(common_ldap.EnabledEmuMixIn, common_ldap.BaseLdap):
        def __init__(self, conf):
        def create(self, values):
        def get_user_projects(self, user_dn, associations):
        def add_user(self, tenant_id, user_dn):
        def remove_user(self, tenant_id, user_dn, user_id):
        def get_user_dns(self, tenant_id, rolegrants, role_dn=None):
        def update(self, project_id, values):
    class UserRoleAssociation(object):
        def __init__(self, user_dn=None, role_dn=None, tenant_dn=None, *args, **kw):
    class GroupRoleAssociation(object):
        def __init__(self, group_dn=None, role_dn=None, tenant_dn=None, *args, **kw):
    class RoleApi(common_ldap.BaseLdap):
        def __init__(self, conf):
        def get(self, role_id, role_filter=None):
        def create(self, values):
        def add_user(self, role_id, role_dn, user_dn, user_id, tenant_id=None):
        def delete_user(self, role_dn, user_dn, tenant_dn, user_id, role_id):
        def get_role_assignments(self, tenant_dn):
        def list_global_roles_for_user(self, user_dn):
        def list_project_roles_for_user(self, user_dn, project_subtree):
        def roles_delete_subtree_by_project(self, tenant_dn):
        def update(self, role_id, role):
        def delete(self, role_id, tenant_dn):
        def list_role_assignments(self, project_tree_dn):

    \OpenStack\keystone-2014.1\keystone\assignment\backends\sql.py

    class Assignment(assignment.Driver):
        def db_sync(self, version=None):
        def _get_project(self, session, project_id):
        def get_project(self, tenant_id):
        def get_project_by_name(self, tenant_name, domain_id):
        def list_user_ids_for_project(self, tenant_id):
        def _get_metadata(self, user_id=None, tenant_id=None, domain_id=None, group_id=None, session=None):
        def create_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
            def calculate_type(user_id, group_id, project_id, domain_id):
        def list_grants(self, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def _build_grant_filter(self, session, role_id, user_id, group_id, domain_id, project_id, inherited_to_projects):
        def get_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def delete_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def list_projects(self, hints):
        def list_projects_in_domain(self, domain_id):
        def list_projects_for_user(self, user_id, group_ids, hints):
            def _project_ids_to_dicts(session, ids):
        def get_roles_for_groups(self, group_ids, project_id=None, domain_id=None):
        def _list_entities_for_groups(self, group_ids, entity):
        def list_projects_for_groups(self, group_ids):
        def list_domains_for_groups(self, group_ids):
        def add_role_to_user_and_project(self, user_id, tenant_id, role_id):
        def remove_role_from_user_and_project(self, user_id, tenant_id, role_id):
        def list_role_assignments(self):
            def denormalize_role(ref):
        def create_project(self, tenant_id, tenant):
        def update_project(self, tenant_id, tenant):
        def delete_project(self, tenant_id):
        def create_domain(self, domain_id, domain):
        def list_domains(self, hints):
        def _get_domain(self, session, domain_id):
        def get_domain(self, domain_id):
        def get_domain_by_name(self, domain_name):
        def update_domain(self, domain_id, domain):
        def delete_domain(self, domain_id):
        def create_role(self, role_id, role):
        def list_roles(self, hints):
        def _get_role(self, session, role_id):
        def get_role(self, role_id):
        def update_role(self, role_id, role):
        def delete_role(self, role_id):
        def delete_user(self, user_id):
        def delete_group(self, group_id):
    class Domain(sql.ModelBase, sql.DictBase):
    class Project(sql.ModelBase, sql.DictBase):
    class Role(sql.ModelBase, sql.DictBase):
    class RoleAssignment(sql.ModelBase, sql.DictBase):
        def to_dict(self):

    \OpenStack\keystone-2014.1\keystone\assignment\backends\__init__.py

    \OpenStack\keystone-2014.1\keystone\assignment\controllers.py

    class Tenant(controller.V2Controller):
        def get_all_projects(self, context, **kw):
        def get_projects_for_token(self, context, **kw):
        def get_project(self, context, tenant_id):
        def get_project_by_name(self, context, tenant_name):
        def create_project(self, context, tenant):
        def update_project(self, context, tenant_id, tenant):
        def delete_project(self, context, tenant_id):
        def get_project_users(self, context, tenant_id, **kw):
        def _format_project_list(self, tenant_refs, **kwargs):
    class Role(controller.V2Controller):
        def get_user_roles(self, context, user_id, tenant_id=None):
        def get_role(self, context, role_id):
        def create_role(self, context, role):
        def delete_role(self, context, role_id):
        def get_roles(self, context):
        def add_role_to_user(self, context, user_id, role_id, tenant_id=None):
        def remove_role_from_user(self, context, user_id, role_id, tenant_id=None):
        def get_role_refs(self, context, user_id):
        def create_role_ref(self, context, user_id, role):
        def delete_role_ref(self, context, user_id, role_ref_id):
    class DomainV3(controller.V3Controller):
        def __init__(self):
        def create_domain(self, context, domain):
        def list_domains(self, context, filters):
        def get_domain(self, context, domain_id):
        def update_domain(self, context, domain_id, domain):
        def delete_domain(self, context, domain_id):
    class ProjectV3(controller.V3Controller):
        def __init__(self):
        def create_project(self, context, project):
        def list_projects(self, context, filters):
        def list_user_projects(self, context, filters, user_id):
        def get_project(self, context, project_id):
        def update_project(self, context, project_id, project):
        def delete_project(self, context, project_id):
    class RoleV3(controller.V3Controller):
        def __init__(self):
        def create_role(self, context, role):
        def list_roles(self, context, filters):
        def get_role(self, context, role_id):
        def update_role(self, context, role_id, role):
        def delete_role(self, context, role_id):
        def _require_domain_xor_project(self, domain_id, project_id):
        def _require_user_xor_group(self, user_id, group_id):
        def _check_if_inherited(self, context):
        def _check_grant_protection(self, context, protection, role_id=None, user_id=None, group_id=None, domain_id=None, project_id=None):
        def create_grant(self, context, role_id, user_id=None, group_id=None, domain_id=None, project_id=None):
        def list_grants(self, context, user_id=None, group_id=None, domain_id=None, project_id=None):
        def check_grant(self, context, role_id, user_id=None, group_id=None, domain_id=None, project_id=None):
        def revoke_grant(self, context, role_id, user_id=None, group_id=None, domain_id=None, project_id=None):
    class RoleAssignmentV3(controller.V3Controller):
        def wrap_member(cls, context, ref):
        def _format_entity(self, context, entity):
        def _expand_indirect_assignments(self, context, refs):
            def _get_group_members(ref):
            def _build_user_assignment_equivalent_of_group( user, group_id, template):
            def _build_project_equivalent_of_user_domain_role( project_id, domain_id, template):
            def _build_project_equivalent_of_group_domain_role( user_id, group_id, project_id, domain_id, template):
        def _query_filter_is_true(self, filter_value):
        def _filter_inherited(self, entry):
        def list_role_assignments(self, context, filters):
        def get_role_assignment(self, context):
        def update_role_assignment(self, context):
        def delete_role_assignment(self, context):

    \OpenStack\keystone-2014.1\keystone\assignment\core.py

    def calc_default_domain():
    class Manager(manager.Manager):
        def __init__(self):
        def create_project(self, tenant_id, tenant):
        def _disable_project(self, tenant_id):
        def update_project(self, tenant_id, tenant):
        def delete_project(self, tenant_id):
        def get_roles_for_user_and_project(self, user_id, tenant_id):
            def _get_group_project_roles(user_id, project_ref):
            def _get_user_project_roles(user_id, project_ref):
        def get_roles_for_user_and_domain(self, user_id, domain_id):
            def _get_group_domain_roles(user_id, domain_id):
            def _get_user_domain_roles(user_id, domain_id):
        def add_user_to_project(self, tenant_id, user_id):
        def remove_user_from_project(self, tenant_id, user_id):
        def list_projects_for_user(self, user_id, hints=None):
        def get_domain(self, domain_id):
        def get_domain_by_name(self, domain_name):
        def create_domain(self, domain_id, domain):
        def list_domains(self, hints=None):
        def _disable_domain(self, domain_id):
        def update_domain(self, domain_id, domain):
        def delete_domain(self, domain_id):
        def _delete_domain_contents(self, domain_id):
        def list_projects(self, hints=None):
        def list_projects_in_domain(self, domain_id):
        def list_user_projects(self, user_id, hints=None):
        def get_project(self, project_id):
        def get_project_by_name(self, tenant_name, domain_id):
        def get_role(self, role_id):
        def create_role(self, role_id, role):
        def list_roles(self, hints=None):
        def update_role(self, role_id, role):
        def delete_role(self, role_id):
        def list_role_assignments_for_role(self, role_id=None):
        def remove_role_from_user_and_project(self, user_id, tenant_id, role_id):
        def delete_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def _delete_tokens_for_role(self, role_id):
    class Driver(object):
        def _role_to_dict(self, role_id, inherited):
        def _roles_from_role_dicts(self, dict_list, inherited):
        def _add_role_to_role_dicts(self, role_id, inherited, dict_list, allow_existing=True):
        def _remove_role_from_role_dicts(self, role_id, inherited, dict_list):
        def _get_list_limit(self):
        def get_project_by_name(self, tenant_name, domain_id):
        def list_user_ids_for_project(self, tenant_id):
        def add_role_to_user_and_project(self, user_id, tenant_id, role_id):
        def remove_role_from_user_and_project(self, user_id, tenant_id, role_id):
        def create_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def list_grants(self, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def get_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def delete_grant(self, role_id, user_id=None, group_id=None, domain_id=None, project_id=None, inherited_to_projects=False):
        def list_role_assignments(self):
        def create_domain(self, domain_id, domain):
        def list_domains(self, hints):
        def get_domain(self, domain_id):
        def get_domain_by_name(self, domain_name):
        def update_domain(self, domain_id, domain):
        def delete_domain(self, domain_id):
        def create_project(self, project_id, project):
        def list_projects(self, hints):
        def list_projects_in_domain(self, domain_id):
        def list_projects_for_user(self, user_id, group_ids, hints):
        def get_roles_for_groups(self, group_ids, project_id=None, domain_id=None):
        def list_projects_for_groups(self, group_ids):
        def list_domains_for_groups(self, group_ids):
        def get_project(self, project_id):
        def update_project(self, project_id, project):
        def delete_project(self, project_id):
        def create_role(self, role_id, role):
        def list_roles(self, hints):
        def get_role(self, role_id):
        def update_role(self, role_id, role):
        def delete_role(self, role_id):
        def delete_user(self, user_id):
        def delete_group(self, group_id):
        def _set_default_domain(self, ref):
        def _validate_default_domain(self, ref):
        def _validate_default_domain_id(self, domain_id):

    \OpenStack\keystone-2014.1\keystone\assignment\routers.py

    class Public(wsgi.ComposableRouter):
        def add_routes(self, mapper):
    class Admin(wsgi.ComposableRouter):
        def add_routes(self, mapper):
    def append_v3_routers(mapper, routers):

    \OpenStack\keystone-2014.1\keystone\assignment\__init__.py