# PackageService

Manages Deployment Packages.

POST | /package/fetch | Fetches an application package from a URL outside of the Deployit Server.
GET | /package/import | Lists all application packages that are present in the `importablePackages` directory on the Deployit Server.
POST | /package/import/{file:.*?} | Imports an application package that is present in the `importablePackages` directory on the Deployit Server.
POST | /package/upload/{file:.*?} | Uploads an application package to the Deployit Server.

## POST /package/fetch

Fetches an application package from a URL outside of the Deployit Server.

Permissions
  `import#initial` - for importing the first version of a package
  `import#upgrade` - if another version of the package already exists

Parameters

  Request body | application/xml | String | The URL to import from

Response body
  ConfigurationItem - The udm.Version CI that is created after importing.
  Content type: application/xml

## GET /package/import

Lists all application packages that are present in the `importablePackages` directory on the Deployit Server.

Response body
  List of String - List of names of packages that can be imported.
  Content type: application/xml

## POST /package/import/{file:.*?}

Imports an application package that is present in the `importablePackages` directory on the Deployit Server.

Permissions
  `import#initial` - for importing the first version of a package
  `import#upgrade` - if another version of the package already exists

Parameters

  Path | file | String | The name of the package to import

Response body
  ConfigurationItem - The udm.Version CI that is created after importing.
  Content type: application/xml

## POST /package/upload/{file:.*?}

Uploads an application package to the Deployit Server.

Permissions
  `import#initial` - for importing the first version of a package
  `import#upgrade` - if another version of the package already exists

Parameters

  Path | file | String | The name of the package to be imported
  Multipart |  | FileUpload | The upload form.

Response body
  ConfigurationItem - The udm.Version CI that is created after importing.
  Content type: application/xml