Retrieves the specified policy document for the specified group.

    .. versionadded:: 2015.8.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iam.get_group_policy mygroup policyname
192242
def get_group_policy(group_name, policy_name, region=None, key=None,
                     keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        info = conn.get_group_policy(group_name, policy_name)
        log.debug('info for group policy is : %s', info)
        if not info:
            return False
        info = info.get_group_policy_response.get_group_policy_result.policy_document
        info = _unquote(info)
        info = salt.utils.json.loads(info, object_pairs_hook=odict.OrderedDict)
        return info
    except boto.exception.BotoServerError as e:
        log.debug(e)
        log.error('Failed to get IAM group %s info.', group_name)
        return False
430366
def get_group_admin(self, group):
        
        data = {
            'name': group,
        }
        response = _fix_group(self.post('getGroupAdmin', data))
        return response
1179787
def execute_policy(self, scaling_group, policy):
        
        return self._manager.execute_policy(scaling_group=scaling_group,
                policy=policy)
167840
def _get_policy_object(platform,
                       filters=None,
                       pillar_key='acl',
                       pillarenv=None,
                       saltenv=None,
                       merge_pillar=True):
    '''
    
    '''
    policy = _Policy()
    policy_filters = []
    if not filters:
        filters = []
    for filter_ in filters:
        if not filter_ or not isinstance(filter_, dict):
            continue  # go to the next filter
        filter_name = filter_.keys()[0]
        filter_config = filter_.values()[0]
        header = capirca.lib.policy.Header()  # same header everywhere
        target_opts = [
            platform,
            filter_name
        ]
        filter_options = filter_config.pop('options', None)
        if filter_options:
            filter_options = _make_it_list({}, filter_name, filter_options)
            # make sure the filter options are sent as list
            target_opts.extend(filter_options)
        target = capirca.lib.policy.Target(target_opts)
        header.AddObject(target)
        filter_terms = []
        for term_ in filter_config.get('terms', []):
            if term_ and isinstance(term_, dict):
                term_name = term_.keys()[0]
                term_fields = term_.values()[0]
                term = _get_term_object(filter_name,
                                        term_name,
                                        pillar_key=pillar_key,
                                        pillarenv=pillarenv,
                                        saltenv=saltenv,
                                        merge_pillar=merge_pillar,
                                        **term_fields)
            filter_terms.append(term)
        policy_filters.append(
            (header, filter_terms)
        )
    policy.filters = policy_filters
    log.debug('Policy config:')
    log.debug(six.text_type(policy))
    platform_generator = _import_platform_generator(platform)
    policy_config = platform_generator(policy, 2)
    log.debug('Generating policy config for %s:', platform)
    log.debug(six.text_type(policy_config))
    return policy_config
1104809
def execute_policy(self, scaling_group, policy):
        
        uri = "/%s/%s/policies/%s/execute" % (self.uri_base,
                utils.get_id(scaling_group), utils.get_id(policy))
        resp, resp_body = self.api.method_post(uri)
        return None
280688
public static aaagroup_vpnsessionpolicy_binding[] get(nitro_service service, String groupname) throws Exception{
		aaagroup_vpnsessionpolicy_binding obj = new aaagroup_vpnsessionpolicy_binding();
		obj.set_groupname(groupname);
		aaagroup_vpnsessionpolicy_binding response[] = (aaagroup_vpnsessionpolicy_binding[]) obj.get_resources(service);
		return response;
	}
1064191
def get_policy_config(self, lint_context):
        
        policy_config = lint_context['config']\
            .get('policies', {})\
            .get(self.__class__.__name__, {})

        return policy_config
1135388
def get_group(group_name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        info = conn.get_group(group_name, max_items=1)
        if not info:
            return False
        return info['get_group_response']['get_group_result']['group']
    except boto.exception.BotoServerError as e:
        log.debug(e)
        log.error('Failed to get IAM group %s info.', group_name)
        return False
1195999
def get_webhook(self, scaling_group, policy, webhook):
        
        return self._manager.get_webhook(scaling_group, policy, webhook)
1339668
def get_config(name=None, group_id=None, region=None, key=None, keyid=None,
               profile=None, vpc_id=None, vpc_name=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    sg = _get_group(conn, name=name, vpc_id=vpc_id, vpc_name=vpc_name,
                    group_id=group_id, region=region, key=key, keyid=keyid,
                    profile=profile)
    if sg:
        ret = odict.OrderedDict()
        ret['name'] = sg.name
        # TODO: add support for vpc_id in return
        # ret['vpc_id'] = sg.vpc_id
        ret['group_id'] = sg.id
        ret['owner_id'] = sg.owner_id
        ret['description'] = sg.description
        ret['tags'] = sg.tags
        _rules = _parse_rules(sg, sg.rules)
        _rules_egress = _parse_rules(sg, sg.rules_egress)
        ret['rules'] = _split_rules(_rules)
        ret['rules_egress'] = _split_rules(_rules_egress)
        return ret
    else:
        return None
307956
def group_for_policy(self, policy=None):
        
        if policy is None:
            policy = self.context.participant_policy
        return "%s:%s" % (policy.title(), self.context.UID())
1239462
def get_group_id(name, vpc_id=None, vpc_name=None, region=None, key=None,
                 keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    if name.startswith('sg-'):
        log.debug('group %s is a group id. get_group_id not called.', name)
        return name
    group = _get_group(conn=conn, name=name, vpc_id=vpc_id, vpc_name=vpc_name,
                       region=region, key=key, keyid=keyid, profile=profile)
    return getattr(group, 'id', None)
391472
PolicyInfo getPolicy(String policyName) {
    for (PolicyInfo policy : allPolicies) {
      if (policyName.equals(policy.getName())) {
        return policy;
      }
    }
    return null;
  }
912465
def get_secgroup_id(kwargs=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The get_secgroup_id function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('name', None)
    if name is None:
        raise SaltCloudSystemExit(
            'The get_secgroup_id function requires a \'name\'.'
        )

    try:
        ret = list_security_groups()[name]['id']
    except KeyError:
        raise SaltCloudSystemExit(
            'The security group \'{0}\' could not be found.'.format(name)
        )

    return ret
1336724
def get(self, sg_id):
        
        secgroup = self.client.show_security_group(sg_id).get('security_group')
        sg_dict = self._sg_name_dict(sg_id, secgroup['security_group_rules'])
        return SecurityGroup(secgroup, sg_dict)
793551
def get_config(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    retries = 30
    while True:
        try:
            asg = conn.get_all_groups(names=[name])
            if asg:
                asg = asg[0]
            else:
                return {}
            ret = odict.OrderedDict()
            attrs = ['name', 'availability_zones', 'default_cooldown',
                    'desired_capacity', 'health_check_period',
                    'health_check_type', 'launch_config_name', 'load_balancers',
                    'max_size', 'min_size', 'placement_group',
                    'vpc_zone_identifier', 'tags', 'termination_policies',
                    'suspended_processes']
            for attr in attrs:
                # Tags are objects, so we need to turn them into dicts.
                if attr == 'tags':
                    _tags = []
                    for tag in asg.tags:
                        _tag = odict.OrderedDict()
                        _tag['key'] = tag.key
                        _tag['value'] = tag.value
                        _tag['propagate_at_launch'] = tag.propagate_at_launch
                        _tags.append(_tag)
                    ret['tags'] = _tags
                # Boto accepts a string or list as input for vpc_zone_identifier,
                # but always returns a comma separated list. We require lists in
                # states.
                elif attr == 'vpc_zone_identifier':
                    ret[attr] = getattr(asg, attr).split(',')
                # convert SuspendedProcess objects to names
                elif attr == 'suspended_processes':
                    suspended_processes = getattr(asg, attr)
                    ret[attr] = sorted([x.process_name for x in suspended_processes])
                else:
                    ret[attr] = getattr(asg, attr)
            # scaling policies
            policies = conn.get_all_policies(as_group=name)
            ret["scaling_policies"] = []
            for policy in policies:
                ret["scaling_policies"].append(
                    dict([
                        ("name", policy.name),
                        ("adjustment_type", policy.adjustment_type),
                        ("scaling_adjustment", policy.scaling_adjustment),
                        ("min_adjustment_step", policy.min_adjustment_step),
                        ("cooldown", policy.cooldown)
                    ])
                )
            # scheduled actions
            actions = conn.get_all_scheduled_actions(as_group=name)
            ret['scheduled_actions'] = {}
            for action in actions:
                end_time = None
                if action.end_time:
                    end_time = action.end_time.isoformat()
                ret['scheduled_actions'][action.name] = dict([
                  ("min_size", action.min_size),
                  ("max_size", action.max_size),
                  # AWS bug
                  ("desired_capacity", int(action.desired_capacity)),
                  ("start_time", action.start_time.isoformat()),
                  ("end_time", end_time),
                  ("recurrence", action.recurrence)
                ])
            return ret
        except boto.exception.BotoServerError as e:
            if retries and e.code == 'Throttling':
                log.debug('Throttled by AWS API, retrying in 5 seconds...')
                time.sleep(5)
                retries -= 1
                continue
            log.error(e)
            return {}
1297255
def get_group(self, group_id):
        
        def process_result(result):
            return Group(self, result)

        return Command('get', [ROOT_GROUPS, group_id],
                       process_result=process_result)