PHP Classes

File: Example.php

Recommend this page to a friend!
  Classes of Mostafa Abd-El-Hamid   PHP Openstack   Example.php   Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Openstack
Manage Openstack projects, users and roles
Author: By
Last change:
Date: 9 years ago
Size: 4,357 bytes
 

Contents

Class file image Download
<?php

namespace __MY_NAME_SPACE__;
use
__OPENSTACK_HANDLE__;

class
Example{

    const
OPENSTACKLib = 'OpenstackAuthController.php';

    public static function
__createProject(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__projectCrud('create', 'admin', 'Project Description Goes Here', NULL);
    }
    public static function
__enableProject(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__projectCrud('enable', NULL, NULL, 'admin');
    }
    public static function
__disableProject(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__projectCrud('disable', NULL, NULL, 'admin');
    }
    public static function
__updateProject(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__projectCrud('update', 'admin', NULL, 'admin');
    }
    public static function
__showProject(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__projectCrud('show', NULL, NULL, 'admin');
    }
    public static function
__deleteProject(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__projectCrud('delete', NULL, NULL, 'admin');
    }
    public static function
__getProjectsList(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__projectCrud();
    }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

   
public static function __createUser(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__userCrud('create', 'admin', 'admin_pass', 'admin', 'NULL', 'manon@germany.de');
    }
    public static function
__disableUser(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__userCrud('disable', NULL, NULL, 'admin', 'NULL', NULL);
    }
    public static function
__enableUser(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__userCrud('enable', NULL, NULL, 'admin', 'NULL', NULL);
    }
    public static function
__updateUser(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__userCrud('update', NULL, NULL, 'admin', 'newAdmin', 'manonnew@germany.de');
    }
    public static function
__deleteUser(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__userCrud('delete', NULL, NULL, 'admin', NULL, NULL);
    }
    public static function
__getUsersList(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__userCrud();
    }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
   
   
public static function __createRole(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__roleManage('create', 'rolename', NULL, NULL);
    }
    public static function
__assignRole(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__roleManage('assign', 'rolename', 'tenantname', 'username');
    }
    public static function
__showRoleOfUser(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__roleManage('showRoleOfUser', NULL, 'tenantname', 'username');
    }
    public static function
__verifyRole(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__roleManage('verify', 'rolename', NULL, NULL);
    }
    public static function
__showRole(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__roleManage('show', 'rolename', NULL, NULL);
    }
    public static function
__removeRole(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__roleManage('remove', 'rolename', 'tenantname', 'username');
    }
    public static function
__listRoles(){
        require \
__MY_NAME_SPACE__\Example::OPENSTACKLib;
        \
__OPENSTACK_HANDLE__\OpenstackAuthController::__roleManage();
    }

}