Remove rules from a security group.

        :param int group_id: The ID of the security group
        :param list rules: The list of IDs to remove
492499
def remove_securitygroup_rules(self, group_id, rules):
        
        return self.security_group.removeRules(rules, id=group_id)
1185765
@Override
	public void removeByGroupId(long groupId) {
		for (CPMeasurementUnit cpMeasurementUnit : findByGroupId(groupId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpMeasurementUnit);
		}
	}
1160262
def remove_rule(self, ip_protocol, from_port, to_port,
                    src_group_name, src_group_owner_id, cidr_ip):
        
        target_rule = None
        for rule in self.rules:
            if rule.ip_protocol == ip_protocol:
                if rule.from_port == from_port:
                    if rule.to_port == to_port:
                        target_rule = rule
                        target_grant = None
                        for grant in rule.grants:
                            if grant.name == src_group_name:
                                if grant.owner_id == src_group_owner_id:
                                    if grant.cidr_ip == cidr_ip:
                                        target_grant = grant
                        if target_grant:
                            rule.grants.remove(target_grant)
        if len(rule.grants) == 0:
            self.rules.remove(target_rule)
485244
def delete_security_group_rule(self, sec_grp_rule_id):
        '''
        
        '''
        ret = self.network_conn.delete_security_group_rule(
            security_group_rule=sec_grp_rule_id)
        return ret if ret else True
886976
def delete_group(self, group_id):
        
        route_values = {}
        if group_id is not None:
            route_values['groupId'] = self._serialize.url('group_id', group_id, 'str')
        self._send(http_method='DELETE',
                   location_id='5966283b-4196-4d57-9211-1b68f41ec1c2',
                   version='5.0',
                   route_values=route_values)
1111449
def remove_group(self, groupname):
        
        # implementation based on
        # https://docs.atlassian.com/jira/REST/ondemand/#d2e5173
        url = self._options['server'] + '/rest/api/latest/group'
        x = {'groupname': groupname}
        self._session.delete(url, params=x)
        return True
105755
def revoke_group_permission(
        self, group_name, source_group_name, source_group_owner_id):
        
        d = self.revoke_security_group(
            group_name,
            source_group_name=source_group_name,
            source_group_owner_id=source_group_owner_id)
        return d
1078251
def deletegroupmember(self, group_id, user_id):
        
        request = requests.delete(
            '{0}/{1}/members/{2}'.format(self.groups_url, group_id, user_id),
            headers=self.headers, verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 200:
            return True
100999
def edit_securitygroup(self, group_id, name=None, description=None):
        
        successful = False
        obj = {}
        if name:
            obj['name'] = name
        if description:
            obj['description'] = description

        if obj:
            successful = self.security_group.editObject(obj, id=group_id)

        return successful
527314
def rule_list(env, securitygroup_id, sortby):
    """"""

    mgr = SoftLayer.NetworkManager(env.client)

    table = formatting.Table(COLUMNS)
    table.sortby = sortby

    rules = mgr.list_securitygroup_rules(securitygroup_id)
    for rule in rules:
        port_min = rule.get('portRangeMin')
        port_max = rule.get('portRangeMax')
        if port_min is None:
            port_min = formatting.blank()
        if port_max is None:
            port_max = formatting.blank()

        table.add_row([
            rule['id'],
            rule.get('remoteIp') or formatting.blank(),
            rule.get('remoteGroupId') or formatting.blank(),
            rule['direction'],
            rule.get('ethertype') or formatting.blank(),
            port_min,
            port_max,
            rule.get('protocol') or formatting.blank(),
            rule.get('createDate') or formatting.blank(),
            rule.get('modifyDate') or formatting.blank()
        ])

    env.fout(table)
942900
def remove_group(id):
    
    acl_url = urljoin(_acl_url(), 'groups/{}'.format(id))
    try:
        r = http.delete(acl_url)
        print(r.status_code)
    except DCOSHTTPException as e:
        if e.response.status_code != 400:
            raise
962929
def delete_group(self, name):
        
        self.service.delete_group(
            name, self.url_prefix, self.auth, self.session,
            self.session_send_opts)
1267272
def get_remove_security_group_commands(self, sg_id, profile):
        """"""
        return self._get_interface_commands(sg_id, profile, delete=True)
1185166
def remove_groups_from_user(id, group_list = [])
      wf_user_id?(id)
      validate_usergroup_list(group_list)
      api.post([id, 'removeUserGroups'].uri_concat, group_list,
               'application/json')
    end
1287692
def remove_usage_rights_groups(self, group_id, file_ids, folder_ids=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - file_ids
        """List of ids of files to remove associated usage rights from."""
        params["file_ids"] = file_ids

        # OPTIONAL - folder_ids
        """List of ids of folders. Usage rights will be removed from all files in these folders."""
        if folder_ids is not None:
            params["folder_ids"] = folder_ids

        self.logger.debug("DELETE /api/v1/groups/{group_id}/usage_rights with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/groups/{group_id}/usage_rights".format(**path), data=data, params=params, no_data=True)
1031508
def get_create_security_group_commands(self, sg_id, sg_rules):
        """"""
        cmds = []
        in_rules, eg_rules = self._format_rules_for_eos(sg_rules)
        cmds.append("ip access-list %s dynamic" %
                    self._acl_name(sg_id, n_const.INGRESS_DIRECTION))
        for in_rule in in_rules:
            cmds.append(in_rule)
        cmds.append("exit")
        cmds.append("ip access-list %s dynamic" %
                    self._acl_name(sg_id, n_const.EGRESS_DIRECTION))
        for eg_rule in eg_rules:
            cmds.append(eg_rule)
        cmds.append("exit")
        return cmds
90180
def delete_group_cached(group_id, broker=None):
    
    if not broker:
        broker = get_broker()
    group_key = '{}:{}:keys'.format(broker.list_key, group_id)
    group_list = broker.cache.get(group_key)
    broker.cache.delete_many(group_list)
    broker.cache.delete(group_key)