From WATS version 2024.2.4, we have added a new REST API for managing your Production Manager Software Packages. This REST API will be available for users with an Enterprise plan.
More details can be found in the Swagger documentation, under the "Software" section.
These are the public calls in the new Software Package API:
- /POST
- Package
- PackageStatus
- Package/UploadZip/{ID}
- Package/FileAttribute/{ID}
- /PUT
- Package/{ID}
- /GET
- Package/{ID}
- PackageByName
- PackagesByTag
- Packages
- PackageFiles/{ID}
- VirtualFolders
- /DELETE
- Package/{ID}
- PackageByName
Documentation
The following documentation is a list over properties used, including where they are required and how they are to be used, for the various REST API endpoints.
/POST Package
/POST https://{your-wats-url}/api/Software/Package
Body:
Property | Data Type | Required |
name | String | Yes |
description | String | No |
virtualFolderId | String | No |
priority | Int | No |
tags | List | No |
installOnRoot | Bool | No |
Validation Rules
- Posting with an existing name will create a new Draft with Version + 1
- If provided, VirtalFolderId has to exist on server. Use /GET VirtualFolders to find this programmatically
- priority defaults to 0
- Tags is a list of json objects in this format:
- [{"key": "myTag", "value": "myValue"}, {"key": "myOtherTag", "value": "myOtherValue"}]
- installOnRoot determines if installation of package creates a folder with package name before unpacking files on the client. Default is false
Notes:
- Tag-Key has to exist in Tag Manager
/POST PackageStatus
/POST https://{your-wats-url}/api/Software/PackageStatus/{id}?status={status}&version={version}
Property | Data Type | Required |
ID | Guid | Yes |
status | String(Draft, Pending, Released, Revoked) | Yes |
version | Int | No |
Validation Rules
- Version will default to the highest version available if not present
/Post Package/UploadZip/{ID}
/POST https://{your-wats-url}/api/Software/Package/UploadZip/{ID}
Property | Data Type | Required |
ID | Guid | Yes |
cleanInstall | Bool | No |
Validation Rules
- cleanInstall will delete all files and folders for this Package
- cleanInstall defaults to false, which will merge files from a zip file
- Zip file has these rules:
- Has to be encoded as "multipart/form-data" in request content
- Content type has to be "application/zip"
- Only 1 zip per request is supported
- No files can be on zip root. All files has to be in a folder; myZip.zip/myFolder/myFile.file
Note: Zip might fail to upload if created in Unix. If this happens, create the zip file on a Windows machine and upload to the endpoint.
/POST FileAttribute/{ID}
/POST https://{your-wats-url}/api/Software/Package/FileAttribute/{ID}?attribute={attribute}
Property | Data Type | Required |
ID | Guid | Yes |
Attribute | String(See validation Rules) | Yes |
Validation Rules
- Attribute is required to be one of the following values
- None
- ExecuteOnce
- ExecuteAlways
- TopLevelFile
- OverwriteNever
- OverwriteOnNewPackageVersion
- ExecuteOncePerVersion
- Attribute string is case insensitive
/PUT Package/{ID}
/PUT https://{your-wats-url}/api/Software/Package/{ID}
Updates the following values for the existing Package determined by ID:
Property | Data Type |
ID | Guid |
Name | String |
Version | Int |
Status | String |
Description | String |
Tags | List |
Priority | Int |
VirtualFolderId | Guid |
installOnRoot | Bool |
Validation Rules
- Any existing value will be overwritten with new values (including empty/null fields)
- Status can only go in specific directions
- Draft -> Pending
- Pending -> Draft
- Pending -> Release
- Release -> Revoke
- Status supports these values
- Draft
- Pending
- Released
- Revoked
- When Revoked, Package can not be edited
- Tags is a list of json objects in this format:
- [{"key": "myTag", "value": "myValue"}, {"key": "myOtherTag", "value": "myOtherValue"}]
Note: It's expected that you fetch the Package object from a /GET endpoint first, make changes, then resubmit the edited object to this endpoint.
/GET Package/{ID}
/GET https://{your-wats-url}/api/Software/Package/{ID}
Property | Data Type | Required |
ID | Guid | Yes |
Validation Rules
- extendedInformation will add folders and files to the returned object. Defaults to false
/GET PackageByName
/GET https://{your-wats-url}/api/Software/PackageByName?name={name}&status={status}&version={version}
Property | Data Type | Required |
Name | String | Yes |
Status | String(Draft, Pending, Released, Revoked) | Yes |
Version | Int | No |
Validation Rules
- Name and Status has to be valid
- Default is to latest released package if Version is not included
/GET Packages
/GET https://{your-wats-url}/api/Software/Packages
Returns all Packages.
/GET PackagesByTag
/GET https://{your-wats-url}/api/Software/PackagesByTag?tag={tag}&status={status}
Property | Data Type | Required |
tag | String | Yes |
status | String(Draft, Pending, Released, Revoked) | Yes |
Validation Rules
- tag has to be in a tagName=tagValue format; MyTag=MyValue
- tagName is case sensitive
- tagName has to exist in Tag Manager
/GET PackageFiles
/GET https://{your-wats-url}/api/Software/PackageFiles/{ID}
Property | Data Type |
ID | Guid |
Validation Rules
- ID is the GUID of the package you want to get files from
Note: This will return a reference to the files assigned to the Package. It will not return the file itself.
/GET VirtualFolders
/GET https://{your-wats-url}/api/Software/VirtualFolders
Returns a list of all virtual folders registered in the Production Manager.
/DELETE SoftwarePackage/{ID}
/DELETE https://{your-wats-url}/api/Software/Package/{ID}
Property | Data Type |
ID | Guid |
Deletes the package by using id. Returns a 204 on a successful delete.
/DELETE PackageByName
/DELETE https://{your-wats-url}/api/Software/PackageByName?name={name}&version={version}
Property | Data Type |
name | String |
version | Int |
Validation Rules
- name is the name of the package.
- version is what version of the package you want to delete.
- Status of package has to be either Draft or Revoked to be able to delete.
Deletes the package by using name & version. Returns a 204 on a successful delete.
Comments
0 comments
Please sign in to leave a comment.