Examples of IAMGroup


Examples of org.apache.cloudstack.iam.api.IAMGroup

        assertEquals("Error to retrieve group", "policy1", p.getName());
    }

    @Test
    public void addRemovePolicyToGroupTest() {
        IAMGroup group = new IAMGroupVO("group1", "tester group1");
        List<IAMGroup> groups = new ArrayList<IAMGroup>();
        groups.add(group);
        Long groupId = group.getId();
        List<Long> policyIds = new ArrayList<Long>();
        policyIds.add(100L);
        policyIds.add(200L);
        IAMPolicy policy1 = new IAMPolicyVO("policy1", "my first policy");
        IAMPolicy policy2 = new IAMPolicyVO("policy2", "my second policy");
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

    public void tearDown() {
    }

    @Test(expected = InvalidParameterValueException.class)
    public void createAclGroupTest() {
        IAMGroup group = _iamService.createIAMGroup("group1", "my first group", "/root/mydomain");
        assertNotNull("Acl group 'group1' failed to create ", group);

        IAMGroupVO group2 = new IAMGroupVO("group1", "my second group");
        when(_aclGroupDao.findByName(eq("/root/mydomain"), eq("group1"))).thenReturn(group2);

        IAMGroup group3 = _iamService.createIAMGroup("group1", "my first group", "/root/mydomain");
    }
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

    @DB
    @Override
    public IAMGroup createIAMGroup(String iamGroupName, String description, String path) {
        // check if the group is already existing
        IAMGroup grp = _aclGroupDao.findByName(path, iamGroupName);
        if (grp != null) {
            throw new InvalidParameterValueException(
                    "Unable to create acl group with name " + iamGroupName
                            + " already exisits for path " + path);
        }
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

    @Override
    public void execute() throws ResourceUnavailableException,
            InsufficientCapacityException, ServerApiException {
        CallContext.current().setEventDetails("IAM group Id: " + getId());
        IAMGroup result = _iamApiSrv.addAccountsToGroup(accountIdList, id);
        if (result != null){
            IAMGroupResponse response = _iamApiSrv.createIAMGroupResponse(result);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

    @Override
    public void execute() throws ResourceUnavailableException,
            InsufficientCapacityException, ServerApiException {
        CallContext.current().setEventDetails("IAM group Id: " + getId());
        IAMGroup result = _iamApiSrv.attachIAMPoliciesToGroup(policyIdList, id);
        if (result != null){
            IAMGroupResponse response = _iamApiSrv.createIAMGroupResponse(result);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

        if (domain != null) {
            List<IAMGroup> domainGroups = listDomainGroup(domain);
            if (domainGroups != null && !domainGroups.isEmpty()) {
                return;
            }
            IAMGroup rootDomainGrp = _iamSrv.createIAMGroup("DomainGrp-" + domain.getUuid(), "Root Domain group",
                    domain.getPath());
            // add the system accounts to the root domain group
            _iamSrv.addAccountsToGroup(sysAccts, rootDomainGrp.getId());

        }

    }
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

    @Override
    public void execute() throws ResourceUnavailableException,
            InsufficientCapacityException, ServerApiException {
        CallContext.current().setEventDetails("IAM group Id: " + getId());
        IAMGroup result = _iamApiSrv.removeIAMPoliciesFromGroup(policyIdList, id);
        if (result != null){
            IAMGroupResponse response = _iamApiSrv.createIAMGroupResponse(result);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

                                          // are tracked
    }

    @Override
    public void execute() {
        IAMGroup grp = _entityMgr.findById(IAMGroup.class, getEntityId());
        if (grp != null) {
            IAMGroupResponse response = _iamApiSrv.createIAMGroupResponse(grp);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

    }

    @Override
    public void create() throws ResourceAllocationException {
        Account account = CallContext.current().getCallingAccount();
        IAMGroup result = _iamApiSrv.createIAMGroup(account, name, description);
        if (result != null) {
            setEntityId(result.getId());
            setEntityUuid(result.getUuid());
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create iam group entity" + name);
        }

    }
View Full Code Here

Examples of org.apache.cloudstack.iam.api.IAMGroup

    @Override
    public void execute() throws ResourceUnavailableException,
            InsufficientCapacityException, ServerApiException {
        CallContext.current().setEventDetails("IAM group Id: " + getId());
        IAMGroup result = _iamApiSrv.removeAccountsFromGroup(accountIdList, id);
        if (result != null){
            IAMGroupResponse response = _iamApiSrv.createIAMGroupResponse(result);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.