//AddResourcePool adds the ResourcePool
770239
func (c *Client) AddResourcePool(pool pool.ResourcePool) error {
	return c.call("AddResourcePool", pool, nil)
}
1012813
func (s *StartImportInput) SetResourceType(v string) *StartImportInput {
	s.ResourceType = &v
	return s
}
214423
func (s *RelationalDatabaseEvent) SetResource(v string) *RelationalDatabaseEvent {
	s.Resource = &v
	return s
}
316345
func (s *Tag) SetResourceType(v string) *Tag {
	s.ResourceType = &v
	return s
}
721100
func (s *ResourcemetadataService) AddResourceDetail(p *AddResourceDetailParams) (*AddResourceDetailResponse, error) {
	resp, err := s.cs.newRequest("addResourceDetail", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r AddResourceDetailResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
260090
func (s *StackEvent) SetResourceType(v string) *StackEvent {
	s.ResourceType = &v
	return s
}
1302963
func (vm *VirtualMachine) GetResourcePool(ctx context.Context) (*object.ResourcePool, error) {
	vmMoList, err := vm.Datacenter.GetVMMoList(ctx, []*VirtualMachine{vm}, []string{"resourcePool"})
	if err != nil {
		klog.Errorf("Failed to get resource pool from VM: %q. err: %+v", vm.InventoryPath, err)
		return nil, err
	}
	return object.NewResourcePool(vm.Client(), vmMoList[0].ResourcePool.Reference()), nil
}
1188317
func (a *StorageAPIv4) CreatePool(p params.StoragePool) error {
	_, err := a.poolManager.Create(
		p.Name,
		storage.ProviderType(p.Provider),
		p.Attrs)
	return err
}
1291119
func (t *Template) AddResource(name string, resource ResourceProperties) *Resource {
	templateResource := &Resource{Properties: resource}
	t.Resources[name] = templateResource
	return templateResource
}
331976
func (c *Compiler) AddResource(url string, r io.Reader) error {
	res, err := newResource(url, r)
	if err != nil {
		return err
	}
	c.resources[res.url] = res
	return nil
}
1158820
func (c *Client) RemoveResourcePool(poolID string) error {
	return c.call("RemoveResourcePool", poolID, nil)
}
1182562
func (f *Facade) GetResourcePool(ctx datastore.Context, id string) (*pool.ResourcePool, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetResourcePool"))
	glog.V(2).Infof("Facade.GetResourcePool: id=%s", id)
	var entity pool.ResourcePool
	err := f.poolStore.Get(ctx, pool.Key(id), &entity)
	if datastore.IsErrNoSuchEntity(err) {
		return nil, nil
	}
	if err != nil {
		return nil, err
	}

	f.calcPoolCapacity(ctx, &entity)

	return &entity, nil
}
1008711
func (a *api) AddResourcePool(config PoolConfig) (*pool.ResourcePool, error) {
	client, err := a.connectMaster()
	if err != nil {
		return nil, err
	}

	p := pool.ResourcePool{
		ID:          config.PoolID,
		Realm:       config.Realm,
		CoreLimit:   config.CoreLimit,
		MemoryLimit: config.MemoryLimit,
		Permissions: config.Permissions,
	}

	if err := client.AddResourcePool(p); err != nil {
		return nil, err
	}

	return a.GetResourcePool(p.ID)
}
1148091
func (s *ActivityScheduledEventDetails) SetResource(v string) *ActivityScheduledEventDetails {
	s.Resource = &v
	return s
}
891049
func (s *Server) RemoveResourcePool(poolID string, _ *struct{}) error {
	return s.f.RemoveResourcePool(s.context(), poolID)
}
419259
func (p *roundRobinResourcePool) Register(resourceLocation string) error {
	if resourceLocation == "" {
		return errors.New("Registering invalid resource location")
	}

	p.rwMutex.Lock()
	defer p.rwMutex.Unlock()

	if p.isLameDuck {
		return errors.Newf(
			"Cannot register %s to lame duck resource pool",
			resourceLocation)
	}

	for _, locPool := range p.pools {
		if locPool.ResourceLocation == resourceLocation {
			return nil
		}
	}

	pool := p.createPool(p.options)
	if err := pool.Register(resourceLocation); err != nil {
		return err
	}

	p.pools = append(
		p.pools,
		&ResourceLocationPool{
			ResourceLocation: resourceLocation,
			Pool:             pool,
		})

	shuffle(p.pools)
	return nil
}
629640
func (_m *API) AddResourcePool(_a0 api.PoolConfig) (*pool.ResourcePool, error) {
	ret := _m.Called(_a0)

	var r0 *pool.ResourcePool
	if rf, ok := ret.Get(0).(func(api.PoolConfig) *pool.ResourcePool); ok {
		r0 = rf(_a0)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*pool.ResourcePool)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(api.PoolConfig) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}