Create an empty instance of a DNS zone that you can drive programmatically.

 @api public
 Helper method to access the zones SOA RR.

 @api public
187749
def soa
      # return the first SOA we find in the records array.
      rr = @records.find { |rr| rr.type == "SOA" }
      return rr if rr
      # otherwise create a new SOA
      rr = DNS::Zone::RR::SOA.new
      rr.serial = Time.now.utc.strftime("%Y%m%d01")    
      rr.refresh_ttl = '3h'
      rr.retry_ttl = '15m'
      rr.expiry_ttl = '4w'
      rr.minimum_ttl = '30m'
      # store and return new SOA
      @records << rr
      return rr
    end
726705
public function create()
  {
    $class = ClassGen::classGen(
      $this->name,
      $this->namespace,
      [
        'Phrest\API\Enums\RequestMethodEnum',
        'Phrest\SDK\Request\AbstractRequest',
        'Phrest\SDK\Request\RequestOptions',
        'Phrest\SDK\PhrestSDK'
      ],
      'AbstractRequest'
    );

    // Path
    $path = '/' . $this->version . '/'
      . strtolower($this->entityName)
      . $this->getPlaceholderUriFromUrl($this->action->url);

    $property = ClassGen::property('path', 'private', $path, 'string');
    $class->addPropertyFromGenerator($property);

    // Properties and constructor parameters
    /** @var ParameterGenerator[] $parameters */
    $parameters = [];

    // Get properties
    $getParams = $this->generateGetParamsFromUrl($this->action->url);
    if (!empty($getParams))
    {
      foreach ($getParams as $getParam)
      {
        $class->addPropertyFromGenerator(
          ClassGen::property($getParam, 'public', null)
        );

        $parameter = new ParameterGenerator($getParam);
        $parameter->setDefaultValue(null);

        $parameters[$getParam] = $parameter;
      }
    }

    // Post properties
    if (!empty($this->action->postParams))
    {
      foreach ($this->action->postParams as $name => $type)
      {
        if ($class->hasProperty($name))
        {
          continue;
        }

        $class->addPropertyFromGenerator(
          ClassGen::property($name, 'public', null, $type)
        );

        $parameter = new ParameterGenerator($name, $type);
        $parameter->setDefaultValue(null);

        $parameters[$name] = $parameter;
      }
    }

    // Constructor
    if (!empty($parameters))
    {
      $constructor = ClassGen::constructor($parameters);
      $class->addMethodFromGenerator($constructor);
    }

    // Create method
    $create = ClassGen::method('create', [], 'public', $this->getCreateBody());
    $class->addMethodFromGenerator($create);

    // Setters
    foreach ($parameters as $parameter)
    {
      $class->addMethodFromGenerator(
        ClassGen::setter($parameter->getName(), $parameter->getType())
      );
    }

    return $class;
  }
951983
def cli(env, zonefile, dry_run):
    """"""

    manager = SoftLayer.DNSManager(env.client)
    with open(zonefile) as zone_f:
        zone_contents = zone_f.read()

    zone, records, bad_lines = parse_zone_details(zone_contents)

    env.out("Parsed: zone=%s" % zone)
    for record in records:
        env.out("Parsed: %s" % RECORD_FMT.format(**record))

    for line in bad_lines:
        env.out("Unparsed: %s" % line)

    if dry_run:
        return

    # Find zone id or create the zone if it doesn't exist
    try:
        zone_id = helpers.resolve_id(manager.resolve_ids, zone,
                                     name='zone')
    except exceptions.CLIAbort:
        zone_id = manager.create_zone(zone)['id']
        env.out(click.style("Created: %s" % zone, fg='green'))

    # Attempt to create each record
    for record in records:
        try:
            manager.create_record(zone_id,
                                  record['record'],
                                  record['type'],
                                  record['data'],
                                  record['ttl'])

            env.out(click.style("Created: %s" % RECORD_FMT.format(**record),
                                fg='green'))
        except SoftLayer.SoftLayerAPIError as ex:
            env.out(click.style("Failed: %s" % RECORD_FMT.format(**record),
                                fg='red'))
            env.out(click.style(str(ex), fg='red'))

    env.out(click.style("Finished", fg='green'))
250224
public function create($data, $shippingZoneId = null)
    {
        if (isset($shippingZoneId)) {
            return $this->client()->put($data, 'shipping-zones/{shippingZoneId}', ['shippingZoneId' => $shippingZoneId]);
        }

        return $this->client()->post($data, 'shipping-zones');
    }
1159059
public static dnszone[] get(nitro_service service) throws Exception{
		dnszone obj = new dnszone();
		dnszone[] response = (dnszone[])obj.get_resources(service);
		return response;
	}
531426
static ModelNode createOperation(final ModelNode operationToValidate) {
        PathAddress pa = PathAddress.pathAddress(operationToValidate.require(ModelDescriptionConstants.OP_ADDR));
        PathAddress realmPA = null;
        for (int i = pa.size() - 1; i > 0; i--) {
            PathElement pe = pa.getElement(i);
            if (SECURITY_REALM.equals(pe.getKey())) {
                realmPA = pa.subAddress(0, i + 1);
                break;
            }
        }
        assert realmPA != null : "operationToValidate did not have an address that included a " + SECURITY_REALM;
        return Util.getEmptyOperation("validate-authentication", realmPA.toModelNode());
    }
323630
def create_failover_dns(self, primary_region='us-east-1'):
        
        dns_record = self.generated.dns()['global']
        zone_ids = get_dns_zone_ids(env=self.env, facing=self.elb_subnet)

        elb_dns_aws = find_elb(name=self.app_name, env=self.env, region=self.region)
        elb_dns_zone_id = find_elb_dns_zone_id(name=self.app_name, env=self.env, region=self.region)

        if primary_region in elb_dns_aws:
            failover_state = 'PRIMARY'
        else:
            failover_state = 'SECONDARY'
        self.log.info("%s set as %s record", elb_dns_aws, failover_state)

        self.log.info('Updating Application Failover URL: %s', dns_record)

        dns_kwargs = {
            'dns_name': dns_record,
            'elb_dns_zone_id': elb_dns_zone_id,
            'elb_aws_dns': elb_dns_aws,
            'dns_ttl': self.dns_ttl,
            'failover_state': failover_state,
        }

        for zone_id in zone_ids:
            self.log.debug('zone_id: %s', zone_id)
            update_failover_dns_record(self.env, zone_id, **dns_kwargs)

        return dns_record
919158
public function create()
    {
        $instance = self::createStatesGeoZone($this);
        $this->setId($instance->getId());
        return $instance;
    }
1064629
@SuppressWarnings("unchecked")
    private ChronoZonedDateTimeImpl<D> create(Instant instant, ZoneId zone) {
        return (ChronoZonedDateTimeImpl<D>)ofInstant(getChronology(), instant, zone);
    }
192227
def parse_create_zone(prs, conn):
    
    prs_zone_create = prs.add_parser('zone_create', help='create zone')
    prs_zone_create.add_argument(
        '--domain', action='store', required=True, help='specify zone')
    prs_zone_create.add_argument('--dnsaddr', action='store', required=True,
                                 help='specify IP address of DNS master')
    group_zone_create = prs_zone_create.add_mutually_exclusive_group()
    group_zone_create.add_argument('-S', action='store_true',
                                   help='create zone to SLAVE')
    group_zone_create.add_argument('-N', action='store_true',
                                   help='create zone to NATIVE')
    conn_options(prs_zone_create, conn)
    prs_zone_create.set_defaults(func=create_zone)
144661
def create_zone(args):
    
    action = True

    password = get_password(args)
    token = connect.get_token(args.username, password, args.server)

    domain = args.domain
    template = args.domain.replace('.', '_')

    master = None
    dnsaddr = args.dnsaddr
    if args.__dict__.get('S'):
        dtype = 'SLAVE'
        master = dnsaddr
    elif args.__dict__.get('N'):
        dtype = 'NATIVE'
    else:
        dtype = 'MASTER'

    # generate template data
    o = JSONConverter(domain)
    o.generate_template(domain, dnsaddr, desc='')

    # create template
    processing.create_template(args.server, token, template, o.record)

    # create zone
    processing.create_zone(args.server, token, domain, template, dtype, master)

    # delete template
    processing.delete_template(args.server, token, template)
1198968
@Override
    public Promise<JerseyServer> createServer(@Nullable JerseyServerOptions options, @Nullable JerseyOptions jerseyOptions) {
        final Deferred<JerseyServer> d = when.defer();

        try {
            JerseyServer jerseyServer = jerseyServerProvider.get();
            jerseyServer.start(options, jerseyOptions, result -> {
                if (result.succeeded()) {
                    d.resolve(jerseyServer);
                } else {
                    d.reject(result.cause());
                }
            });

        } catch (RuntimeException e) {
            d.reject(e);
        }

        return d.getPromise();
    }
815954
def create_primary_zone_by_upload(self, account_name, zone_name, bind_file):
        
        zone_properties = {"name": zone_name, "accountName": account_name, "type": "PRIMARY"}
        primary_zone_info = {"forceImport": True, "createType": "UPLOAD"}
        zone_data = {"properties": zone_properties, "primaryCreateInfo": primary_zone_info}
        files = {'zone': ('', json.dumps(zone_data), 'application/json'),
                 'file': ('file', open(bind_file, 'rb'), 'application/octet-stream')}
        return self.rest_api_connection.post_multi_part("/v1/zones", files)
1286744
def create(self):
        
        self.service.create()

        predix.config.set_env_value(self.use_class, 'ingest_uri',
                self.get_ingest_uri())
        predix.config.set_env_value(self.use_class, 'ingest_zone_id',
                self.get_ingest_zone_id())

        predix.config.set_env_value(self.use_class, 'query_uri',
                self.get_query_uri())
        predix.config.set_env_value(self.use_class, 'query_zone_id',
                self.get_query_zone_id())
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
1164019
function createWorld() {

    var runtime = {
        driver: null,               // the browser object
        eyes: null,
        selenium: selenium,         // the raw nodejs selenium driver
        By: selenium.By,            // in keeping with Java expose selenium By
        by: selenium.By,            // provide a javascript lowercase version
        until: selenium.until,      // provide easy access to selenium until methods
        expect: expect,             // expose chai expect to allow variable testing
        assert: assert,             // expose chai assert to allow variable testing
        trace: consoleInfo,         // expose an info method to log output to the console in a readable/visible format
        page: global.page || {},    // empty page objects placeholder
        shared: global.shared || {} // empty shared objects placeholder
    };

    // expose properties to step definition methods via global variables
    Object.keys(runtime).forEach(function (key) {
        if (key === 'driver' && browserTeardownStrategy !== 'always') {
            return;
        }

        // make property/method available as a global (no this. prefix required)
        global[key] = runtime[key];
    });
}
208571
def create(server_context, domain_definition, container_path=None):
    # type: (ServerContext, dict, str) -> Domain
    
    url = server_context.build_url('property', 'createDomain.api', container_path=container_path)

    headers = {
        'Content-Type': 'application/json'
    }

    domain = None

    raw_domain = server_context.make_request(url, json_dumps(domain_definition), headers=headers)

    if raw_domain is not None:
        domain = Domain.from_data(raw_domain)

    return domain