A new role can be created by invoking the create_role() function and passing the Python dictionary that defines the role parameters:
def create_role(conn):
role_desc = {
"description":"This is a test role",
"isenabled" : True,
"name":"packtpub"
}
conn.identity.create_role(**role_desc)