Creates a new server security group.

        :param str name:  The name of the security group to create.
        :param str desc:  A short description of the group.
767396
def create_secgroup(self, name, desc):
        
        self.nova.security_groups.create(name, desc)
931611
def create(username, groups = '', opts = {})
      payload = {
        :account => {
          :username => username,
          :comment  => '',
          :groups   => groups,
          :password => password_opts.merge(opts.fetch(:password, {}))
        }
      }
      @server.commands.get(post(payload)['command']['id'])
    end
1037487
def cli(env, name, description):
    """"""
    mgr = SoftLayer.NetworkManager(env.client)

    result = mgr.create_securitygroup(name, description)
    table = formatting.KeyValueTable(['name', 'value'])
    table.align['name'] = 'r'
    table.align['value'] = 'l'
    table.add_row(['id', result['id']])
    table.add_row(['name',
                   result.get('name') or formatting.blank()])
    table.add_row(['description',
                   result.get('description') or formatting.blank()])
    table.add_row(['created', result['createDate']])

    env.fout(table)
533948
def create(gandi, resource, flags, algorithm, public_key):
    """"""

    result = gandi.dnssec.create(resource, flags, algorithm, public_key)

    return result
284084
def create(self, name, desc):
        
        body = {'security_group': {'name': name,
                                   'description': desc,
                                   'tenant_id': self.request.user.project_id}}
        secgroup = self.client.create_security_group(body)
        return SecurityGroup(secgroup.get('security_group'))
244416
def CreateGroup(self, GroupName):
        
        groups = self.CustomGroups
        self._DoCommand('CREATE GROUP %s' % tounicode(GroupName))
        for g in self.CustomGroups:
            if g not in groups and g.DisplayName == GroupName:
                return g
        raise SkypeError(0, 'Group creating failed')
1060032
def _check_security_groups(self, names):
        
        self._init_os_api()
        log.debug("Checking existence of security group(s) %s ...", names)
        try:
            # python-novaclient < 8.0.0
            security_groups = self.nova_client.security_groups.list()
            existing = set(sg.name for sg in security_groups)
        except AttributeError:
            security_groups = self.neutron_client.list_security_groups()['security_groups']
            existing = set(sg[u'name'] for sg in security_groups)

        # TODO: We should be able to create the security group if it
        # doesn't exist and at least add a rule to accept ssh access.
        # Also, we should be able to add new rules to a security group
        # if needed.
        nonexisting = set(names) - existing
        if nonexisting:
            raise SecurityGroupError(
                "Security group(s) `{0}` do not exist"
                .format(', '.join(nonexisting)))

        # if we get to this point, all sec groups exist
        return True
133941
def create_security_group
      aws_ec2 = ec2_obj

      name = nil

      loop do
        name = 'chef-workflow-' + (0..rand(10).to_i).map { rand(0..9).to_s }.join("")

        if_debug(3) do
          $stderr.puts "Seeing if security group name #{name} is taken"
        end

        break unless aws_ec2.security_groups.filter('group-name', [name]).first
        sleep 0.3
      end

      group = aws_ec2.security_groups.create(name)

      security_group_open_ports.each do |port|
        group.authorize_ingress(:tcp, port)
        group.authorize_ingress(:udp, port)
      end

      group.authorize_ingress(:tcp, (0..65535), group)
      group.authorize_ingress(:udp, (0..65535), group)

      # XXX I think the name should be enough, but maybe this'll cause a problem.
      File.binwrite(security_group_setting_path, Marshal.dump([name]))
      return [name]
    end
1057338
def create_name_and_type(self, name: str, descriptor: str) -> NameAndType:
        
        self.append((
            12,
            self.create_utf8(name).index,
            self.create_utf8(descriptor).index
        ))
        return self.get(self.raw_count - 1)
955328
def create_groups(self, *names, **kwargs):
        """"""
        return tuple(self.create_group(name, **kwargs) for name in names)
249452
def _check_security_group(self, name):
        
        connection = self._connect()

        filters = {}
        if self._vpc:
            filters = {'vpc-id': self._vpc_id}

        security_groups = connection.get_all_security_groups(filters=filters)

        matching_groups = [
            group
            for group
             in security_groups
             if name in [group.name, group.id]
        ]
        if len(matching_groups) == 0:
            raise SecurityGroupError(
                "the specified security group %s does not exist" % name)
        elif len(matching_groups) == 1:
            return matching_groups[0].id
        elif self._vpc and len(matching_groups) > 1:
            raise SecurityGroupError(
                "the specified security group name %s matches "
                "more than one security group" % name)
10009
def update_security_group(self, sec_grp, name=None, desc=None):
        '''
        
        '''
        sec_grp_id = self._find_security_group_id(sec_grp)
        body = {'security_group': {}}
        if name:
            body['security_group']['name'] = name
        if desc:
            body['security_group']['description'] = desc
        return self.network_conn.update_security_group(sec_grp_id,
                                                       body=body)
345724
def create_group(self, name):
        
        url = 'rest/api/2/group'
        data = {'name': name}

        return self.post(url, data=data)
641481
def secgroup_delete(self, name):
        '''
        
        '''
        nt_ks = self.compute_conn
        for item in nt_ks.security_groups.list():
            if item.name == name:
                nt_ks.security_groups.delete(item.id)
                return {name: 'Deleted security group: {0}'.format(name)}
        return 'Security group not found: {0}'.format(name)
417845
def add_security_group(self, name, isc_id, comment=None):
        
        return SecurityGroup.create(
            name=name,
            isc_id=isc_id,
            vss_container=self,
            comment=comment)
369395
def add_group(self, name: str, **kwargs) -> None:
        
        group = {
            name: deserializer.inventory.InventoryElement.deserialize_group(
                name=name, defaults=self.defaults, **kwargs
            )
        }
        self.groups.update(group)
469505
def find_secgroup(self, name):
        
        res = self.ec2.get_all_security_groups(filters={'group-name': name})
        if res:
            return EC2SecGroup(res[0])