Creates a record for the domain in a new Gandi zone.
965660
def create_record(self, rtype, name, content, ttl):
        """"""
        version = None
        ret = False

        # This isn't quite "do nothing" if the record already exists.
        # In this case, no new record will be created, but a new zone version
        # will be created and set.
        try:
            version = self._api.domain.zone.version.new(
                self._api_key, self._zone_id)
            self._api.domain.zone.record.add(self._api_key, self._zone_id, version,
                                             {'type': rtype.upper(),
                                              'name': name,
                                              'value': content,
                                              'ttl': ttl
                                              })
            self._api.domain.zone.version.set(
                self._api_key, self._zone_id, version)
            ret = True

        finally:
            if not ret and version is not None:
                self._api.domain.zone.version.delete(
                    self._api_key, self._zone_id, version)

        LOGGER.debug("create_record: %s", ret)
        return ret
636930
def output_domain(gandi, domain, output_keys, justify=12):
    
    if 'nameservers' in domain:
        domain['nameservers'] = format_list(domain['nameservers'])

    if 'services' in domain:
        domain['services'] = format_list(domain['services'])

    if 'tags' in domain:
        domain['tags'] = format_list(domain['tags'])

    output_generic(gandi, domain, output_keys, justify)

    if 'created' in output_keys:
        output_line(gandi, 'created', domain['date_created'], justify)

    if 'expires' in output_keys:
        date_end = domain.get('date_registry_end')
        if date_end:
            days_left = (date_end - datetime.now()).days
        output_line(gandi, 'expires',
                    '%s (in %d days)' % (date_end, days_left),
                    justify)

    if 'updated' in output_keys:
        output_line(gandi, 'updated', domain['date_updated'], justify)
532145
def domain_block(self, domain=None):
        
        params = self.__generate_params(locals())
        self.__api_request('POST', '/api/v1/domain_blocks', params)
38643
def _create_record(self, rtype, name, content):
        """"""
        # check if record already exists
        existing_records = self._list_records(rtype, name, content)
        if len(existing_records) >= 1:
            return True

        record = {
            "record_type": rtype,
            "name": self._relative_name(name),
            "content": content,
        }
        if self._get_lexicon_option("ttl"):
            record["ttl"] = self._get_lexicon_option("ttl")
        if self._get_lexicon_option("priority"):
            record["prio"] = self._get_lexicon_option("priority")

        payload = self._post(
            "/v1/domains/{0}/records".format(self.domain),
            {"record": record},
        )

        status = "id" in payload.get("record", {})
        LOGGER.debug("create_record: %s", status)
        return status
1242888
def create(args):
    
    # for PUT HTTP method
    action = True

    if ((args.__dict__.get('domain') and args.__dict__.get('name')
         and args.__dict__.get('rtype') and args.__dict__.get('content'))):
        # for create sub-command

        domain = args.domain
        o = JSONConverter(domain)

        name, rtype, content, ttl, priority = get_record_params(args)
        record_dict = o.set_record(name, rtype, content, ttl, priority)

        json = set_json(domain, action, record=record_dict)

    else:
        # for bulk_create sub-command
        if args.__dict__.get('domain'):
            domain = args.domain
        else:
            domain = check_infile(args.infile)
        json = set_json(domain, action, filename=args.infile)

    password = get_password(args)
    token = connect.get_token(args.username, password, args.server)
    processing.create_records(args.server, token, domain, json)

    if args.auto_update_soa == 'True':
        update_soa_serial(args)
18459
@Nonnull
    static Boundary createBoundaryForTerritoryRecord(final int territoryRecord) {
        return new Boundary(
                DATA_MODEL.getLatMicroDegMin(territoryRecord), DATA_MODEL.getLonMicroDegMin(territoryRecord),
                DATA_MODEL.getLatMicroDegMax(territoryRecord), DATA_MODEL.getLonMicroDegMax(territoryRecord)
        );
    }
1288121
def _create_record(self, rtype, name, content):
        """"""
        if not self._list_records(rtype, name, content):
            self._update_records([{}], {
                'type': rtype,
                'hostname': self._relative_name(name),
                'destination': content,
                'priority': self._get_lexicon_option('priority'),
            })
        LOGGER.debug('create_record: %s', True)
        return True
1274934
def _prepare_domain(mapping):
        """"""
        # Parse the domain-directory mapping
        try:
            domain, dir = mapping.split(':')
        except ValueError:
            print("Please provide the sources in the form of '<domain>:<directory>'")
            sys.exit(1)

        try:
            default_language = settings.TRANSLATION_DOMAINS[domain]
        except KeyError:
            print("Unknown domain {domain}, check the settings file to make sure"
                  " this domain is set in TRANSLATION_DOMAINS".format(domain=domain))
            sys.exit(1)
        # Create a temporary file to hold the `.pot` file for this domain
        handle, path = tempfile.mkstemp(prefix='zengine_i18n_', suffix='.pot')
        return (domain, {
            'default': default_language,
            'pot': path,
            'source': dir,
        })
357864
def _gen_records(self, record, zone_id, creating=False):
        '''
        
        '''
        return _Route53Record.new(self, record, zone_id, creating)
1256496
def _generate_create_dict(record, record_type, data, ttl, **kwargs):
        """"""

        # Basic dns record structure
        resource_record = {
            'host': record,
            'data': data,
            'ttl': ttl,
            'type': record_type
        }

        for (key, value) in kwargs.items():
            resource_record.setdefault(key, value)

        return resource_record
855045
def create(gandi, vhost, paas, ssl, private_key, alter_zone, poll_cert,
           background):
    
    if not gandi.hostedcert.activate_ssl(vhost, ssl, private_key, poll_cert):
        return

    paas_info = gandi.paas.info(paas)
    result = gandi.vhost.create(paas_info, vhost, alter_zone, background)

    if background:
        gandi.pretty_echo(result)

    return result
212078
function createARecord (domain, subdomain, ip, cb) {
        var body = {
            name: subdomain,
            type: 'A',
            content: ip
        };
        _hoverRequest('POST', '/domains/' + domain + '/dns', body, cb);
    }
673623
def remove_zone_record(self, id, domain, subdomain=None):
        

        if subdomain is None:
            subdomain = "@"

        _validate_int("id", id)

        self._call("removeZoneRecord", domain, subdomain, id)
671786
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF File Set Descriptor already initialized')

        self.desc_tag = UDFTag()
        self.desc_tag.new(256)  # FIXME: we should let the user set serial_number

        self.recording_date = UDFTimestamp()
        self.recording_date.new()

        self.domain_ident = UDFEntityID()
        self.domain_ident.new(0, b'*OSTA UDF Compliant', b'\x02\x01\x03')

        self.root_dir_icb = UDFLongAD()
        self.root_dir_icb.new(2048, 2)

        self.file_set_num = 0
        self.log_vol_char_set = _unicodecharset()
        self.log_vol_ident = _ostaunicode_zero_pad('CDROM', 128)
        self.file_set_char_set = _unicodecharset()
        self.file_set_ident = _ostaunicode_zero_pad('CDROM', 32)
        self.copyright_file_ident = b'\x00' * 32  # FIXME: let the user set this
        self.abstract_file_ident = b'\x00' * 32  # FIXME: let the user set this

        self._initialized = True
1111613
def delete_records(self, zone_name, record_type, subdomain):
        
        records = self._client.get('/domain/zone/{}/record'.format(zone_name),
                                   fieldType=record_type, subDomain=subdomain)
        for record in records:
            self.delete_record(zone_name, record)
854299
def get_record(self, zone_name, record_id):
        
        return self._client.get(
            '/domain/zone/{}/record/{}'.format(zone_name, record_id))
564619
def create_domainalias(self, domainid, data):
        """"""
        return self.api_call(
            ENDPOINTS['domainaliases']['new'],
            dict(domainid=domainid),
            body=data)