Request: A decent API

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
tib
Posts: 9
Joined: Wed Jun 18, 2014 4:28 am

Request: A decent API

Post by tib » Mon Jun 23, 2014 7:58 am

The three API options available as I understand it are:
1. .NET C# DLL
2. Command line client
3. SOAP

The SOAP interface is not documented, generally unfriendly, and users are discouraged from using it.

The Command line client can be invoked from any environment, which is good. But it is dead slow. Each command takes about 5 seconds to execute. Operations consisting of 100s of commands take forever to perform.

The .NET C# DLL is limited to only be usable from within the Microsoft C# .NET environment. Calling it from any other environment is very difficult.

An API should be efficient, documented, and useable from any programming environment.
The currently available API options do not meet these basic criteria.

I'd suggest either:
1. A plain C DLL.
2. A documented TCP/IP communication protocol towards the Vault server. Telnet-style commands or XML, for example.
Both these two can be used from virtually any programming environment.

Any chance there is something like this available?

I am trying to use Vault from Borland C++ Builder, and today that does not seem to be possible within a reasonable development effort?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Request: A decent API

Post by Beth » Mon Jun 23, 2014 12:59 pm

On which OS are you using Borland C++ Builder?

Is there a list somewhere of the version control tools it currently supports? I could only find a line that mentioned their own version control.

I see with some of the others that a third-party tool is required (http://www.epocalipse.com/scx.htm). In the epocalipse site, it mentions working with our product SourceOffSite. If it works with that, there's a good chance it would work with Vault. Actually, I just saw further down that it mentions Vault.

I can take a feature request for integration with Borland C++ Builder.

F: 17763
Beth Kieler
SourceGear Technical Support

tib
Posts: 9
Joined: Wed Jun 18, 2014 4:28 am

Re: Request: A decent API

Post by tib » Tue Jun 24, 2014 4:41 am

Borland for windows.
But I don't want to integrate Vault with Borland Builder.
I am developing a Borland C++ application which will act as a Vault client and perform certain sequences of operations on the repository.

I am currently using the command line client API, but it is horribly slow. It takes several minutes to perform the operations I need.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Request: A decent API

Post by Beth » Tue Jun 24, 2014 8:34 am

If you try the same actions on the Vault GUI client to see if they are slow there too? If so, then we can troubleshoot this as a slowness issue.

What version of Vault are you using?

What is the end goal in performing those operations and what operations are they?
Beth Kieler
SourceGear Technical Support

tib
Posts: 9
Joined: Wed Jun 18, 2014 4:28 am

Re: Request: A decent API

Post by tib » Tue Sep 02, 2014 3:16 am

Sorry for the delayed response. Vacation times...

We are using Vault version 6.1.0 (531)

Each command takes approximately 5-15 seconds to do using the command-line client.
In the GUI it is 1 second or less.
The operations I do consists of ~100 vault commands, which means one single operation takes up to 25 minutes to do.

I have done some investigations on the behaviour of the commandline client. A big chunk of the 15 seconds is spent before it actually starts talking to the vault server. (investigated using wireshark). I am guessing it reads in the local cache copy of the repository?
Since the command line client has to re-read the complete local copy of the respository for each and every command, as well as log on to the server, it is only natural that it is slow.


The goal of the operations:
We use lots of shared files between projects, and we need a simple method of pinning all shared files in a project to a certain label before compiling and releasing a project.
So the commands I am using are:
1. List all files in a selected project.
2. List all labels for each and every file in the project.
3. The user gets to select which labels to use in the project.
4. Pin each file to one of the selected labels.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Request: A decent API

Post by Beth » Tue Sep 02, 2014 4:59 pm

Have you tried using the Batch command with Vault? That should help it not have to do everything from scratch each time.
Beth Kieler
SourceGear Technical Support

tib
Posts: 9
Joined: Wed Jun 18, 2014 4:28 am

Re: Request: A decent API

Post by tib » Thu Sep 11, 2014 3:18 am

I was not aware of the batch mode.
I have now changed my implementation to use batch mode, and it is certainly a bit faster. But still pretty slow.

For example, it takes about 1 second to pin 5 files in the Vault GUI. But it takes 40 seconds to pin 5 files using the command line client in batch mode.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Request: A decent API

Post by Beth » Thu Sep 11, 2014 7:54 am

Are all the files getting pinned to the same label?

Could you just pin at the folder level?

We have a pin power toy that could pin all the files in one operation, but that's a GUI client. Does the pin have to be run from the command line?
Beth Kieler
SourceGear Technical Support

tib
Posts: 9
Joined: Wed Jun 18, 2014 4:28 am

Re: Request: A decent API

Post by tib » Mon Sep 15, 2014 4:54 am

No, all files are not pinned at the same label.
That is basically why we have to create a custom tool for the job.
It does not have to be a command line utility. The custom tool I am building is a GUI tool.

In the Vault GUI client, pinning is a pretty quick operation. Any idea why it is so slow in the commandline version?

Is the "power toy" capable of pinning different files to different labels?

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Request: A decent API

Post by jclausius » Wed Sep 17, 2014 11:45 am

Do you know if the PIN command is being committed for each operation? To check for this, after running your BATCH, but before running COMMIT you can run the LISTCHANGESET, to see if the pin is listed there.

Although I don't think this applies to your case, but if one uses "-1" as the version, this avoids an unnecessary round trip to the server looking things up through history.
Jeff Clausius
SourceGear

tib
Posts: 9
Joined: Wed Jun 18, 2014 4:28 am

Re: Request: A decent API

Post by tib » Thu Sep 25, 2014 6:43 am

No, they are not committed at the moment.
I use the command like this:
PIN "$/Project/file.c" 7

If pin 29 different files using commands like above in BATCH mode, it takes 3 minutes and 40 seconds to complete.

This is really too long to have to sit and wait for.

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Request: A decent API

Post by jclausius » Thu Sep 25, 2014 7:11 am

Understood.

If you could use the C# API, there might be a way to speed things up, but you would have to know some internal IDs (we call them object-version IDs or objverid).

Regardless, I've logged an enhancement request to optimize the PIN command from the command line to speed up performance. (F:17893). If you want, you can email support AT sourcegear DOT com and we can keep you apprised of the feature.
Jeff Clausius
SourceGear

Post Reply