Quick reference to index the P4 Server

This chapter is a quick reference for performing an initial index of your P4 Server. For a small site, you may want to index everything, but for a larger site, you might only want to index a project.

Small site deployment

To index all of the changes in your depot, use the following curl request:

curl -H X-Auth-Token: <X-AUTH-TOKEN> -X POST http://localhost:1601/api/v1.2/index/changes

Medium site deployment

To index all changes in separate parts of your depot, run the curl request only on the parts of the depot you need to.

For example if you have project A, project B, and project C but you only want to index project A and project B:

Project A:

curl -H X-Auth-Token: <X-AUTH-TOKEN> -X POST -d '{"depotFile":"//projA/..."}' http://projA.perforce.com:1601/api/v1.2/index/changes

Project B

curl -H X-Auth-Token: <X-AUTH-TOKEN> -X POST -d '{"depotFile":"//projB/..."}' http://projB.perforce.com:1601/api/v1.2/index/changes

Related topics