func()

in api/om/om.go [86:107]


func (om *OmClient) AllocateBlock(volume string, bucket string, key string, clientID *uint64) (*ozone_proto.AllocateBlockResponse, error) {
	req := ozone_proto.AllocateBlockRequest{
		KeyArgs: &ozone_proto.KeyArgs{
			VolumeName: &volume,
			BucketName: &bucket,
			KeyName:    &key,
		},
		ClientID: clientID,
	}

	msgType := ozone_proto.Type_AllocateBlock
	wrapperRequest := ozone_proto.OMRequest{
		CmdType:              &msgType,
		AllocateBlockRequest: &req,
		ClientId:             &om.clientId,
	}
	resp, err := om.submitRequest(&wrapperRequest)
	if err != nil {
		return nil, err
	}
	return resp.AllocateBlockResponse, nil
}