// Create creates a probe with a RRSetKey using the ProbeInfoDTO dp
186591
func (s *ProbesService) Create(k RRSetKey, dp ProbeInfoDTO) (*http.Response, error) {
	return s.client.post(k.ProbesURI(), dp, nil)
}
1060073
func (doc *Document) Create(data []byte) error {
	docResp, err := doc.createOrUpdate(data)

	if err != nil {
		return err
	}

	doc.Id = docResp.Id
	doc.Rev = docResp.Rev
	return err
}
94262
func (d *driver) Create(
	locator *api.VolumeLocator,
	source *api.Source,
	spec *api.VolumeSpec) (string, error) {

	if spec.Size == 0 {
		return "", fmt.Errorf("Volume size cannot be zero")
	} else if spec.GetHaLevel() == 0 {
		return "", fmt.Errorf("HA level cannot be zero")
	}

	volumeID := strings.TrimSuffix(uuid.New(), "\n")

	if _, err := d.GetVol(volumeID); err == nil {
		return "", fmt.Errorf("volume with that id already exists")
	}

	// snapshot passes nil volumelabels
	if locator.VolumeLabels == nil {
		locator.VolumeLabels = make(map[string]string)
	}

	v := common.NewVolume(
		volumeID,
		api.FSType_FS_TYPE_XFS,
		locator,
		source,
		spec,
	)

	if err := d.CreateVol(v); err != nil {
		return "", err
	}
	return v.Id, nil
}
1107461
func (d *driver) Create(
	locator *api.VolumeLocator,
	source *api.Source,
	spec *api.VolumeSpec,
) (string, error) {
	if spec.Format != api.FSType_FS_TYPE_BTRFS && spec.Format != api.FSType_FS_TYPE_NONE {
		return "", fmt.Errorf("Filesystem format (%v) must be %v", spec.Format.SimpleString(), api.FSType_FS_TYPE_BTRFS.SimpleString())
	}
	volume := common.NewVolume(
		uuid.New(),
		api.FSType_FS_TYPE_BTRFS,
		locator,
		source,
		spec,
	)
	if err := d.CreateVol(volume); err != nil {
		return "", err
	}
	if err := d.btrfs.Create(volume.Id, "", "", nil); err != nil {
		return "", err
	}
	devicePath, err := d.btrfs.Get(volume.Id, "")
	if err != nil {
		return volume.Id, err
	}
	volume.DevicePath = devicePath
	return volume.Id, d.UpdateVol(volume)
}
309075
func (mr *MockPersistentVolumeInterfaceMockRecorder) Create(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockPersistentVolumeInterface)(nil).Create), arg0)
}
1227003
func (s *Service) Create(ctx context.Context, m *platform.DBRPMapping) error {
	if err := m.Validate(); err != nil {
		return nil
	}
	existing, err := s.loadDBRPMapping(ctx, m.Cluster, m.Database, m.RetentionPolicy)
	if err != nil {
		if err == errDBRPMappingNotFound {
			return s.PutDBRPMapping(ctx, m)
		}
		return err
	}

	if !existing.Equal(m) {
		return errors.New("dbrp mapping already exists")
	}

	return s.PutDBRPMapping(ctx, m)
}
1160661
func (wc walCryptor) Create(dirpath string, metadata []byte) (WAL, error) {
	w, err := wal.Create(dirpath, metadata)
	if err != nil {
		return nil, err
	}
	return &wrappedWAL{
		WAL:       w,
		encrypter: wc.encrypter,
		decrypter: wc.decrypter,
	}, nil
}
235233
func create(args *createArgs) (_ *createResult, err error) {
	// Prepare the backup builder.
	builder, err := newBuilder(args.backupDir, args.filesToBackUp, args.db)
	if err != nil {
		return nil, errors.Trace(err)
	}
	defer func() {
		if cerr := builder.cleanUp(args.noDownload); cerr != nil {
			cerr.Log(logger)
			if err == nil {
				err = cerr
			}
		}
	}()
	// Inject the metadata file.
	if args.metadataReader == nil {
		return nil, errors.New("missing metadataReader")
	}
	if err := builder.injectMetadataFile(args.metadataReader); err != nil {
		return nil, errors.Trace(err)
	}

	// Build the backup.
	if err := builder.buildAll(); err != nil {
		return nil, errors.Trace(err)
	}

	// Get the result.
	result, err := builder.result()
	if err != nil {
		return nil, errors.Trace(err)
	}

	// Return the result.  Note that the entire build workspace will be
	// deleted at the end of this function.  This includes the backup
	// archive file we built.  However, the handle to that file in the
	// result will still be open and readable.
	// If we ever support state machines on Windows, this will need to
	// change (you can't delete open files on Windows).
	return result, nil
}
457701
func (t *keyStringValueTree) Create(keys ...string) KeyStringValueChanger {
	var path []nodeContent
	for _, key := range keys {
		path = append(path, keyValue{key, ""})
	}
	n, err := t.container.root.create(path...)
	return &keyStringValueChanger{n, err}
}
1066250
func (s *InstantiateREST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error) {
	if err := rest.BeforeCreate(Strategy, ctx, obj); err != nil {
		return nil, err
	}
	if err := createValidation(obj); err != nil {
		return nil, err
	}

	request := obj.(*buildapi.BuildRequest)
	if request.TriggeredBy == nil {
		buildTriggerCauses := []buildapi.BuildTriggerCause{}
		request.TriggeredBy = append(buildTriggerCauses,
			buildapi.BuildTriggerCause{
				Message: buildapi.BuildTriggerCauseManualMsg,
			},
		)
	}
	return s.generator.InstantiateInternal(ctx, request)
}
626814
func (s *KeyGen) Create(user string, details string) (err error) {
	guid := s.guidMaker.Create()
	hash := createHash(user, guid)
	row := map[string]string{
		HMFieldActive:  "true",
		HMFieldDetails: details,
	}
	_, err = s.store().Do("HMSET", redis.Args{hash}.AddFlat(row)...)
	return
}
347761
func (c *FakeControllerRevisions) Create(controllerRevision *appsv1.ControllerRevision) (result *appsv1.ControllerRevision, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &appsv1.ControllerRevision{})

	if obj == nil {
		return nil, err
	}
	return obj.(*appsv1.ControllerRevision), err
}
1128409
func (k ProbeKey) RRSetKey() RRSetKey {
	return RRSetKey{
		Zone: k.Zone,
		Type: "A", // Only A records have probes
		Name: k.Name,
	}
}
40990
func (c *TrackerqueryController) Create(ctx *app.CreateTrackerqueryContext) error {
	_, err := login.ContextIdentity(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, goa.ErrUnauthorized(err.Error()))
	}

	err = validateCreateTrackerQueryPayload(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	// check if user has contribute scope
	err = c.authService.RequireScope(ctx, ctx.Payload.Data.Relationships.Space.Data.ID.String(), "contribute")
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}

	err = application.Transactional(c.db, func(appl application.Application) error {
		err = appl.Spaces().CheckExists(ctx, *ctx.Payload.Data.Relationships.Space.Data.ID)
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"err":      err,
				"space_id": ctx.Payload.Data.Relationships.Space.Data.ID,
			}, "unable to load space")
			return errors.NewBadParameterError("space", ctx.Payload.Data.Relationships.Space.Data.ID.String()).Expected("valid space ID")
		}

		err = appl.Trackers().CheckExists(ctx, ctx.Payload.Data.Relationships.Tracker.Data.ID)
		if err != nil {
			log.Error(ctx, map[string]interface{}{
				"err":        err,
				"tracker_id": ctx.Payload.Data.Relationships.Tracker.Data.ID,
			}, "unable to load tracker")
			return errors.NewBadParameterError("tracker", ctx.Payload.Data.Relationships.Tracker.Data.ID.String()).Expected("valid tracker ID")
		}
		if ctx.Payload.Data.ID != nil {
			// check if tracker query id exists
			err = appl.TrackerQueries().CheckExists(ctx, *ctx.Payload.Data.ID)
			if err == nil {
				log.Error(ctx, map[string]interface{}{
					"err":             err,
					"trackerquery_id": ctx.Payload.Data.Relationships.Tracker.Data.ID,
				}, "unable to load trackerquery")
				return errors.NewBadParameterError("trackerquery", ctx.Payload.Data.ID.String()).Expected("valid trackerquery ID")
			}

			// check if tracker query id is uuid.Nil
			if *ctx.Payload.Data.ID == uuid.Nil {
				return errors.NewBadParameterError("trackerquery", ctx.Payload.Data.ID.String()).Expected("valid trackerquery ID")
			}
		}
		return nil
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	err = application.Transactional(c.db, func(appl application.Application) error {
		trackerQuery := remoteworkitem.TrackerQuery{
			Query:          ctx.Payload.Data.Attributes.Query,
			Schedule:       ctx.Payload.Data.Attributes.Schedule,
			TrackerID:      ctx.Payload.Data.Relationships.Tracker.Data.ID,
			SpaceID:        *ctx.Payload.Data.Relationships.Space.Data.ID,
			WorkItemTypeID: ctx.Payload.Data.Relationships.WorkItemType.Data.ID,
		}
		if ctx.Payload.Data.ID != nil {
			trackerQuery.ID = *ctx.Payload.Data.ID
		}
		tq, err := appl.TrackerQueries().Create(ctx.Context, trackerQuery)
		if err != nil {
			return errs.Wrapf(err, "failed to create tracker query %s", ctx.Payload.Data)
		}
		res := &app.TrackerQuerySingle{
			Data: convertTrackerQueryToApp(appl, ctx.Request, *tq),
		}
		ctx.ResponseData.Header().Set("Location", app.TrackerqueryHref(tq.ID))
		return ctx.Created(res)
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	accessTokens := getAccessTokensForTrackerQuery(c.configuration) //configuration.GetGithubAuthToken()
	c.scheduler.ScheduleAllQueries(ctx, accessTokens)
	return nil
}
9692
func (c *samples) Create(sample *v1alpha1.Sample) (result *v1alpha1.Sample, err error) {
	result = &v1alpha1.Sample{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("samples").
		Body(sample).
		Do().
		Into(result)
	return
}
502268
func (c *podDisruptionBudgets) Create(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) {
	result = &v1beta1.PodDisruptionBudget{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("poddisruptionbudgets").
		Body(podDisruptionBudget).
		Do().
		Into(result)
	return
}
187556
func (m *GormResourceTypeRepository) Create(ctx context.Context, u *ResourceType) error {
	defer goa.MeasureSince([]string{"goa", "db", "resource_type", "create"}, time.Now())
	if u.ResourceTypeID == uuid.Nil {
		u.ResourceTypeID = uuid.NewV4()
	}
	err := m.db.Create(u).Error
	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"resource_type_id": u.ResourceTypeID,
			"err":              err,
		}, "unable to create the resource type")
		return errs.WithStack(err)
	}
	log.Debug(ctx, map[string]interface{}{
		"resource_type_id": u.ResourceTypeID,
	}, "Resource Type Scope created!")
	return nil
}