Copyright © Xerox Corporation, Codendi Team, 2001-2006. All Rights Reserved
3.3 File Release System functionsFile release system can return standard error codes:
'invalid_package_fault' (code '3017'): the package doesn't exist 'invalid_release_fault' (code '3018'): the release doesn't exist 'invalid_file_fault' (code '3019'): the file doesn't exist
getPackages: Display a list of available packages for a project
--project: UNIX name of the project you want to retrieve the packages in. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs getPackages --project=project1
+------------+----------+----------------+-----------+------+-----------------+
| package_id | group_id | name | status_id | rank | approve_license |
+------------+----------+----------------+-----------+------+-----------------+
| 198 | 104 | package2 | 1 | 1 | |
| 197 | 104 | my_new_package | 1 | 2 | |
+------------+----------+----------------+-----------+------+-----------------+
|
Example 29. getPackages command
addPackage: Add a package to the File Release System
--name*: name of the new package that will be created.
--status_id: status_id of the new package. By default, the status is active.
--rank: rank of the new package that will be created. By default, set to 0.
--approve_license: whether the package should ask for a license approval on file download. By default, set to 1 (ask approval).
--project: UNIX name of the project you want to add the package in. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs addPackage --project=project1 --name="my_new_package" --status_id=1
+--------+
| Result |
+--------+
| 197 |
+--------+
|
Example 30. addPackage command
 | Note: The value returned (197) is the ID of the new package. |
getReleases: Display a list of available releases for a project and a given package
--package_id*: the id of the package the releases belong to
--project: UNIX name of the project you want to retrieve the releases in. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs getReleases --package_id=197
+------------+------------+---------------+--------------------------------+---------------------------...
| release_id | package_id | name | notes | changes ...
+------------+------------+---------------+--------------------------------+---------------------------...
| 144 | 197 | first version | somes notes about this release | first release ...
| 143 | 197 | new version | somes notes about this release | the changes of this new re...
+------------+------------+---------------+--------------------------------+---------------------------...
|
Example 31. getReleases command
addRelease: Add a release to the File Release System
--package_id*: id of the package this release will belong to
--name*: name of the new release that will be created.
--notes: notes about this new release
--changes: changes of this new release
--status_id: status_id of the new release. By default, the status is active.
--release_date: date of the new release, with YYYY-MM-DD format. By default, the release_date is the current date/time.
--project: UNIX name of the project you want to add the release in. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs addRelease --package_id=197 --name="new version" --notes="somes notes about this release" --changes="the changes of this new release" --status_id=1
+--------+
| Result |
+--------+
| 143 |
+--------+
|
Example 32. addRelease command
 | Note: The value returned (143) is the ID of the new release. |
getFiles: Display a list of available files for a project, a given package and a given release
--package_id*: the id of the package the files belong to
--release_id*: the id of the release the files belong to
--project: UNIX name of the project you want to retrieve the files in. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs getFiles --package_id=197 --release_id=143
+---------+------------+-----------------+-----------+---------+--------------+--------------+---------...
| file_id | release_id | file_name | file_size | type_id | processor_id | release_time | post_dat...
+---------+------------+-----------------+-----------+---------+--------------+--------------+---------...
| 419 | 143 | p197_r143/file1 | 14 | 9999 | 9999 | 1293787567 | 12937875...
+---------+------------+-----------------+-----------+---------+--------------+--------------+---------...
|
Example 33. getFiles command
Big file support: CLI is able to upload files bigger than 2GB when both CLI and remote server are running on top of 64 bits machines. If you ever need to release a big file in another case (client machine or server in 32 bits) you should use FTP for file upload and --uploaded_file option. addFile: Add a file to the File Release System
--package_id*: id of the package this file will belong to
--release_id*: id of the release this file will belong to
--local_file(*): location (local) of the new file that will be created. Use this argument if your file is local. Your file will be uploaded on the server. One of the argument --local_file or --uploaded_file is required, depending the way you want to add your file.
--uploaded_file(*): location of the new file that will be created. The file must already be located in the incoming directory on the server. One of the argument --local_file or --uploaded_file is required, depending the way you want to add your file.
--type_id: type_id of the new file
--processor_id: processor_id of the new file
--reference_md5: md5 of the file located in the incoming directory on the server.
--comment: A comment for the new file
--project: UNIX name of the project you want to add the file in. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
 | For local file md5sum is automatically calculated by CLI in client side, so the parameter reference_md5 is taken into consideration only for uploded files and it is absolutely useless to add it for a local file. |
[ounis@linux tuleap-cli]$ ./tuleap.php frs addFile --package_id=197 --release_id=143 --local_file=file1
+--------+
| Result |
+--------+
| 419 |
+--------+
(for a local file or )
[ounis@linux tuleap-cli]$ ./tuleap.php frs addFile --package_id=197 --release_id=143 --uploaded_file=file2
+--------+
| Result |
+--------+
| 420 |
+--------+
(for a file already uploaded in the incoming directory of your server)
|
Example 34. addFile command
 | Note: The value returned (420) is the ID of the new file. |
Big file support: CLI is able to download files bigger than 2GB when both CLI and remote server are running on top of 64 bits machines. getFile: Get the content of a file in the File Release System
--package_id*: id of the package the file belongs to
--release_id*: id of the release the file belongs to
--file_id*: id of the file we want to get the content
--output: output location to download the file. If not specified, the content of the file is displayed on the standard output
--remote_name: Use the name retrieved from the server instead of using --output
--project: UNIX name of the project you want to get the file. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs getFile --package_id=197 --release_id=143 --file_id=419 --output=./downloaded_file
File retrieved successfully.
|
Example 35. getFile command
 | Note: no error returned, the file is downloaded successfully. |
getUploadedFiles: Get the list of files uploaded using ftp into the incoming directory
--project: UNIX name of the project you want to get the file. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs getUploadedFiles
+--------+
| Result |
+--------+
| file1 |
| file2 |
+--------+
|
Example 36. getUploadedFiles command
deleteFile: Delete a file from the File Release System
--package_id*: id of the package the file belongs to
--release_id*: id of the release the file belongs to
--file_id*: id of the file we want to delete
--project: UNIX name of the project you want to delete the file. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs deleteFile --package_id=197 --release_id=143 --file_id=420
+--------+
| Result |
+--------+
| 1 |
+--------+
|
Example 37. deleteFile command
 | Return code (1) means the deletion succeeded. Otherwise server throw an error. |
getFileInfo: Get informations about a file in the File Release System
--package_id*: id of the package the file belongs to
--release_id*: id of the release the file belongs to
--file_id*: id of the file we want to get the info
--project: UNIX name of the project you want to get the file info. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs getFileInfo --package_id=197 --release_id=143 --file_id=419
+---------+------------+-----------------+-----------+---------+--------------+--------------+---------...
| file_id | release_id | file_name | file_size | type_id | processor_id | release_time | post_dat...
+---------+------------+-----------------+-----------+---------+--------------+--------------+---------...
| 419 | 143 | p197_r143/file1 | 14 | 9999 | 9999 | 1293787567 | 12937875...
+---------+------------+-----------------+-----------+---------+--------------+--------------+---------...
|
Example 38. getFileInfo command
3.3.11 deleteEmptyPackagedeleteEmptyPackage: Delete an empty package
--project: UNIX name of the project where empty packages will be deleted. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
--package_id*: Id of the package to delete
[ounis@linux tuleap-cli]$ ./tuleap.php frs deleteEmptyPackage --package_id=2953
+------------+----------+------+-----------+------+-----------------+
| package_id | group_id | name | status_id | rank | approve_license |
+------------+----------+------+-----------+------+-----------------+
| 2953 | 1 | test | 1 | 1025 | |
+------------+----------+------+-----------+------+-----------------+
|
Example 39. deleteEmptyPackage command
 | Return value is the details of the deleted package. |
3.3.12 deleteAllEmptyPackagesdeleteAllEmptyPackages: Delete all empty packages for a given project
--project: UNIX name of the project where empty packages will be deleted. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
[ounis@linux tuleap-cli]$ ./tuleap.php frs deleteAllEmptyPackages
+------------+----------+----------------+-----------+------+-----------------+
| package_id | group_id | name | status_id | rank | approve_license |
+------------+----------+----------------+-----------+------+-----------------+
| 2959 | 1 | EmptyPackage | 1 | 8 | |
| 2958 | 1 | testingCLI | 1 | 9 | |
+------------+----------+----------------+-----------+------+-----------------+
|
Example 40. deleteAllEmptyPackages command
 | Return value is the list of the deleted packages. |
3.3.13 deleteEmptyReleasedeleteEmptyRelease: Delete the given release if empty
--project: UNIX name of the project where empty releases will be deleted. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
--package_id*: Id of the package where empty releases will be deleted.
--release_id*: Id of the release to delete.
[ounis@linux tuleap-cli]$ ./tuleap.php frs deleteEmptyRelease --package_id=288 --release_id=226
+------------+------------+---------------+-------+---------+-----------+--------------+-------------+
| release_id | package_id | name | notes | changes | status_id | release_date | released_by |
+------------+------------+---------------+-------+---------+-----------+--------------+-------------+
| 226 | 288 | empty release | | | 1 | 1323648000 | 103 |
+------------+------------+---------------+-------+---------+-----------+--------------+-------------+
|
Example 41. deleteEmptyRelease command
 | Return value is the details of deleted release. |
3.3.14 deleteAllEmptyReleasesdeleteAllEmptyReleases: Delete all empty releases of the given package
--project: UNIX name of the project where empty releases will be deleted. If none is specified, the project specified when you logged in will be used. If none was specified at that time, an error will be displayed.
--package_id*: Id of the package where empty releases will be deleted.
[ounis@linux tuleap-cli]$ ./tuleap.php frs deleteAllEmptyReleases --package_id=288
+------------+------------+---------------+-------+---------+-----------+--------------+-------------+
| release_id | package_id | name | notes | changes | status_id | release_date | released_by |
+------------+------------+---------------+-------+---------+-----------+--------------+-------------+
| 226 | 288 | empty release | | | 1 | 1323648000 | 103 |
| 224 | 288 | empty | | | 1 | 1323648000 | 103 |
+------------+------------+---------------+-------+---------+-----------+--------------+-------------+
|
Example 42. deleteAllEmptyReleases command
 | Return value is the list of deleted releases. |
Copyright © Xerox Corporation, Codendi Team, 2001-2006. All Rights Reserved |