// GetQuota returns a specific quota by path
513334
func (c *Client) GetQuota(ctx context.Context, name string) (Quota, error) {
	quota, err := api.GetIsiQuota(ctx, c.API, c.API.VolumePath(name))
	if err != nil {
		return nil, err
	}

	return quota, nil
}
309068
func newQuotaAccessor() (*quotaAccessor, error) {
	liveLookupCache, err := lru.New(100)
	if err != nil {
		return nil, err
	}
	updatedCache, err := lru.New(100)
	if err != nil {
		return nil, err
	}

	// client and lister will be set when SetInternalKubeClientSet and SetInternalKubeInformerFactory are invoked
	return &quotaAccessor{
		liveLookupCache: liveLookupCache,
		liveTTL:         time.Duration(30 * time.Second),
		updatedQuotas:   updatedCache,
	}, nil
}
1000983
func (c SimpleFSClient) SimpleFSGetUserQuotaUsage(ctx context.Context) (res SimpleFSQuotaUsage, err error) {
	err = c.Cli.Call(ctx, "keybase.1.SimpleFS.simpleFSGetUserQuotaUsage", []interface{}{SimpleFSGetUserQuotaUsageArg{}}, &res)
	return
}
810155
func (l *rateLimiterImpl) MaxQuota() float64 {
	l.mutex.Lock()
	defer l.mutex.Unlock()
	return l.maxQuota
}
237523
func SetQuota(qr quota.QuotaRequest) *master.Call {
	return &master.Call{
		Type: master.Call_SET_QUOTA,
		SetQuota: &master.Call_SetQuota{
			QuotaRequest: qr,
		},
	}
}
531406
func (cephfsVolume *cephfs) GetPath() string {
	name := cephfsPluginName
	return cephfsVolume.plugin.host.GetPodVolumeDir(cephfsVolume.podUID, utilstrings.EscapeQualifiedName(name), cephfsVolume.volName)
}
1146383
func (client *QuobyteClient) SetVolumeQuota(volumeUUID string, quotaSize uint64) error {
	request := &setQuotaRequest{
		Quotas: []*quota{
			&quota{
				Consumer: []*consumingEntity{
					&consumingEntity{
						Type:       "VOLUME",
						Identifier: volumeUUID,
					},
				},
				Limits: []*resource{
					&resource{
						Type:  "LOGICAL_DISK_SPACE",
						Value: quotaSize,
					},
				},
			},
		},
	}

	return client.sendRequest("setQuota", request, nil)
}
1146984
func (b OpenshiftControllerClientBuilder) OpenshiftQuotaClientOrDie(name string) quotaclient.Interface {
	client, err := b.OpenshiftQuotaClient(name)
	if err != nil {
		klog.Fatal(err)
	}
	return client
}
1204947
func (s *scheduler) GetPath(nodes ...string) string {
	return path.Join(append([]string{"/pools"}, nodes...)...)
}
441187
func RemoveQuota(role string) *master.Call {
	return &master.Call{
		Type: master.Call_REMOVE_QUOTA,
		RemoveQuota: &master.Call_RemoveQuota{
			Role: role,
		},
	}
}
385665
func parseQuotaSpec(input []byte) (*api.QuotaSpec, error) {
	root, err := hcl.ParseBytes(input)
	if err != nil {
		return nil, err
	}

	// Top-level item should be a list
	list, ok := root.Node.(*ast.ObjectList)
	if !ok {
		return nil, fmt.Errorf("error parsing: root should be an object")
	}

	var spec api.QuotaSpec
	if err := parseQuotaSpecImpl(&spec, list); err != nil {
		return nil, err
	}

	return &spec, nil
}
863405
func (j *Json) GetPath(branch ...string) *Json {
	jin := j
	for _, p := range branch {
		jin = jin.Get(p)
	}
	return jin
}
1263951
func (client *Client) GetOrganizationQuota(guid string) (OrganizationQuota, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetOrganizationQuotaDefinitionRequest,
		URIParams:   Params{"organization_quota_guid": guid},
	})
	if err != nil {
		return OrganizationQuota{}, nil, err
	}

	var orgQuota OrganizationQuota
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &orgQuota,
	}

	err = client.connection.Make(request, &response)
	return orgQuota, response.Warnings, err
}
1072804
func (c *CodeResult) GetPath() string {
	if c == nil || c.Path == nil {
		return ""
	}
	return *c.Path
}
279979
func (r *realisClient) SetQuota(role string, cpu *float64, ramMb *int64, diskMb *int64) (*aurora.Response, error) {
	ramRes := aurora.NewResource()
	ramRes.RamMb = ramMb
	cpuRes := aurora.NewResource()
	cpuRes.NumCpus = cpu
	diskRes := aurora.NewResource()
	diskRes.DiskMb = diskMb
	quota := aurora.NewResourceAggregate()
	quota.Resources = []*aurora.Resource{cpuRes, ramRes, diskRes}
	resp, retryErr := r.thriftCallWithRetries(func() (*aurora.Response, error) {
		return r.adminClient.SetQuota(nil, role, quota)
	})

	if retryErr != nil {
		return resp, errors.Wrap(retryErr, "Unable to set role quota")
	}
	return resp, retryErr

}
797580
func (actor Actor) GetSpaceQuotaByName(quotaName, orgGUID string) (SpaceQuota, Warnings, error) {
	quotas, warnings, err := actor.CloudControllerClient.GetSpaceQuotas(orgGUID)

	if err != nil {
		return SpaceQuota{}, Warnings(warnings), err
	}

	for _, quota := range quotas {
		if quota.Name == quotaName {
			return SpaceQuota(quota), Warnings(warnings), nil
		}
	}

	return SpaceQuota{}, Warnings(warnings), actionerror.SpaceQuotaNotFoundByNameError{Name: quotaName}
}
580785
func (b *BlockedEvals) UnblockQuota(quota string, index uint64) {
	// Nothing to do
	if quota == "" {
		return
	}

	b.l.Lock()

	// Do nothing if not enabled
	if !b.enabled {
		b.l.Unlock()
		return
	}

	// Store the index in which the unblock happened. We use this on subsequent
	// block calls in case the evaluation was in the scheduler when a trigger
	// occurred.
	b.unblockIndexes[quota] = index
	b.l.Unlock()

	b.capacityChangeCh <- &capacityUpdate{
		quotaChange: quota,
		index:       index,
	}
}