Package com.cloud.stack.models

Examples of com.cloud.stack.models.CloudStackTemplatePermission


        EC2ImageAttributes imageAtts = new EC2ImageAttributes();

        try {
            imageAtts.setImageId(request.getImageId());
            if(request.getAttribute().equals(ImageAttribute.launchPermission)){
                CloudStackTemplatePermission tempPerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
                if(tempPerm != null){
                    imageAtts.setDomainId(tempPerm.getDomainId());

                    List<String> accntList = tempPerm.getAccounts();
                    imageAtts.setAccountNamesWithLaunchPermission(accntList);

                    imageAtts.setIsPublic(tempPerm.getIsPublic());
                }
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                EC2DescribeImagesResponse descriptionResp = new EC2DescribeImagesResponse();
                listTemplates(request.getImageId(), descriptionResp);
                if(descriptionResp.getImageSet() != null){
View Full Code Here


        EC2ImageAttributes imageAtts = new EC2ImageAttributes();

        try {
            imageAtts.setImageId(request.getImageId());
            if (request.getAttribute().equals(ImageAttribute.launchPermission)) {
                CloudStackTemplatePermission tempPerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
                if (tempPerm != null) {
                    imageAtts.setDomainId(tempPerm.getDomainId());

                    List<String> accntList = tempPerm.getAccounts();
                    imageAtts.setAccountNamesWithLaunchPermission(accntList);

                    imageAtts.setIsPublic(tempPerm.getIsPublic());
                }
            } else if (request.getAttribute().equals(ImageAttribute.description)) {
                EC2DescribeImagesResponse descriptionResp = new EC2DescribeImagesResponse();
                listTemplates(request.getImageId(), descriptionResp);
                if (descriptionResp.getImageSet() != null) {
View Full Code Here

     * @return
     */
    public EC2DescribeImageAttributesResponse describeImageAttributes(EC2DescribeImageAttributes request) {
        EC2DescribeImageAttributesResponse resp = new EC2DescribeImageAttributesResponse();
        try {
            CloudStackTemplatePermission csTemplatePerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
            resp.setDomainId(csTemplatePerm.getDomainId());
            resp.setId(csTemplatePerm.getId());
            resp.setIsPublic(csTemplatePerm.getIsPublic());
            if (csTemplatePerm.getAccounts() != null) {
                for (CloudStackAccount acct : csTemplatePerm.getAccounts()) {
                    resp.addAccount(acct.getName());
                }
            }
            return resp;
        } catch (Exception e) {
View Full Code Here

        EC2ImageAttributes imageAtts = new EC2ImageAttributes();

        try {
            imageAtts.setImageId(request.getImageId());
            if(request.getAttribute().equals(ImageAttribute.launchPermission)){
                CloudStackTemplatePermission tempPerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
                if(tempPerm != null){
                    imageAtts.setDomainId(tempPerm.getDomainId());

                    List<String> accntList = tempPerm.getAccounts();
                    imageAtts.setAccountNamesWithLaunchPermission(accntList);

                    imageAtts.setIsPublic(tempPerm.getIsPublic());
                }
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                EC2DescribeImagesResponse descriptionResp = new EC2DescribeImagesResponse();
                listTemplates(request.getImageId(), descriptionResp);
                if(descriptionResp.getImageSet() != null){
View Full Code Here

        EC2ImageAttributes imageAtts = new EC2ImageAttributes();
       
        try {
            imageAtts.setImageId(request.getImageId());
            if(request.getAttribute().equals(ImageAttribute.launchPermission)){
                CloudStackTemplatePermission tempPerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
                if(tempPerm != null){
                    imageAtts.setDomainId(tempPerm.getDomainId());
                   
                    List<String> accntList = tempPerm.getAccounts();
                    imageAtts.setAccountNamesWithLaunchPermission(accntList);
                   
                    imageAtts.setIsPublic(tempPerm.getIsPublic());
                }
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                EC2DescribeImagesResponse descriptionResp = new EC2DescribeImagesResponse();
                listTemplates(request.getImageId(), descriptionResp);
                if(descriptionResp.getImageSet() != null){
View Full Code Here

        EC2ImageAttributes imageAtts = new EC2ImageAttributes();

        try {
            imageAtts.setImageId(request.getImageId());
            if(request.getAttribute().equals(ImageAttribute.launchPermission)){
                CloudStackTemplatePermission tempPerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
                if(tempPerm != null){
                    imageAtts.setDomainId(tempPerm.getDomainId());

                    List<String> accntList = tempPerm.getAccounts();
                    imageAtts.setAccountNamesWithLaunchPermission(accntList);

                    imageAtts.setIsPublic(tempPerm.getIsPublic());
                }
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                EC2DescribeImagesResponse descriptionResp = new EC2DescribeImagesResponse();
                listTemplates(request.getImageId(), descriptionResp);
                if(descriptionResp.getImageSet() != null){
View Full Code Here

        EC2ImageAttributes imageAtts = new EC2ImageAttributes();

        try {
            imageAtts.setImageId(request.getImageId());
            if(request.getAttribute().equals(ImageAttribute.launchPermission)){
                CloudStackTemplatePermission tempPerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
                if(tempPerm != null){
                    imageAtts.setDomainId(tempPerm.getDomainId());

                    List<String> accntList = tempPerm.getAccounts();
                    imageAtts.setAccountNamesWithLaunchPermission(accntList);

                    imageAtts.setIsPublic(tempPerm.getIsPublic());
                }
            }else if(request.getAttribute().equals(ImageAttribute.description)){
                EC2DescribeImagesResponse descriptionResp = new EC2DescribeImagesResponse();
                listTemplates(request.getImageId(), descriptionResp);
                if(descriptionResp.getImageSet() != null){
View Full Code Here

TOP

Related Classes of com.cloud.stack.models.CloudStackTemplatePermission

Copyright © 2018 www.massapicom. 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.