def create(cls, group=None, category=None): """ Method creates a new security group in database & returns the uuid of the created group :param group: :param category: :return: """ # Create the security group in given cloud try: cloud_provider = CloudProvider(category).provider secgroup = cloud_provider.create_secgroup(group) if secgroup: uuid = secgroup.id return uuid else: print("Failed to create security group, {}".format(secgroup)) except Exception as e: print("Exception creating security group in cloud, {}".format(e)) return None
def create(cls, group=None, category=None): """ Method creates a new security group in database & returns the uuid of the created group :param group: :param category: :return: """ # Create the security group in given cloud try: cloud_provider = CloudProvider(category).provider secgroup = cloud_provider.create_secgroup(group) if secgroup: uuid = secgroup.id return uuid else: print("Failed to create security group, {}".format(secgroup)) except Exception as e: print( "Exception creating security group in cloud, {}".format(e)) return None
def add_group_cloud(cls, cloud, groupname): provider = CloudProvider(cloud).provider return provider.create_secgroup(groupname)