/*
func GetStack
Argument : uuid
Returns : Stack JSON object
*/
506218
func GetStack(uuid string) (Stack, error) {

	url := ""
	if string(uuid[0]) == "/" {
		url = uuid[8:]
	} else {
		url = "stack/" + uuid + "/"
	}

	request := "GET"
	//Empty Body Request
	body := []byte(`{}`)
	var response Stack

	data, err := TutumCall(url, request, body)
	if err != nil {
		return response, err
	}

	err = json.Unmarshal(data, &response)
	if err != nil {
		return response, err
	}

	return response, nil
}
984349
func (m *MockCluster) Uuid() string {
	ret := m.ctrl.Call(m, "Uuid")
	ret0, _ := ret[0].(string)
	return ret0
}
804604
func (group *Group) GetUUIDs() []string {
	taskUUIDs := make([]string, len(group.Tasks))
	for i, signature := range group.Tasks {
		taskUUIDs[i] = signature.UUID
	}
	return taskUUIDs
}
732194
func getStackTracer(err error) (stackTracer, bool) {
	var st stackTracer

	ForEachCause(err, func(err error) bool {
		if s, ok := err.(stackTracer); ok {
			st = s

			return false
		}

		return true
	})

	return st, st != nil
}
231471
func OpenStack(dataDir string) (*Stack, error) {
	var err error

	// Create a new Stack.
	s := &Stack{
		DataDir: dataDir,
		db:      &leveldb.DB{},
		head:    0,
		tail:    0,
		isOpen:  false,
	}

	// Open database for the stack.
	s.db, err = leveldb.OpenFile(dataDir, nil)
	if err != nil {
		return s, err
	}

	// Check if this Goque type can open the requested data directory.
	ok, err := checkGoqueType(dataDir, goqueStack)
	if err != nil {
		return s, err
	}
	if !ok {
		return s, ErrIncompatibleType
	}

	// Set isOpen and return.
	s.isOpen = true
	return s, s.init()
}
1245417
func GetStacks(kubeCli *KubeCli, opts options.List) ([]*formatter.Stack, error) {
	if opts.AllNamespaces || len(opts.Namespaces) == 0 {
		if isAllNamespacesDisabled(kubeCli.ConfigFile().Kubernetes) {
			opts.AllNamespaces = true
		}
		return getStacksWithAllNamespaces(kubeCli, opts)
	}
	return getStacksWithNamespaces(kubeCli, opts, removeDuplicates(opts.Namespaces))
}
1068600
func (c *Client) StackInfo(stackIdentity string) (*Stack, error) {
	var stack Stack
	return &stack, c.Get(&stack, "/stacks/"+stackIdentity)
}
1266305
func NewStack() *Stack {
	stack := new(Stack)
	stack.currentPage = make([]interface{}, s_DefaultAllocPageSize)
	stack.pages = [][]interface{}{stack.currentPage}
	stack.offset = 0
	stack.capacity = s_DefaultAllocPageSize
	stack.pageSize = s_DefaultAllocPageSize
	stack.size = 0
	stack.currentPageIndex = 0

	return stack
}
81355
func (s *Layer) GetStack() []plugin.Plugin {
	s.mtx.RLock()
	defer s.mtx.RUnlock()
	return s.stack
}
1133344
func Parse(s string) (u UUID, err error) {
	if len(s) != 36 {
		return UUID{}, ErrUUIDInvalid
	}

	// create stack addresses for each section of the uuid.
	p := make([][]byte, 5)

	if _, err := fmt.Sscanf(s, format, &p[0], &p[1], &p[2], &p[3], &p[4]); err != nil {
		return u, err
	}

	copy(u[0:4], p[0])
	copy(u[4:6], p[1])
	copy(u[6:8], p[2])
	copy(u[8:10], p[3])
	copy(u[10:16], p[4])

	return
}
324012
func (s *Secret) GetUUID() ([]byte, error) {
	var cUuid [C.VIR_UUID_BUFLEN](byte)
	cuidPtr := unsafe.Pointer(&cUuid)
	var err C.virError
	result := C.virSecretGetUUIDWrapper(s.ptr, (*C.uchar)(cuidPtr), &err)
	if result != 0 {
		return []byte{}, makeError(&err)
	}
	return C.GoBytes(cuidPtr, C.VIR_UUID_BUFLEN), nil
}
810893
func (actor Actor) GetStack(guid string) (Stack, Warnings, error) {
	stack, warnings, err := actor.CloudControllerClient.GetStack(guid)

	if _, ok := err.(ccerror.ResourceNotFoundError); ok {
		return Stack{}, Warnings(warnings), actionerror.StackNotFoundError{GUID: guid}
	}

	return Stack(stack), Warnings(warnings), err
}
543358
func RlimitStack() (cur uint64, err error) {
	var r unix.Rlimit
	err = unix.Getrlimit(unix.RLIMIT_STACK, &r)
	return uint64(r.Cur), err // Type conversion because Cur is one of uint64, int64 depending on unix flavor.
}
79534
func Stack() []byte {
	stackBuf := stackPool.Get().([]byte)
	written := runtime.Stack(stackBuf, false)
	stackPool.Put(stackBuf)
	return stackBuf[:written]
}
1262393
func (m *Mux) SetStack(stack []plugin.Plugin) {
	m.Middleware.SetStack(stack)
}
62391
func (c *Client) GetTaskOutput(id int, typ string) ([]string, error) {
	r := c.NewRequest("GET", "/tasks/"+strconv.Itoa(id)+"/output?type="+typ)

	res, err := c.DoRequest(r)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()

	b, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return nil, err
	}

	return strings.Split(strings.TrimSuffix(string(b), "\n"), "\n"), nil
}
1182090
func (logger *Logger) GetStackMinLevel() event.Level {
	return event.Level(atomic.LoadInt32(&logger.stackMinLevel))
}