// InfoByUUID Gets zone information from its UUID
488617
func (z *Zone) InfoByUUID(uuid uuid.UUID) (info *Info, err error) {
	_, err = z.Get(fmt.Sprintf("/zones/%s", uuid), &info)
	if debug {
		fmt.Printf("DEBUG: InfoByUUID returned SharingID=%v domain=%v\n", info.SharingID, info.Name)
	}
	return
}
508340
func Info(id, description string, keysAndValues ...interface{}) {
	keysAndValues = append([]interface{}{"golog_id", id}, keysAndValues...)
	(DefaultLogger.(*logger)).info(1, description, keysAndValues...)
}
167429
func (a *ACLTokens) Info(accessorID string, q *QueryOptions) (*ACLToken, *QueryMeta, error) {
	if accessorID == "" {
		return nil, nil, fmt.Errorf("missing accessor ID")
	}
	var resp ACLToken
	wm, err := a.client.query("/v1/acl/token/"+accessorID, &resp, q)
	if err != nil {
		return nil, nil, err
	}
	return &resp, wm, nil
}
474084
func (self *Zone) Info(id int64) (*ZoneInfo, error) {
	var res map[string]interface{}
	params := []interface{}{self.Key, id}
	if err := self.Call("domain.zone.info", params, &res); err != nil {
		return nil, err
	}
	return ToZoneInfo(res), nil
}
1351550
func (s *shard) info() *ShardInfo {
	var rate float64
	var eta *timestamp.Timestamp

	if runtime := s.Updated.Sub(s.Created); runtime > 0 {
		rate = float64(s.ProcessedCount) / runtime.Seconds()
		if s.ExpectedCount != -1 && rate > 0.0001 {
			secs := float64(s.ExpectedCount) / rate
			eta = google.NewTimestamp(s.Created.Add(time.Duration(float64(time.Second) * secs)))
		}
	}

	return &ShardInfo{
		Index:             int32(s.Index),
		State:             s.State,
		Error:             s.Error,
		Created:           google.NewTimestamp(s.Created),
		Updated:           google.NewTimestamp(s.Updated),
		Eta:               eta, // nil if unknown
		ProcessedEntities: s.ProcessedCount,
		TotalEntities:     s.ExpectedCount, // -1 if unknown
		EntitiesPerSec:    float32(rate),   // 0 if unknown
	}
}
433449
func (m *Mapper) InfoForObject(obj runtime.Object) (*Info, error) {
	groupVersionKind, err := m.ObjectKind(obj)
	if err != nil {
		return nil, fmt.Errorf("unable to get type info from the object %q: %v", reflect.TypeOf(obj), err)
	}
	mapping, err := m.RESTMapping(groupVersionKind.GroupKind(), groupVersionKind.Version)
	if err != nil {
		return nil, fmt.Errorf("unable to recognize %v: %v", groupVersionKind, err)
	}
	client, err := m.ClientForMapping(mapping)
	if err != nil {
		return nil, fmt.Errorf("unable to connect to a server to handle %q: %v", mapping.Resource, err)
	}
	name, _ := mapping.MetadataAccessor.Name(obj)
	namespace, _ := mapping.MetadataAccessor.Namespace(obj)
	resourceVersion, _ := mapping.MetadataAccessor.ResourceVersion(obj)
	return &Info{
		Mapping:   mapping,
		Client:    client,
		Namespace: namespace,
		Name:      name,

		Object:          obj,
		ResourceVersion: resourceVersion,
	}, nil
}
1344506
func (c *Connect) LookupStoragePoolByUUID(uuid []byte) (*StoragePool, error) {
	if len(uuid) != C.VIR_UUID_BUFLEN {
		return nil, fmt.Errorf("UUID must be exactly %d bytes in size",
			int(C.VIR_UUID_BUFLEN))
	}
	cUuid := make([]C.uchar, C.VIR_UUID_BUFLEN)
	for i := 0; i < C.VIR_UUID_BUFLEN; i++ {
		cUuid[i] = C.uchar(uuid[i])
	}
	var err C.virError
	ptr := C.virStoragePoolLookupByUUIDWrapper(c.ptr, &cUuid[0], &err)
	if ptr == nil {
		return nil, makeError(&err)
	}
	return &StoragePool{ptr: ptr}, nil
}
1056004
func (user *User) Info() *Info {
	website, _ := url.Parse(user.Profile.Website)
	gravaURL := utils.Gravatar(user.Email)
	boardURL, _ := url.Parse(Configuration.NERDZHost)
	boardURL.Path = user.Username + "."

	return &Info{
		ID:          user.ID(),
		Owner:       nil,
		Name:        user.Name,
		Username:    user.Username,
		Website:     website,
		Image:       gravaURL,
		Closed:      user.Profile.Closed,
		BoardString: boardURL.String(),
		Type:        UserBoardID}
}
212577
func uuid() []byte {
	uuid := make([]byte, 16)
	_, err := rand.Read(uuid)
	if err != nil {
		panic("cue/hosted: uuid() failed to read random bytes")
	}

	// The following bit twiddling is outlined in RFC 4122.  In short, it
	// identifies the UUID as a v4 random UUID.
	uuid[6] = (4 << 4) | (0xf & uuid[6])
	uuid[8] = (8 << 4) | (0x3f & uuid[8])
	return uuid
}
1143120
func (s *UpdateEventSourceMappingInput) SetUUID(v string) *UpdateEventSourceMappingInput {
	s.UUID = &v
	return s
}
916599
func (s SearchIndex) FindByUuid(ctx context.Context, dc *Datacenter, uuid string, vmSearch bool, instanceUuid *bool) (Reference, error) {
	req := types.FindByUuid{
		This:         s.Reference(),
		Uuid:         uuid,
		VmSearch:     vmSearch,
		InstanceUuid: instanceUuid,
	}
	if dc != nil {
		ref := dc.Reference()
		req.Datacenter = &ref
	}

	res, err := methods.FindByUuid(ctx, s.c, &req)
	if err != nil {
		return nil, err
	}

	if res.Returnval == nil {
		return nil, nil
	}
	return NewReference(s.c, *res.Returnval), nil
}
242224
func NewUUID() ([]byte, error) {
	uuid := make([]byte, 16)
	n, err := rand.Read(uuid[:])
	if err != nil {
		return nil, errors.Wrap(err, "could not generate random bytes")
	}
	if n != len(uuid) {
		return nil, errors.New("could not generate random bytes with 16 length")
	}

	// set version(v4)
	internal.SetVersion(uuid, internal.VersionRandom)
	// set layout(RFC4122)
	internal.SetLayout(uuid, internal.LayoutRFC4122)

	return uuid, nil
}
839576
func (c *Client) Info(id string) (*params.BackupsMetadataResult, error) {
	var result params.BackupsMetadataResult
	args := params.BackupsInfoArgs{ID: id}
	if err := c.facade.FacadeCall("Info", args, &result); err != nil {
		return nil, errors.Trace(err)
	}
	return &result, nil
}
455612
func UUIDFromBytes(input []byte) (UUID, error) {
	var u UUID
	if len(input) != 16 {
		return u, errors.New("UUIDs must be exactly 16 bytes long")
	}

	copy(u[:], input)
	return u, nil
}
84747
func (z *Zone) Update(zoneInfo Info) (status *Status, err error) {
	if zoneInfo.UUID == nil {
		return nil, fmt.Errorf("can not update zone %s without an id", zoneInfo.Name)
	}
	_, err = z.Patch(fmt.Sprintf("/zones/%s", zoneInfo.UUID), zoneInfo, &status)
	return
}
755752
func Info(v ...interface{}) {
	f := extractFields(&v)
	std.OutputF(LevelInfo, 2, fmt.Sprint(v...), f)
}
1329470
func identifyUID(ctx context.Context, nug idutil.NormalizedUsernameGetter,
	identifier idutil.Identifier, id keybase1.UserOrTeamID, t tlf.Type,
	offline keybase1.OfflineAvailability) error {
	name, err := nug.GetNormalizedUsername(ctx, id, offline)
	if err != nil {
		return err
	}
	return identifyUser(ctx, nug, identifier, name, id, t, offline)
}