Display information about a hosted certificate.

    Resource can be a FQDN or an ID
322244
def info(gandi, resource):
    
    output_keys = ['id', 'subject', 'date_created', 'date_expire',
                   'fqdns', 'vhosts']

    result = gandi.hostedcert.infos(resource)
    for num, hcert in enumerate(result):
        if num:
            gandi.separator_line()
        output_hostedcert(gandi, hcert, output_keys)

    return result
750372
function info(options , callback){
    options.url  = 'https://'+options.host+':'+options.port+SUPERVISOR_PATH_INFO;
    options.key = ssl_files.readFileContent(options.keyFile);
    options.cert = ssl_files.readFileContent(options.certFile);
    options.ca = ssl_files.readCaChain(options.ca);

    request(options, function (error, response, body) {
        if (!error && response.statusCode == 200) {
            callback(null, JSON.parse(body));
        }else{
            callback(new Error("Error connecting to the supervisor:"+error.toString()) , null);
        }
    });

}
429802
def info(self, account_id, resource_id, parent_id):
        
        resource = self.record(account_id, resource_id)
        if resource is None and not parent_id:
            return {'ResourceId': resource_id,
                    'LockStatus': self.STATE_UNLOCKED}
        elif resource is None:
            parent = self.record(account_id, parent_id)
            if parent is None:
                return {'ResourceId': resource_id,
                        'ParentId': parent_id,
                        'LockStatus': self.STATE_UNLOCKED}
            parent['ResourceId'] = resource_id
            parent['ParentId'] = parent_id
            parent['LockType'] = 'parent'
            return parent
        if resource['ResourceId'].startswith('vpc-'):
            return resource
        if resource['ResourceId'].startswith('sg-'):
            return resource
349492
def show_csrs():
    '''
    
    '''
    data = salt.utils.http.query(
        '{0}/certificaterequests'.format(_base_url()),
        status=True,
        decode=True,
        decode_type='json',
        header_dict={
            'tppl-api-key': _api_key(),
        },
    )
    status = data['status']
    if six.text_type(status).startswith('4') or six.text_type(status).startswith('5'):
        raise CommandExecutionError(
            'There was an API error: {0}'.format(data['error'])
        )
    return data.get('dict', {})
1317927
def get_conn_info(self):
        """"""
        return session.ConnectionInfo(self.request.remote_ip,
                                      self.request.cookies,
                                      self.request.arguments,
                                      self.request.headers,
                                      self.request.path)
1151437
def _get_domain_id(self, domain):
        
        api = self.api[self.account]['domain_id']
        qdomain = dns.name.from_text(domain).to_unicode(True)
        domains, last_count, page = {}, -1, 0
        while last_count != len(domains):
            last_count = len(domains)
            page += 1
            url = (api['GET'].copy()).get('url', '/').replace('<index>', str(page))
            params = api['GET'].get('params', {}).copy()
            for param in params:
                params[param] = params[param].replace('<index>', str(page))
            response = self._get(url, query_params=params)
            domain_tags = Provider._filter_dom(response.text, api['filter'], True)
            for domain_tag in domain_tags:
                domain_id = Provider._extract_domain_id(dict(domain_tag.attrs)[api['id']['attr']],
                                                        api['id']['regex'])
                domain = (Provider._filter_dom(domain_tag, api['domain'])
                          .renderContents().decode('UTF-8'))
                domains[domain] = domain_id
                if domain == qdomain:
                    LOGGER.info('Hetzner => Get ID %s for domain %s', domain_id, qdomain)
                    return domain_id
        LOGGER.error('Hetzner => ID for domain %s does not exists', qdomain)
        raise AssertionError
289076
function showSpecifications(options , callback){
    options.url  = 'https://'+options.host+':'+options.port+SUPERVISOR_PATH_SHOW_SPECIFICATION;
    options.ca = ssl_files.readCaChain(options.caFile);
    options.key = ssl_files.readFileContent(options.keyFile);
    options.cert = ssl_files.readFileContent(options.certFile);

    request(options, function (error, response, body) {
        if (!error && (response.statusCode == 200)) {
            var spec = (JSON.parse(body));
                callback(null , spec);
        }else{
            callback(new Error("Error connecting to the supervisor") , null);
        }
    });
}
1030139
def cli(env, zone, data, record, ttl, type):
    """"""

    manager = SoftLayer.DNSManager(env.client)
    table = formatting.Table(['id', 'record', 'type', 'ttl', 'data'])

    table.align['ttl'] = 'l'
    table.align['record'] = 'r'
    table.align['data'] = 'l'

    zone_id = helpers.resolve_id(manager.resolve_ids, zone, name='zone')

    records = manager.get_records(zone_id,
                                  record_type=type,
                                  host=record,
                                  ttl=ttl,
                                  data=data)

    for the_record in records:
        table.add_row([
            the_record['id'],
            the_record['host'],
            the_record['type'].upper(),
            the_record['ttl'],
            the_record['data']
        ])

    env.fout(table)
238523
def get_subdomain_info(fqn, db_path=None, atlasdb_path=None, zonefiles_dir=None, check_pending=False, include_did=False):
    
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        log.warn("Subdomain support is disabled")
        return None

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    if atlasdb_path is None:
        atlasdb_path = opts['atlasdb_path']

    db = SubdomainDB(db_path, zonefiles_dir)
    try:
        subrec = db.get_subdomain_entry(fqn)
    except SubdomainNotFound:
        log.warn("No such subdomain: {}".format(fqn))
        return None

    if check_pending:
        # make sure that all of the zone files between this subdomain's
        # domain's creation and this subdomain's zone file index are present,
        # minus the ones that are allowed to be missing.
        subrec.pending = db.subdomain_check_pending(subrec, atlasdb_path)

    if include_did:
        # include the DID 
        subrec.did_info = db.get_subdomain_DID_info(fqn)

    return subrec
961368
function getInfo(conn){
  var params = pathParams.extractParams(conn.url);
  // Look for 'n' (new) or 'o' (open) path param.
  if (params.n) {
    return {id: params.n, existing: false};
  } else if (params.o) {
    return {id: params.o, existing: true};
  } else {
    return false;
  }
}
550248
def _parse_certificate(cls, response):
        
        links = _parse_header_links(response)
        try:
            cert_chain_uri = links[u'up'][u'url']
        except KeyError:
            cert_chain_uri = None
        return (
            response.content()
            .addCallback(
                lambda body: messages.CertificateResource(
                    uri=cls._maybe_location(response),
                    cert_chain_uri=cert_chain_uri,
                    body=body))
            )
1135288
def get_certificate(self, certificate_uid):
        
        certificate_json = self.get_certificate_json(certificate_uid)
        return model.to_certificate_model(certificate_json)
885762
def delete(gandi, resource, force):
    
    infos = gandi.hostedcert.infos(resource)
    if not infos:
        return

    if not force:
        proceed = click.confirm('Are you sure to delete the following hosted '
                                'certificates ?\n' +
                                '\n'.join(['%s: %s' % (res['id'],
                                                       res['subject'])
                                           for res in infos]) + '\n')
        if not proceed:
            return

    for res in infos:
        gandi.hostedcert.delete(res['id'])
176560
def info(self, uuid):
        
        args = {
            'uuid': uuid,
        }
        self._domain_action_chk.check(args)

        return self._client.json('kvm.info', args)
185882
def list(gandi, fqdn, name, sort, type, rrset_type, text):
    """"""
    domains = gandi.dns.list()
    domains = [domain['fqdn'] for domain in domains]
    if fqdn not in domains:
        gandi.echo('Sorry domain %s does not exist' % fqdn)
        gandi.echo('Please use one of the following: %s' % ', '.join(domains))
        return

    output_keys = ['name', 'ttl', 'type', 'values']

    result = gandi.dns.records(fqdn, sort_by=sort, text=text)
    if text:
        gandi.echo(result)
        return result

    for num, rec in enumerate(result):
        if type and rec['rrset_type'] != type:
            continue
        if rrset_type and rec['rrset_type'] != rrset_type:
            continue
        if name and rec['rrset_name'] != name:
            continue
        if num:
            gandi.separator_line()
        output_dns_records(gandi, rec, output_keys)

    return result
659488
@Override
	public Result<Void> getCertInfoByID(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp, String id) {
		TimeTaken tt = trans.start(GET_CERT_BY_ID, Env.SUB|Env.ALWAYS);
		try {	
			Result<CERTS> rci = service.getCertInfoByID(trans,req,id);
			
			switch(rci.status) {
				case OK: 
					if(Question.willSpecialLog(trans, trans.user())) {
						RosettaData<CERTS> data = certsDF.newData(trans).load(rci.value);
						Question.logEncryptTrace(trans,data.asString());
						data.to(resp.getOutputStream());
					} else {
						certsDF.direct(trans, rci.value, resp.getOutputStream());
					}
					setContentType(resp,certsDF.getOutType());
					return Result.ok();
				default:
					return Result.err(rci);
			}
		} catch (Exception e) {
			trans.error().log(e,IN,GET_CERT_BY_ID);
			return Result.err(e);
		} finally {
			tt.done();
		}
	}
92043
def usable_id(cls, id):
        
        try:
            # id is maybe a hostname
            qry_id = cls.from_name(id)
            if not qry_id:
                # id is maybe an ip
                qry_id = cls.from_ip(id)
            if not qry_id:
                qry_id = cls.from_vhost(id)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id