Exemplo n.º 1
0
 def build_entity(self):
     return otypes.Group(
         domain=otypes.Domain(
             name=self._module.params['authz_name']
         ),
         name=self._module.params['name'],
         namespace=self._module.params['namespace'],
     )
def test_add_ldap_group(engine_api):
    engine = engine_api.system_service()
    groups_service = engine.groups_service()
    with engine_utils.wait_for_event(engine, 149):  # USER_ADD(149)
        groups_service.add(
            types.Group(
                name=AAA_LDAP_GROUP,
                domain=types.Domain(name=AAA_LDAP_AUTHZ_PROVIDER),
            ), )
Exemplo n.º 3
0
    def build_entity(self):
        entity = self._group(
        ) if self._module.params['group_name'] else self._user()

        return otypes.Permission(
            user=otypes.User(
                id=entity.id) if self._module.params['user_name'] else None,
            group=otypes.Group(
                id=entity.id) if self._module.params['group_name'] else None,
            role=otypes.Role(name=self._module.params['role']),
        )
Exemplo n.º 4
0
def add_ldap_group(api):
    engine = api.system_service()
    groups_service = engine.groups_service()

    groups_service.add(
        types.Group(
            name=AAA_LDAP_GROUP,
            domain=types.Domain(
                name=AAA_LDAP_AUTHZ_PROVIDER
            ),
        ),
    )
Exemplo n.º 5
0
def test_add_ldap_group(api_v4):
    engine = api_v4.system_service()
    groups_service = engine.groups_service()
    with test_utils.TestEvent(engine, 149): # USER_ADD(149)
        groups_service.add(
            types.Group(
                name=AAA_LDAP_GROUP,
                domain=types.Domain(
                    name=AAA_LDAP_AUTHZ_PROVIDER
                ),
            ),
        )
Exemplo n.º 6
0
logging.basicConfig(level=logging.DEBUG, filename='example.log')

# This example will connect to the server and add a group from a directory service:
# Create the connection to the server:
connection = sdk.Connection(
    url='https://engine40.example.com/ovirt-engine/api',
    username='******',
    password='******',
    ca_file='ca.pem',
    debug=True,
    log=logging.getLogger(),
)

# Get the reference to the groups service:
groups_service = connection.system_service().groups_service()

# Use the "add" method to add group from a directory service.
# Please note that domain name is name of the authorization provider (authz):
group = groups_service.add(
    types.Group(
        name='mygroup',
        domain=types.Domain(
            name='internal-authz'
        ),
    ),
)

# Close the connection to the server:
connection.close()
Exemplo n.º 7
0
import ovirtsdk4 as sdk
import ovirtsdk4.types as types

logging.basicConfig(level=logging.DEBUG, filename='example.log')

# This example will connect to the server and add a group from a directory service:
# Create the connection to the server:
connection = sdk.Connection(
    url='https://engine40.example.com/ovirt-engine/api',
    username='******',
    password='******',
    ca_file='ca.pem',
    debug=True,
    log=logging.getLogger(),
)

# Get the reference to the groups service:
groups_service = connection.system_service().groups_service()

# Use the "add" method to add group from a directory service.
# Please note that domain name is name of the authorization provider (authz):
group = groups_service.add(
    types.Group(
        name='Developers',
        domain=types.Domain(name='internal-authz'),
    ), )

# Close the connection to the server:
connection.close()