You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by rashmidixit <gi...@git.apache.org> on 2017/01/06 12:30:46 UTC

[GitHub] cloudstack pull request #1894: CLOUDSTACK-9700 Allow user to Register/Copy t...

GitHub user rashmidixit opened a pull request:

    https://github.com/apache/cloudstack/pull/1894

    CLOUDSTACK-9700 Allow user to Register/Copy templates to multiple zones at the same time

    A user can currently copy or register a template with only one zone at a time.
    The idea of this feature is to allow the user to allow copying or registering of one template to multiple zones at the same time.
    
    For RegisterTemplate and CopyTemplate APIs have been modified to add a new parameter called zoneIds. This is not compulsory to keep backward compatibility.
    
    The UIs have been changes - When you add, the earlier select control for zones now is a multi select and you can choose multiple zones at the same time. 
    For CopyTemplate a new dialog has been added - this shows all the zones you can copy to and allows you to select multiple at a time.
    
    Please see [CLOUDSTACK-9700](https://issues.apache.org/jira/browse/CLOUDSTACK-9700) for more details. Snapshots of the UI have been attached there.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Accelerite/cloudstack CLOUDSTACK-9700

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1894.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1894
    
----
commit c4d97f366d0e79f97649b5574f734b3c14125281
Author: rashmidixit <ra...@persistent.co.in>
Date:   2016-07-06T12:05:47Z

    CLOUDSTACK-9700 RegisterTemplate API and Add Template UI changes to support template registration to multiple zones
    Reviewed-By Rajani K, Kaushik D, Hari P, Nitin M
    
    This change enabled to register a template
    to multiple zones in one go. The UI has been changed to allow this.
    RegisterTemplate API has also been updated for this. ~10 junit tests
    have been added to test the API.
    
    Conflicts:
    	api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
    	plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalTemplateAdapter.java
    	plugins/hypervisors/baremetal/src/com/cloud/wds/networkservice/WdsTemplateAdapter.java
    	server/src/com/cloud/template/HypervisorTemplateAdapter.java
    	server/src/com/cloud/template/TemplateAdapterBase.java
    	ui/scripts/templates.js

commit 4d5554401edfcf3da4d8b2bdf4eb458e0ac40dd4
Author: sanket_thite <sa...@accelerite.com>
Date:   2016-09-01T05:25:42Z

    CLOUDSTACK-9700 Copy Template to multiple zones Instead of Single/All Zones
    Reviewed-By: Rashmi,Rajani,Harikrishna,Nitin.
    
    Conflicts:
    	client/WEB-INF/classes/resources/messages.properties
    	server/src/com/cloud/template/TemplateManagerImpl.java
    	ui/css/cloudstack3.css
    	ui/dictionary2.jsp
    	ui/index.html

commit d92b1e4a151b60aa4440f1c741f23b275d0a6951
Author: rashmidixit <ra...@persistent.co.in>
Date:   2017-01-06T12:25:32Z

    CLOUDSTACK-9700 Added missing License information to the new files.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1894: CLOUDSTACK-9700 Allow user to Register/Copy t...

Posted by priyankparihar <gi...@git.apache.org>.
Github user priyankparihar commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1894#discussion_r104105564
  
    --- Diff: api/src/org/apache/cloudstack/api/command/admin/template/CopyTemplateCmdByAdmin.java ---
    @@ -40,11 +40,20 @@
         @Override
         public void execute() throws ResourceAllocationException{
             try {
    +            if (destZoneId == null && (destZoneIds == null || destZoneIds.size() == 0))
    +                throw new ServerApiException(ApiErrorCode.PARAM_ERROR,
    +                        "Either destzoneid or destzoneids parameters have to be specified.");
    +
    --- End diff --
    
    Error statement and conditional statement logic are not conveying same message. Some correction is required.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1894: CLOUDSTACK-9700 Allow user to Register/Copy t...

Posted by priyankparihar <gi...@git.apache.org>.
Github user priyankparihar commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1894#discussion_r104106536
  
    --- Diff: api/src/org/apache/cloudstack/api/command/admin/template/RegisterTemplateCmdByAdmin.java ---
    @@ -40,10 +40,23 @@
         @Override
         public void execute() throws ResourceAllocationException{
             try {
    +            if ((zoneId != null) && (zoneIds != null && !zoneIds.isEmpty()))
    --- End diff --
    
    Unnecessary brackets should be removed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1894: CLOUDSTACK-9700 Allow user to Register/Copy t...

Posted by rashmidixit <gi...@git.apache.org>.
Github user rashmidixit closed the pull request at:

    https://github.com/apache/cloudstack/pull/1894


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1894: CLOUDSTACK-9700 Allow user to Register/Copy template...

Posted by rashmidixit <gi...@git.apache.org>.
Github user rashmidixit commented on the issue:

    https://github.com/apache/cloudstack/pull/1894
  
    @karuturi requesting your review on this one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1894: CLOUDSTACK-9700 Allow user to Register/Copy template...

Posted by rashmidixit <gi...@git.apache.org>.
Github user rashmidixit commented on the issue:

    https://github.com/apache/cloudstack/pull/1894
  
    Attaching new screens for the changes made here.
    
    ![copytemplate-withsearchzone](https://cloud.githubusercontent.com/assets/13415006/22205048/27f14e6a-e19b-11e6-8ba3-e0d4d8e7993a.PNG)
    ![registertemplate-multiselect](https://cloud.githubusercontent.com/assets/13415006/22205050/27f24ac2-e19b-11e6-9a38-a1fc7cc62b92.PNG)
    ![registertemplate-multiselect-error](https://cloud.githubusercontent.com/assets/13415006/22205049/27f20738-e19b-11e6-8741-864d7a66691b.PNG)
    ![copytemplate-multiplezones](https://cloud.githubusercontent.com/assets/13415006/22205051/27f2761e-e19b-11e6-931a-55aba29ef0ad.PNG)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1894: CLOUDSTACK-9700 Allow user to Register/Copy t...

Posted by rashmidixit <gi...@git.apache.org>.
GitHub user rashmidixit reopened a pull request:

    https://github.com/apache/cloudstack/pull/1894

    CLOUDSTACK-9700 Allow user to Register/Copy templates to multiple zones at the same time

    A user can currently copy or register a template with only one zone at a time.
    The idea of this feature is to allow the user to allow copying or registering of one template to multiple zones at the same time.
    
    For RegisterTemplate and CopyTemplate APIs have been modified to add a new parameter called zoneIds. This is not compulsory to keep backward compatibility.
    
    The UIs have been changes - When you add, the earlier select control for zones now is a multi select and you can choose multiple zones at the same time. 
    For CopyTemplate a new dialog has been added - this shows all the zones you can copy to and allows you to select multiple at a time.
    
    Please see [CLOUDSTACK-9700](https://issues.apache.org/jira/browse/CLOUDSTACK-9700) for more details. Snapshots of the UI have been attached there.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Accelerite/cloudstack CLOUDSTACK-9700

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack/pull/1894.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1894
    
----
commit 95bf9f0f5b640f6673606e7f56fce39654e16fff
Author: rashmidixit <ra...@persistent.co.in>
Date:   2017-02-28T06:33:07Z

    CLOUDSTACK-9700: Allow user to Register/Copy templates to multiple zones at the same time

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack issue #1894: CLOUDSTACK-9700 Allow user to Register/Copy template...

Posted by priyankparihar <gi...@git.apache.org>.
Github user priyankparihar commented on the issue:

    https://github.com/apache/cloudstack/pull/1894
  
    @rashmidixit can you run internal CI and post @cloudmonger test results?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1894: CLOUDSTACK-9700 Allow user to Register/Copy t...

Posted by priyankparihar <gi...@git.apache.org>.
Github user priyankparihar commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1894#discussion_r104105003
  
    --- Diff: api/src/org/apache/cloudstack/api/ResponseGenerator.java ---
    @@ -307,7 +307,11 @@
     
         TemplateResponse createTemplateUpdateResponse(ResponseView view, VirtualMachineTemplate result);
     
    -    List<TemplateResponse> createTemplateResponses(ResponseView view, VirtualMachineTemplate result, Long zoneId, boolean readyOnly);
    +    List<TemplateResponse> createTemplateResponses(ResponseView view, VirtualMachineTemplate result,
    +                                                   Long zoneId, boolean readyOnly);
    --- End diff --
    
    what is difference between line 310 and 311 ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack pull request #1894: CLOUDSTACK-9700 Allow user to Register/Copy t...

Posted by priyankparihar <gi...@git.apache.org>.
Github user priyankparihar commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1894#discussion_r104114043
  
    --- Diff: api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java ---
    @@ -51,25 +52,46 @@
         @Parameter(name = ApiConstants.DESTINATION_ZONE_ID,
                    type = CommandType.UUID,
                    entityType = ZoneResponse.class,
    -               required = true,
    +               required = false,
                    description = "ID of the zone the template is being copied to.")
    -    private Long destZoneId;
    +    protected Long destZoneId;
     
    -    @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class, required = true, description = "Template ID.")
    +    @Parameter(name = ApiConstants.ID, type = CommandType.UUID,
    +            entityType = TemplateResponse.class, required = true, description = "Template ID.")
         private Long id;
     
         @Parameter(name = ApiConstants.SOURCE_ZONE_ID,
                    type = CommandType.UUID,
                    entityType = ZoneResponse.class,
    -            description = "ID of the zone the template is currently hosted on. If not specified and template is cross-zone, then we will sync this template to region wide image store.")
    +            description = "ID of the zone the template is currently hosted on. " +
    +                    "If not specified and template is cross-zone, " +
    +                    "then we will sync this template to region wide image store.")
    --- End diff --
    
    This change is not required. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---