• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Golang models.DesiredLRP类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/cloudfoundry-incubator/bbs/models.DesiredLRP的典型用法代码示例。如果您正苦于以下问题:Golang DesiredLRP类的具体用法?Golang DesiredLRP怎么用?Golang DesiredLRP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DesiredLRP类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: DesireLRP

func (db *SQLDB) DesireLRP(logger lager.Logger, desiredLRP *models.DesiredLRP) error {
	logger = logger.WithData(lager.Data{"process_guid": desiredLRP.ProcessGuid})
	logger.Info("starting")
	defer logger.Info("complete")

	return db.transact(logger, func(logger lager.Logger, tx *sql.Tx) error {
		routesData, err := json.Marshal(desiredLRP.Routes)
		runInfo := desiredLRP.DesiredLRPRunInfo(db.clock.Now())

		runInfoData, err := db.serializeModel(logger, &runInfo)
		if err != nil {
			logger.Error("failed-to-serialize-model", err)
			return err
		}

		volumePlacement := &models.VolumePlacement{}
		volumePlacement.DriverNames = []string{}
		for _, mount := range desiredLRP.VolumeMounts {
			volumePlacement.DriverNames = append(volumePlacement.DriverNames, mount.Driver)
		}

		volumePlacementData, err := db.serializeModel(logger, volumePlacement)
		if err != nil {
			logger.Error("failed-to-serialize-model", err)
			return err
		}

		guid, err := db.guidProvider.NextGUID()
		if err != nil {
			logger.Error("failed-to-generate-guid", err)
			return models.ErrGUIDGeneration
		}

		desiredLRP.ModificationTag = &models.ModificationTag{Epoch: guid, Index: 0}

		_, err = db.insert(logger, tx, desiredLRPsTable,
			SQLAttributes{
				"process_guid":           desiredLRP.ProcessGuid,
				"domain":                 desiredLRP.Domain,
				"log_guid":               desiredLRP.LogGuid,
				"annotation":             desiredLRP.Annotation,
				"instances":              desiredLRP.Instances,
				"memory_mb":              desiredLRP.MemoryMb,
				"disk_mb":                desiredLRP.DiskMb,
				"rootfs":                 desiredLRP.RootFs,
				"volume_placement":       volumePlacementData,
				"modification_tag_epoch": desiredLRP.ModificationTag.Epoch,
				"modification_tag_index": desiredLRP.ModificationTag.Index,
				"routes":                 routesData,
				"run_info":               runInfoData,
			},
		)
		if err != nil {
			logger.Error("failed-inserting-desired", err)
			return db.convertSQLError(err)
		}
		return nil
	})
}
开发者ID:timani,项目名称:bbs,代码行数:59,代码来源:desired_lrp_db.go


示例2: DesiredLRPs

func (db *ETCDDB) DesiredLRPs(logger lager.Logger, filter models.DesiredLRPFilter) (*models.DesiredLRPs, *models.Error) {
	root, bbsErr := db.fetchRecursiveRaw(logger, DesiredLRPSchemaRoot)
	if bbsErr.Equal(models.ErrResourceNotFound) {
		return &models.DesiredLRPs{}, nil
	}
	if bbsErr != nil {
		return nil, bbsErr
	}
	if root.Nodes.Len() == 0 {
		return &models.DesiredLRPs{}, nil
	}

	desiredLRPs := models.DesiredLRPs{}

	lrpsLock := sync.Mutex{}
	var workErr atomic.Value
	works := []func(){}

	for _, node := range root.Nodes {
		node := node

		works = append(works, func() {
			var lrp models.DesiredLRP
			deserializeErr := models.FromJSON([]byte(node.Value), &lrp)
			if deserializeErr != nil {
				logger.Error("failed-parsing-desired-lrp", deserializeErr)
				workErr.Store(fmt.Errorf("cannot parse lrp JSON for key %s: %s", node.Key, deserializeErr.Error()))
				return
			}

			if filter.Domain == "" || lrp.GetDomain() == filter.Domain {
				lrpsLock.Lock()
				desiredLRPs.DesiredLrps = append(desiredLRPs.DesiredLrps, &lrp)
				lrpsLock.Unlock()
			}
		})
	}

	throttler, err := workpool.NewThrottler(maxDesiredLRPGetterWorkPoolSize, works)
	if err != nil {
		logger.Error("failed-constructing-throttler", err, lager.Data{"max-workers": maxDesiredLRPGetterWorkPoolSize, "num-works": len(works)})
		return &models.DesiredLRPs{}, models.ErrUnknownError
	}

	logger.Debug("performing-deserialization-work")
	throttler.Work()
	if err, ok := workErr.Load().(error); ok {
		logger.Error("failed-performing-deserialization-work", err)
		return &models.DesiredLRPs{}, models.ErrUnknownError
	}
	logger.Debug("succeeded-performing-deserialization-work", lager.Data{"num-desired-lrps": len(desiredLRPs.GetDesiredLrps())})

	return &desiredLRPs, nil
}
开发者ID:Gerg,项目名称:bbs,代码行数:54,代码来源:desired_lrp_db.go


示例3: prettyPrint

func prettyPrint(encrypted []byte, key string, label string) {
	var decrypted, err = decrypt(encrypted, key, label)

	if err != nil {
		return
	}

	var model1 models.DesiredLRPRunInfo
	err = model1.Unmarshal(decrypted)
	if err != nil {
		// NOP
	} else {
		pretty.Println(model1)
		return
	}

	var model2 models.DesiredLRPSchedulingInfo
	err = model2.Unmarshal(decrypted)
	if err != nil {
		// NOP
	} else {
		pretty.Println(model2)
		return
	}

	var model3 models.ActualLRP
	err = model3.Unmarshal(decrypted)
	if err != nil {
		// NOP
	} else {
		pretty.Println(model3)
		return
	}

	var model4 models.Task
	err = model4.Unmarshal(decrypted)
	if err != nil {
		// NOP
	} else {
		pretty.Println(model4)
		return
	}

	var model5 models.DesiredLRP
	err = model5.Unmarshal(decrypted)
	if err != nil {
		log.Println("Unknown data type: ", string(decrypted))
	} else {
		pretty.Println(model5)
		return
	}
}
开发者ID:kei-yamazaki,项目名称:bbsDecryptor,代码行数:52,代码来源:main.go


示例4: DesireLRP

// DesireLRP creates a DesiredLRPSchedulingInfo and a DesiredLRPRunInfo. In order
// to ensure that the complete model is available and there are no races in
// Desired Watches, DesiredLRPRunInfo is created before DesiredLRPSchedulingInfo.
func (db *ETCDDB) DesireLRP(logger lager.Logger, desiredLRP *models.DesiredLRP) error {
	logger = logger.Session("create-desired-lrp", lager.Data{"process-guid": desiredLRP.ProcessGuid})
	logger.Info("starting")
	defer logger.Info("complete")

	schedulingInfo, runInfo := desiredLRP.Explode()

	err := db.createDesiredLRPRunInfo(logger, &runInfo)
	if err != nil {
		return err
	}

	err = db.createDesiredLRPSchedulingInfo(logger, &schedulingInfo)
	if err != nil {
		return err
	}

	db.startInstanceRange(logger, 0, schedulingInfo.Instances, &schedulingInfo)
	return nil
}
开发者ID:emc-xchallenge,项目名称:bbs,代码行数:23,代码来源:desired_lrp_db.go


示例5: UpdateDesiredLRP

func (db *ETCDDB) UpdateDesiredLRP(logger lager.Logger, processGuid string, update *models.DesiredLRPUpdate) (*models.DesiredLRP, error) {
	logger.Info("starting")
	defer logger.Info("complete")

	var schedulingInfo *models.DesiredLRPSchedulingInfo
	var err error
	var beforeDesiredLRP *models.DesiredLRP

	for i := 0; i < 2; i++ {
		var index uint64

		beforeDesiredLRP, index, err = db.rawDesiredLRPByProcessGuid(logger, processGuid)
		if err != nil {
			logger.Error("failed-to-fetch-desired-lrp", err)
			break
		}

		schedulingInfoValue := beforeDesiredLRP.DesiredLRPSchedulingInfo()
		schedulingInfo = &schedulingInfoValue
		schedulingInfo.ApplyUpdate(update)

		err = db.updateDesiredLRPSchedulingInfo(logger, schedulingInfo, index)
		if err != nil {
			logger.Error("update-scheduling-info-failed", err)
			modelErr := models.ConvertError(err)
			if modelErr != models.ErrResourceConflict {
				break
			}
			// Retry on CAS fail
			continue
		}

		break
	}

	if err != nil {
		return nil, err
	}

	return beforeDesiredLRP, nil
}
开发者ID:timani,项目名称:bbs,代码行数:41,代码来源:desired_lrp_db.go


示例6: DesiredLRPByProcessGuid_r1

func (h *DesiredLRPHandler) DesiredLRPByProcessGuid_r1(w http.ResponseWriter, req *http.Request) {
	var err error
	logger := h.logger.Session("desired-lrp-by-process-guid", lager.Data{"revision": 0})

	request := &models.DesiredLRPByProcessGuidRequest{}
	response := &models.DesiredLRPResponse{}

	err = parseRequest(logger, req, request)
	if err == nil {
		var lrp *models.DesiredLRP
		lrp, err = h.desiredLRPDB.DesiredLRPByProcessGuid(logger, request.ProcessGuid)
		if err == nil {
			transformedLRP := lrp.VersionDownTo(format.V1)
			response.DesiredLrp = transformedLRP
		}
	}

	response.Error = models.ConvertError(err)

	writeResponse(w, response)
	exitIfUnrecoverable(logger, h.exitChan, response.Error)
}
开发者ID:timani,项目名称:bbs,代码行数:22,代码来源:desired_lrp_handlers_deprecated.go


示例7: WriteRunInfo

func (m *SplitDesiredLRP) WriteRunInfo(logger lager.Logger, desiredLRP models.DesiredLRP) {
	environmentVariables := make([]models.EnvironmentVariable, len(desiredLRP.EnvironmentVariables))
	for i := range desiredLRP.EnvironmentVariables {
		environmentVariables[i] = *desiredLRP.EnvironmentVariables[i]
	}

	egressRules := make([]models.SecurityGroupRule, len(desiredLRP.EgressRules))
	for i := range desiredLRP.EgressRules {
		egressRules[i] = *desiredLRP.EgressRules[i]
	}

	runInfo := models.DesiredLRPRunInfo{
		DesiredLRPKey:        desiredLRP.DesiredLRPKey(),
		EnvironmentVariables: environmentVariables,
		Setup:                desiredLRP.Setup,
		Action:               desiredLRP.Action,
		Monitor:              desiredLRP.Monitor,
		StartTimeoutMs:       desiredLRP.StartTimeoutMs,
		Privileged:           desiredLRP.Privileged,
		CpuWeight:            desiredLRP.CpuWeight,
		Ports:                desiredLRP.Ports,
		EgressRules:          egressRules,
		LogSource:            desiredLRP.LogSource,
		MetricsGuid:          desiredLRP.MetricsGuid,
	}

	runInfoPayload, marshalErr := m.serializer.Marshal(logger, format.ENCRYPTED_PROTO, &runInfo)
	if marshalErr != nil {
		logger.Error("failed-marshaling-run-info", marshalErr, lager.Data{"process_guid": runInfo.ProcessGuid})
	}

	_, setErr := m.storeClient.Set(etcd.DesiredLRPRunInfoSchemaPath(runInfo.ProcessGuid), runInfoPayload, etcd.NO_TTL)
	if setErr != nil {
		logger.Error("failed-set-of-run-info", marshalErr, lager.Data{"process_guid": runInfo.ProcessGuid})
	}
}
开发者ID:timani,项目名称:bbs,代码行数:36,代码来源:1442529338_split_desired_lrp.go


示例8: WriteSchedulingInfo

func (m *SplitDesiredLRP) WriteSchedulingInfo(logger lager.Logger, desiredLRP models.DesiredLRP) {
	schedulingInfo := models.DesiredLRPSchedulingInfo{
		DesiredLRPKey:      desiredLRP.DesiredLRPKey(),
		Annotation:         desiredLRP.Annotation,
		Instances:          desiredLRP.Instances,
		DesiredLRPResource: desiredLRP.DesiredLRPResource(),
	}
	if desiredLRP.Routes != nil {
		schedulingInfo.Routes = *desiredLRP.Routes
	}
	if desiredLRP.ModificationTag != nil {
		schedulingInfo.ModificationTag = *desiredLRP.ModificationTag
	}

	schedulingInfoPayload, marshalErr := m.serializer.Marshal(logger, format.ENCRYPTED_PROTO, &schedulingInfo)
	if marshalErr != nil {
		logger.Error("failed-marshaling-scheduling-info", marshalErr, lager.Data{"process_guid": schedulingInfo.ProcessGuid})
	}

	_, setErr := m.storeClient.Set(etcd.DesiredLRPSchedulingInfoSchemaPath(desiredLRP.ProcessGuid), schedulingInfoPayload, etcd.NO_TTL)
	if setErr != nil {
		logger.Error("failed-set-of-scheduling-info", marshalErr, lager.Data{"process_guid": schedulingInfo.ProcessGuid})
	}
}
开发者ID:timani,项目名称:bbs,代码行数:24,代码来源:1442529338_split_desired_lrp.go


示例9:

	"encoding/json"

	. "github.com/cloudfoundry-incubator/bbs/db/etcd"
	"github.com/cloudfoundry-incubator/bbs/models"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gbytes"
)

var _ = Describe("Watchers", func() {
	Describe("WatchForDesiredLRPChanges", func() {
		var (
			creates chan *models.DesiredLRP
			changes chan *models.DesiredLRPChange
			deletes chan *models.DesiredLRP
			stop    chan<- bool
			errors  <-chan error
			lrp     *models.DesiredLRP
		)

		BeforeEach(func() {
			routePayload := json.RawMessage(`{"port":8080,"hosts":["route-1","route-2"]}`)
			lrp = &models.DesiredLRP{
				ProcessGuid: "some-process-guid",
				Domain:      "tests",
				RootFs:      "some:rootfs",
				Action: models.WrapAction(&models.DownloadAction{
					From: "http://example.com",
					To:   "/tmp/internet",
					User: "diego",
				}),
开发者ID:Gerg,项目名称:bbs,代码行数:32,代码来源:event_db_test.go


示例10:

	"golang.org/x/crypto/ssh"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("PermissionsBuilder", func() {
	Describe("Build", func() {
		var (
			logger         *lagertest.TestLogger
			expectedRoute  routes.SSHRoute
			desiredLRP     *models.DesiredLRP
			actualLRPGroup *models.ActualLRPGroup
			bbsClient      *fake_bbs.FakeClient
			credentials    []byte
			metadata       *fake_ssh.FakeConnMetadata

			permissionsBuilder authenticators.PermissionsBuilder
			permissions        *ssh.Permissions
			buildErr           error
			processGuid        string
			index              int
		)

		BeforeEach(func() {
			logger = lagertest.NewTestLogger("test")

			expectedRoute = routes.SSHRoute{
				ContainerPort:   1111,
				PrivateKey:      "pem-encoded-key",
				HostFingerprint: "host-fingerprint",
开发者ID:benjaminharnett,项目名称:diego-ssh,代码行数:31,代码来源:permissions_builder_test.go


示例11:

	Context("on startup", func() {
		It("processes events after the first sync event", func() {
			Consistently(bbsClient.SubscribeToEventsCallCount).Should(Equal(0))
			syncEvents.Sync <- struct{}{}
			Eventually(bbsClient.SubscribeToEventsCallCount).Should(BeNumerically(">", 0))
		})
	})

	Describe("Desired LRP changes", func() {
		JustBeforeEach(func() {
			syncEvents.Sync <- struct{}{}
			Eventually(emitter.EmitCallCount).ShouldNot(Equal(0))
		})

		Context("when a create event occurs", func() {
			var desiredLRP *models.DesiredLRP

			BeforeEach(func() {
				routes := cfroutes.CFRoutes{expectedCFRoute}.RoutingInfo()
				desiredLRP = &models.DesiredLRP{
					Action: models.WrapAction(&models.RunAction{
						User: "me",
						Path: "ls",
					}),
					Domain:      "tests",
					ProcessGuid: expectedProcessGuid,
					Ports:       []uint32{expectedContainerPort},
					Routes:      &routes,
					LogGuid:     logGuid,
				}
			})
开发者ID:emc-xchallenge,项目名称:route-emitter,代码行数:31,代码来源:watcher_test.go


示例12: SetRawDesiredLRP

func (t *ETCDHelper) SetRawDesiredLRP(lrp *models.DesiredLRP) {
	schedulingInfo, runInfo := lrp.CreateComponents(t.clock.Now())

	t.SetRawDesiredLRPSchedulingInfo(&schedulingInfo)
	t.SetRawDesiredLRPRunInfo(&runInfo)
}
开发者ID:timani,项目名称:bbs,代码行数:6,代码来源:creators.go


示例13:

	"encoding/json"
	"fmt"
	"time"

	"github.com/cloudfoundry-incubator/bbs/format"
	"github.com/cloudfoundry-incubator/bbs/models"
	"github.com/cloudfoundry-incubator/bbs/models/test/model_helpers"
	"github.com/gogo/protobuf/proto"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/ginkgo/extensions/table"
	. "github.com/onsi/gomega"
)

var _ = Describe("DesiredLRP", func() {
	var desiredLRP models.DesiredLRP

	jsonDesiredLRP := `{
    "setup": {
      "serial": {
        "actions": [
          {
            "download": {
              "from": "http://file-server.service.cf.internal:8080/v1/static/buildpack_app_lifecycle/buildpack_app_lifecycle.tgz",
              "to": "/tmp/lifecycle",
              "cache_key": "buildpack-cflinuxfs2-lifecycle",
							"user": "someone",
							"checksum_algorithm": "md5",
							"checksum_value": "some random value"
            }
          },
开发者ID:timani,项目名称:bbs,代码行数:31,代码来源:desired_lrp_test.go


示例14:

				etcdRunner.Stop()
			})

			AfterEach(func() {
				etcdRunner.Start()
			})

			It("errors", func() {
				_, err := etcdDB.DesiredLRPSchedulingInfos(logger, filter)
				Expect(err).To(HaveOccurred())
			})
		})
	})

	Describe("DesireLRP", func() {
		var lrp *models.DesiredLRP

		BeforeEach(func() {
			lrp = model_helpers.NewValidDesiredLRP("some-process-guid")
			lrp.Instances = 5
		})

		Context("when the desired LRP does not yet exist", func() {
			It("persists the scheduling info and run info", func() {
				err := etcdDB.DesireLRP(logger, lrp)
				Expect(err).NotTo(HaveOccurred())

				persisted, err := etcdDB.DesiredLRPByProcessGuid(logger, "some-process-guid")
				Expect(err).NotTo(HaveOccurred())

				Expect(persisted.DesiredLRPKey()).To(Equal(lrp.DesiredLRPKey()))
开发者ID:timani,项目名称:bbs,代码行数:31,代码来源:desired_lrp_db_test.go


示例15:

			It("has the correct number of responses", func() {
				Expect(actualDesiredLRPs).To(HaveLen(2))
			})

			It("returns only the desired lrps in the requested domain", func() {
				for _, lrp := range desiredLRPs[domain] {
					expectedDesiredLRPs = append(expectedDesiredLRPs, lrp)
				}
				Expect(actualDesiredLRPs).To(ConsistOf(expectedDesiredLRPs))
			})
		})
	})

	Describe("GET /v1/desired_lrps/:process_guid", func() {
		var (
			desiredLRP         *models.DesiredLRP
			expectedDesiredLRP *models.DesiredLRP
		)

		JustBeforeEach(func() {
			expectedDesiredLRP = desiredLRPs["domain-1"][0]
			desiredLRP, getErr = client.DesiredLRPByProcessGuid(expectedDesiredLRP.GetProcessGuid())
		})

		It("responds without error", func() {
			Expect(getErr).NotTo(HaveOccurred())
		})

		It("returns all desired lrps from the bbs", func() {
			Expect(desiredLRP).To(Equal(expectedDesiredLRP))
		})
	})
开发者ID:Gerg,项目名称:bbs,代码行数:32,代码来源:desired_lrp_test.go


示例16:

			EgressRules: []*models.SecurityGroupRule{{
				Protocol:     models.TCPProtocol,
				Destinations: []string{"1.1.1.1/32", "2.2.2.2/32"},
				PortRange:    &models.PortRange{Start: 10, End: 16000},
			}},
			ModificationTag: &modTag,
		}
		err := desiredLRP.Validate()
		Expect(err).NotTo(HaveOccurred())

		return desiredLRP
	}

	Describe("Up", func() {
		var (
			existingDesiredLRP *models.DesiredLRP
			migrationErr       error
		)

		BeforeEach(func() {
			existingDesiredLRP = newValidDesiredLRP("process-guid")
			payload, err := serializer.Marshal(logger, format.ENCRYPTED_PROTO, existingDesiredLRP)
			Expect(err).NotTo(HaveOccurred())
			_, err = storeClient.Set(deprecations.DesiredLRPSchemaPath(existingDesiredLRP), payload, 0)
			Expect(err).NotTo(HaveOccurred())
		})

		JustBeforeEach(func() {
			migration.SetStoreClient(storeClient)
			migration.SetCryptor(cryptor)
			migrationErr = migration.Up(logger)
		})
开发者ID:emc-xchallenge,项目名称:bbs,代码行数:32,代码来源:1442529338_split_desired_lrp_test.go


示例17:

			It("returns an error", func() {
				response := models.EvacuationResponse{}
				err := response.Unmarshal(responseRecorder.Body.Bytes())
				Expect(err).NotTo(HaveOccurred())
				Expect(response.KeepContainer).To(BeFalse())
				Expect(response.Error).To(Equal(models.ErrBadRequest))
			})
		})
	})

	Describe("EvacuateRunningActualLRP", func() {
		var (
			request        *http.Request
			requestBody    *models.EvacuateRunningActualLRPRequest
			actualLRPGroup *models.ActualLRPGroup
			desiredLRP     *models.DesiredLRP

			actual           *models.ActualLRP
			evacuatingActual *models.ActualLRP
			afterActual      *models.ActualLRP
		)

		BeforeEach(func() {
			request = nil
			desiredLRP = model_helpers.NewValidDesiredLRP("the-guid")
			fakeDesiredLRPDB.DesiredLRPByProcessGuidReturns(desiredLRP, nil)

			actual = model_helpers.NewValidActualLRP("the-guid", 1)
			evacuatingActual = model_helpers.NewValidActualLRP("the-guid", 1)
			afterActual = model_helpers.NewValidActualLRP("the-guid", 1)

			key := actual.ActualLRPKey
开发者ID:timani,项目名称:bbs,代码行数:32,代码来源:evacuation_handler_test.go


示例18:

						Eventually(func() ([]string, error) {
							logger := logger.Session("domain-polling")
							logger.Debug("getting-domains")
							domains, err := bbsClient.Domains()
							logger.Debug("finished-getting-domains", lager.Data{"domains": domains, "error": err})
							return domains, err
						}, 2*domainTTL).ShouldNot(ContainElement("cf-apps"))
					})
				})
			})
		})

		Context("when LRPs in a different domain exist", func() {
			var otherDomainDesired *models.DesiredLRP
			var otherDomainDesiredResponse *models.DesiredLRP

			BeforeEach(func() {
				otherDomainDesired = &models.DesiredLRP{
					ProcessGuid: "some-other-lrp",
					Domain:      "some-domain",
					RootFs:      models.PreloadedRootFS("some-stack"),
					Instances:   1,
					Action: models.WrapAction(&models.RunAction{
						User: "me",
						Path: "reboot",
					}),
				}

				err := bbsClient.DesireLRP(otherDomainDesired)
				Expect(err).NotTo(HaveOccurred())
开发者ID:emc-xchallenge,项目名称:nsync,代码行数:30,代码来源:main_test.go


示例19:

package models_test

import (
	"encoding/json"
	"fmt"

	"github.com/cloudfoundry-incubator/bbs/models"
	"github.com/gogo/protobuf/proto"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("DesiredLRP", func() {
	var desiredLRP models.DesiredLRP

	jsonDesiredLRP := `{
    "setup": {
      "serial": {
        "actions": [
          {
            "download": {
              "from": "http://file-server.service.cf.internal:8080/v1/static/buildpack_app_lifecycle/buildpack_app_lifecycle.tgz",
              "to": "/tmp/lifecycle",
              "cache_key": "buildpack-cflinuxfs2-lifecycle",
							"user": "someone"
            }
          },
          {
            "download": {
              "from": "http://cloud-controller-ng.service.cf.internal:9022/internal/v2/droplets/some-guid/some-guid/download",
开发者ID:davidwadden,项目名称:lattice-release,代码行数:31,代码来源:desired_lrp_test.go


示例20: SetRawDesiredLRP

func (t *ETCDHelper) SetRawDesiredLRP(lrp *models.DesiredLRP) {
	schedulingInfo, runInfo := lrp.Explode()

	t.SetRawDesiredLRPSchedulingInfo(&schedulingInfo)
	t.SetRawDesiredLRPRunInfo(&runInfo)
}
开发者ID:emc-xchallenge,项目名称:bbs,代码行数:6,代码来源:creators.go



注:本文中的github.com/cloudfoundry-incubator/bbs/models.DesiredLRP类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang models.DesiredLRPSchedulingInfo类代码示例发布时间:2022-05-23
下一篇:
Golang models.ActualLRPKey类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap