[
https://issues.apache.org/jira/browse/CLOUDSTACK-9351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15276030#comment-15276030
]
ASF GitHub Bot commented on CLOUDSTACK-9351:
--------------------------------------------
Github user koushik-das commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1497#discussion_r62456142
--- Diff: test/integration/smoke/test_list_ids_parameter.py ---
@@ -0,0 +1,293 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+""" Tests for API listing methods using 'ids' parameter
+"""
+#Import Local Modules
+from marvin.cloudstackTestCase import cloudstackTestCase
+from marvin.lib.utils import (cleanup_resources,
+ validateList)
+from marvin.lib.base import (Account,
+ Volume,
+ DiskOffering,
+ Template,
+ ServiceOffering,
+ Snapshot,
+ VmSnapshot,
+ VirtualMachine)
+from marvin.lib.common import (get_domain,
+ get_zone, get_template)
+from marvin.codes import FAILED, PASS
+from nose.plugins.attrib import attr
+#Import System modules
+import time
+
+_multiprocess_shared_ = True
+class TestListIdsParams(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ testClient = super(TestListIdsParams, cls).getClsTestClient()
+ cls.apiclient = testClient.getApiClient()
+ cls.services = testClient.getParsedTestDataConfig()
+ cls.hypervisor = testClient.getHypervisorInfo()
+
+ cls.domain = get_domain(cls.apiclient)
+ cls.zone = get_zone(cls.apiclient, testClient.getZoneForTests())
+
+ cls.disk_offering = DiskOffering.create(
+ cls.apiclient,
+ cls.services["disk_offering"]
+ )
+
+ cls.account = Account.create(
+ cls.apiclient,
+ cls.services["account"],
+ domainid=cls.domain.id
+ )
+ cls.service_offering = ServiceOffering.create(
+ cls.apiclient,
+
cls.services["service_offerings"]["tiny"]
+ )
+
+ template = get_template(
+ cls.apiclient,
+ cls.zone.id,
+ cls.services["ostype"]
+ )
+ if template == FAILED:
+ assert False, "get_template() failed to return template with
description %s" % cls.services["ostype"]
+
+ cls.services["template"]["ostypeid"] = template.ostypeid
+ cls.services["template_2"]["ostypeid"] = template.ostypeid
+ cls.services["ostypeid"] = template.ostypeid
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+ cls.services["mode"] = cls.zone.networktype
+
+ #Create 3 VMs
+ cls.virtual_machine_1 = VirtualMachine.create(
+ cls.apiclient,
+ cls.services["virtual_machine"],
+ templateid=template.id,
+ accountid=cls.account.name,
+ domainid=cls.account.domainid,
+ serviceofferingid=cls.service_offering.id,
+ mode=cls.services["mode"]
+ )
+ cls.virtual_machine_2 = VirtualMachine.create(
+ cls.apiclient,
+ cls.services["virtual_machine"],
+ templateid=template.id,
+ accountid=cls.account.name,
+ domainid=cls.account.domainid,
+ serviceofferingid=cls.service_offering.id,
+ mode=cls.services["mode"]
+ )
+ cls.virtual_machine_3 = VirtualMachine.create(
+ cls.apiclient,
+ cls.services["virtual_machine"],
+ templateid=template.id,
+ accountid=cls.account.name,
+ domainid=cls.account.domainid,
+ serviceofferingid=cls.service_offering.id,
+ mode=cls.services["mode"]
+ )
+
+ #Sleep for 12 minutes after vms creation because of bug while
taking snapshots.
+ time.sleep(720)
--- End diff --
Please remove sleep and disable vm snapshot tests for now.
> Add ids parameter to resource listing API calls
> -----------------------------------------------
>
> Key: CLOUDSTACK-9351
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9351
> Project: CloudStack
> Issue Type: Improvement
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: API
> Affects Versions: 4.9.0
> Reporter: Nicolas Vazquez
> Fix For: 4.9.0
>
>
> h2. General behaviour
> A new parameter is added in each method, its type a list of IDs of the
> entity, it will be mutually exclusive with id. (Similar to {{id}} and {{ids}}
> parameters in {{listVirtualMachines}} method)
> h3. API Methods affected
> * +{{listTemplates}}+: new parameter *{{ids}}*, mutually exclusive with {{id}}
> * +{{listVolumes}}+: new parameter *{{ids}}*, mutually exclusive with {{id}}
> * +{{listSnapshots}}+: new parameter *{{ids}}*, mutually exclusive with {{id}}
> * +{{listVMSnapshots}}+: new parameter *{{vmsnapshotids}}*, mutually
> exclusive with {{vmsnapshotid}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)