Couchbase view sharing between buckets - couchbase

We are a group of developers where everybody has their own bucket - but the same views.
I'd like to have one file with views defined under source control.
This file shall then be somehow easily applicable to existing bucket so that views on this bucket would be updated.
How can I easily achieve that?

resolved with help of
http://www.couchbase.com/forums/thread/couchbase-view#comment-1007530
http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-designdoc-api.html
simply i keep my view definitions in files and through couchbase rest api i update the view in couchbase. so any time developer needs to update their bucket, they run simple tool which goes through folder with views and these are updated...

Related

BIM 360 Project Creation, Template Duplicate Folders (Update Request)

Related to this 2-year-old question: BIM 360 Project creation template
Is there still not a way to replicate the Web UI option "Activate Document Management" -> "Apply a project template" that duplicates folder structure and role-based permissions?
Specifically, I'm looking at requests to create a project
POST projects https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-POST/ supplying a template_project_id value
and then activate with
POST users/import v2 https://forge.autodesk.com/en/docs/bim360/v1/reference/http/projects-project_id-users-import-POST/
I don't see any other template input in the API documentation besides the first request, and that does not appear to bring folder structure along.
unfortunately, what you found is correct currently, creating a project from a template with folder structure and role permission is not supported with current API, but you can achieve that by yourself as shown in a sample project at https://github.com/Autodesk-Forge/forge-bim360.project.setup.tool.
This is actually a high requested wish HQ-5023 as you can see at https://fieldofviewblog.wordpress.com/2019/06/15/bim-360-acc-api-known-issues-and-wishes/#more-4424 , our engineering is actively working on that, we will update you at our blog if any progress.
Based on reading the documentation, and running some tests, this appears to be unavailable still. I would very much like to be proven incorrect by someone at Autodesk! Thanks.

Is there a way to list who viewed a file (and when)?

I'm searching for a little while and I can't find what I'm looking for, so it may be a good idea to ask it here.
Is there a way to obtain, by API, for a specific file, the name of the last user (and timestamp) who accessed a file?
Goal: to write to script to know who access what on my drive.
Unfortunately, what you want cannot be achieved. The Drive Activity API is used only for retrieving the activity on the specified file. You can gather the users who have view access but not the ones who have actually viewed the file.
The action object from the Drive Activity API is represented by the action detail. For a document at the moment, the action details are the following: create, edit, move, rename, delete, restore, permissionChange, comment, dlpChange, reference, settingsChange. Therefore, taking these into account as well, you cannot see who viewed a file.
Since the option of seeing the actual viewers of a file is still a relatively new feature in the UI, the option for the API does not yet exist.
What you can do instead is to file a feature request on Issue Tracker by accessing this link here.
Reference
Drive Activity API
You can use the Drive Activity API.

Is there any way to get Document Management activity logs using the Forge API

We are currently looking into the monitoring of documents and activities in BIM360. Webhooks for version added or changed work to a certain extent but only capture so much.
There is a way to manually export the logs into a csv file and idealy we would want to automate this process so our BI department has data to work with.
Furthermore if not possible, is this something you guys are planning to add to the API in the near future or is it a low prio kinda thing.
Cheers and thanks in advance
Sorry we don't have a direct API to extract that information. There is a built-in UI feature.
Via API you can get each file's version history, but that would require a recursive function to craw all folders & subfolders.

Monitor and automatically upload local files to Google Cloud Bucket

My goal is to make a website (hosted on Google's App Engine through a Bucket) that includes a upload button much like
<p>Directory: <input type="file" webkitdirectory mozdirectory /></p>
that prompts users to select a main directory.
The main directory will first generate a subfolder and have discrete files being written every few seconds, up to ~4000 per subfolder, upon which the machine software will create another subfolder and continue, and so on.
I want Google Bucket to automatically create a Bucket folder based on metadata (e.g. user login ID and time) in the background, and the website should monitor the main directory and subfolders, and automatically upload every file, sequentially from the time they are finished being written locally, into the Cloud Bucket folder. Each 'session' is expected to run for ~2-5 days.
Creating separate Cloud folders is meant to separate user data in case of multiple parallel users.
Does anyone know how this can be achieved? Would be good if there's sample code to adapt into existing HTML.
Thanks in advance!
As per #JohnHanely, this is not really feasible using a application. I also do not understand the use case entirely but I can provide some insight into monitoring Cloud Buckets.
GCP provides Cloud Functions:
Respond to change notifications emerging from Google Cloud Storage. These notifications can be configured to trigger in response to various events inside a bucket—object creation, deletion, archiving and metadata updates.
The Cloud Storage Triggers will help you avoid having to monitor the buckets yourself and can instead leave that to GCF.
Maybe you could expand on what you are trying to achieve with that many folders? Are you trying to create ~4,000 sub-folders per user? There may be a better path forward should we know more about the intended use of the data? Is seems you want hold data and perhaps a DB is better suited?
- Application
|--Accounts
|---- User1
|-------Metadata
|----User2
|------Meatadata

Is it possible to store view code in files?

Right now I enter view code (map & reduce) in the couchbase UI. This is very inconvenient, and I was wondering if there is a way to make couchbase scan the code from a folder?
This will allow me to put this code under version control, and allow me to create a script that copies code between environments.
I dont know of a 'native' way to store views in files, but you can add and remove views via REST. So you could implement a workaround.
Views REST API