[
https://issues.apache.org/jira/browse/CLOUDSTACK-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13498673#comment-13498673
]
Prasanna Santhanam commented on CLOUDSTACK-499:
-----------------------------------------------
The serviceproviderlist is a difficult one to handle. Marvin doesn't do
anything different. However for our tests network offering life cycle is
simpified in the marvin.integration.lib:base.py
https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=blob;f=tools/marvin/marvin/integration/lib/base.py;h=5001dafb5ecf9c2f292af88079951cbc356a0276;hb=HEAD
1039 class NetworkOffering:
1040 """Manage network offerings cycle"""
1041
1042 def __init__(self, items):
1043 self.__dict__.update(items)
1044
1045 @classmethod
1046 def create(cls, apiclient, services, **kwargs):
1047 """Create network offering"""
1048
1049 cmd = createNetworkOffering.createNetworkOfferingCmd()
1050 cmd.displaytext = "-".join([services["displaytext"], random_gen()])
1051 cmd.name = "-".join([services["name"], random_gen()])
1052 cmd.guestiptype = services["guestiptype"]
1053 cmd.supportedservices = services["supportedservices"]
1054 cmd.traffictype = services["traffictype"]
1055
1056 cmd.serviceProviderList = []
1057 for service, provider in services["serviceProviderList"].items():
1058 cmd.serviceProviderList.append({
1059 'service': service,
1060 'provider': provider
1061 })
1062 if "servicecapabilitylist" in services:
1063 cmd.servicecapabilitylist = []
1064 for service, capability in
services["servicecapabilitylist"].items():
1065 for ctype, value in capability.items():
1066 cmd.servicecapabilitylist.append({
1067 'service': service,
1068 'capabilitytype': ctype,
1069 'capabilityvalue': value
1070 })
1071 if "specifyVlan" in services:
1072 cmd.specifyVlan = services["specifyVlan"]
1073 if "specifyIpRanges" in services:
1074 cmd.specifyIpRanges = services["specifyIpRanges"]
1075
1076 [setattr(cmd, k, v) for k, v in kwargs.items()]
1077
1078 return
NetworkOffering(apiclient.createNetworkOffering(cmd).__dict__)
1079
1080 def delete(self, apiclient):
1081 """Delete network offering"""
1082 cmd = deleteNetworkOffering.deleteNetworkOfferingCmd()
1083 cmd.id = self.id
1084 apiclient.deleteNetworkOffering(cmd)
1085 return
1086
1087 def update(self, apiclient, **kwargs):
1088 """Lists all available network offerings."""
1089
1090 cmd = updateNetworkOffering.updateNetworkOfferingCmd()
1091 cmd.id = self.id
1092 [setattr(cmd, k, v) for k, v in kwargs.items()]
1093 return(apiclient.updateNetworkOffering(cmd))
1094
1095 @classmethod
1096 def list(cls, apiclient, **kwargs):
1097 """Lists all available network offerings."""
1098
1099 cmd = listNetworkOfferings.listNetworkOfferingsCmd()
1100 [setattr(cmd, k, v) for k, v in kwargs.items()]
1101 return(apiclient.listNetworkOfferings(cmd))
> cloudmonkey CLI can't accept complex parameters
> -----------------------------------------------
>
> Key: CLOUDSTACK-499
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-499
> Project: CloudStack
> Issue Type: Bug
> Components: Usage
> Affects Versions: 4.1.0
> Environment: Ubuntu 12.04, KVM hypervisor
> Reporter: Dave Cahill
> Assignee: Rohit Yadav
> Labels: cloudmonkey
> Fix For: 4.1.0
>
>
> When setting up a networkoffering, there's a serviceProviderList parameter
> which is a list of items, each of which has several key value pairs.
> According to Rohit (on dev list):
> "The way maps are handled in url are very different than how cloudmonkey
> parses and passing key,values.
> This actually needs to be fixed in Marvin, I've figured out a way but it may
> cause issues with marvin, will discuss with Prasanna and fix it soon."
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira