Check to see if a replication group exists.

    CLI example::

        salt myminion boto_elasticache.group_exists myelasticache
768156
def group_exists(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        conn.describe_replication_groups(name)
        return True
    except boto.exception.BotoServerError as e:
        log.debug(e)
        return False
1035578
def exists(*nictag, **kwargs):
    '''
    
    '''
    ret = {}
    if not nictag:
        return {'Error': 'Please provide at least one nictag to check.'}

    cmd = 'nictagadm exists -l {0}'.format(' '.join(nictag))
    res = __salt__['cmd.run_all'](cmd)

    if not kwargs.get('verbose', False):
        ret = res['retcode'] == 0
    else:
        missing = res['stderr'].splitlines()
        for nt in nictag:
            ret[nt] = nt not in missing

    return ret
1218492
def exists(self):
        
        t = self.wait_timeout
        self.wait_timeout = 0
        try:
            self.reload()
            return True
        except NoSuchElementException:
            return False
        finally:
            self.wait_timeout = t
1031103
def exists(config):
    
    exists = (
        pathlib.Path(config.cache_path).exists()
        and pathlib.Path(config.cache_path).is_dir()
    )
    if not exists:
        return False
    index_path = pathlib.Path(config.cache_path) / "index.json"
    if index_path.exists():
        with open(index_path, "r") as out:
            index = json.load(out)
        if index["version"] != __version__:
            # TODO: Inspect the versions properly.
            logger.warning(
                "Wily cache is old, you may incur errors until you rebuild the cache."
            )
    else:
        logger.warning(
            "Wily cache was not versioned, you may incur errors until you rebuild the cache."
        )
        create_index(config)
    return True
812449
def check_log_stream_exists(awsclient, log_group_name, log_stream_name):
    
    lg = describe_log_group(awsclient, log_group_name)
    if lg and lg['logGroupName'] == log_group_name:
        stream = describe_log_stream(awsclient, log_group_name, log_stream_name)
        if stream and stream['logStreamName'] == log_stream_name:
            return True
    return False
1045872
def index_exists(index, hosts=None, profile=None):
    '''
    
    '''
    es = _get_instance(hosts, profile)

    try:
        return es.indices.exists(index=index)
    except elasticsearch.exceptions.NotFoundError:
        return False
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot retrieve index {0}, server returned code {1} with message {2}".format(index, e.status_code, e.error))
8401
def servicegroup_server_exists(sg_name, s_name, s_port=None, **connection_args):
    '''
    
    '''
    return _servicegroup_get_server(sg_name, s_name, s_port, **connection_args) is not None
856524
def exists(self):
    
    try:
      return self.metadata is not None
    except datalab.utils.RequestException:
      return False
    except Exception as e:
      raise e
1018247
def check_bucket_exists(self, bucket: str) -> bool:
        
        bucket_obj = self.gcp_client.bucket(bucket)  # type: Bucket
        return bucket_obj.exists()
672701
def target_group_exists(name,
                        region=None,
                        key=None,
                        keyid=None,
                        profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        if name.startswith('arn:aws:elasticloadbalancing'):
            alb = conn.describe_target_groups(TargetGroupArns=[name])
        else:
            alb = conn.describe_target_groups(Names=[name])
        if alb:
            return True
        else:
            log.warning('The target group does not exist in region %s', region)
            return False
    except ClientError as error:
        log.warning('target_group_exists check for %s returned: %s', name, error)
        return False
12718
def exists(self):
    
    try:
      info = self._api.tables_get(self._name_parts)
    except google.datalab.utils.RequestException as e:
      if e.status == 404:
        return False
      raise e
    except Exception as e:
      raise e
    self._info = info
    return True
390969
def exists(self, pattern, **match_kwargs):
        
        ret = self.match(pattern, **match_kwargs)
        if ret is None:
            return None
        if not ret.matched:
            return None
        return ret
941259
def subnet_group_exists(name, tags=None, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    if not conn:
        return False
    try:
        ec = conn.describe_cache_subnet_groups(cache_subnet_group_name=name)
        if not ec:
            msg = ('ElastiCache subnet group does not exist in region {0}'.format(region))
            log.debug(msg)
            return False
        return True
    except boto.exception.BotoServerError as e:
        log.debug(e)
        return False
689979
def ensure_exists(self):
        
        if not self.exists:
            msg = "The local %s repository %s doesn't exist!"
            raise ValueError(msg % (self.friendly_name, format_path(self.local)))
33397
def exists(self, doc_id, rev_id=''):
        
        '''
            
        '''

        title = '%s.exists' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'doc_id': doc_id,
            'rev_id': rev_id
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)
    
    # send request and construct response
        url = self.bucket_url + '/%s' % doc_id
        params = None
        if rev_id:
            params = { 'rev': rev_id }
        response = requests.get(url, params=params)
        if not 'error' in response.json():
            return True
        return False
238484
def exists(zpool):
    '''
    

    '''
    # list for zpool
    # NOTE: retcode > 0 if zpool does not exists
    res = __salt__['cmd.run_all'](
        __utils__['zfs.zpool_command'](
            command='list',
            target=zpool,
        ),
        python_shell=False,
        ignore_retcode=True,
    )

    return res['retcode'] == 0
1208881
def delete_subnet_group(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    if not conn:
        return False
    try:
        conn.delete_cache_subnet_group(name)
        msg = 'Deleted ElastiCache subnet group {0}.'.format(name)
        log.info(msg)
        return True
    except boto.exception.BotoServerError as e:
        log.debug(e)
        msg = 'Failed to delete ElastiCache subnet group {0}'.format(name)
        log.error(msg)
        return False