Contact Us 1-800-596-4880

REST API Reference: Repository of Applications

About This Document

This document, as well as the rest of the documents that make up the Mule Management Console REST API Reference Guide, are a technical reference only. This document does not provide contextual information such as instructions, use cases or scenarios. To understand this document, you should be familiar with MULE ESB, the Application Repository and the REST API.

Index of operations

Assumptions:

host localhost port 8080 Deployed app mmc.war User/Password admin/admin

For a detailed description of the format used in this document, consult Content Organization and Conventions.

/api/repository

POST

UPLOAD

Uploads a new Mule Application into the repository.

Request

MULTIPART_FORM_DATA

{
  "name" : "test-app",
  "file" : "my-zipped-app.zip",
  "version" : "2.0"
}
Key Type Summary Child of

name

String

The name of the application to be uploaded. If not provided, "Unnamed Application" will be used instead

file

String

Actual file to be uploaded. It must be a .zip file

version

Array

(Optional) Application version. If not provided, MMC will set a timestamp with the following format will: yyyyMMdd-HH:mm

Using CURL on Windows

 curl --basic -u admin:admin -F file=@my-zipped-app.zip -F name=test-app -F version=2.0 --header "Content-Type: multipart/form-data" http://localhost:8080/mmc/api/repository

Using CURL on Linux

 curl --basic -u admin:admin -F file=@my-zipped-app.zip -F name=test-app -F version=2.0 --header 'Content-Type: multipart/form-data' http://localhost:8080/mmc/api/repository

Response

JSON

{
  "versionId":"local$a1734daf-c839-4933-a9e6-6dc4f4d86e68",
  "applicationId":"local$c46bf3aa-def7-407c-b701-67ab19e3d29b"
}
Key Type Summary Child of

versionId

String

The ID of the version

applicationId

String

The ID of the application. Several versions can have the same application ID

Common Return Codes

200

The operation was successful

400

Unauthorized user

404

Error registering the application: Item not found

409

Application name and version already exists

500

Specify a valid file to upload/ Error while uploading application

501

The file specified must be a zip file

502

Policy error while uploading application

MMC version

From

3.2.2

GET

LIST ALL

Lists available applications persisted by MMC.

Request

SYNTAX

Using CURL

 curl --basic -u admin:admin http://localhost:8080/mmc/api/repository

Response

JSON

{
  "total":2,
  "data":
    [
      {
        "name":"mule-example-echo",
        "id":"local$0edb159a-5961-4384-bdf8-6ebfc5b9d6bf",
        "href":"http://localhost:8080/mmc/api/repository/local$0edb159a-5961-4384-bdf8-6ebfc5b9d6bf",
        "versions":
          [
            {
              "name":"20120829-12:50",
              "id":"local$b7440183-d549-438e-ac5d-1598c9f78b3d",
              "parentPath":"/Applications/mule-example-echo"
            }
          ]
        },
        {
          "name":"mule-example-hello",
          "id":"local$481abb3b-5b2d-4ee4-8e4c-00e7597480d0",
          "href":"http://localhost:8080/mmc/api/repository/local$481abb3b-5b2d-4ee4-8e4c-00e7597480d0",
          "versions":
            [
              {
                "name":"20120829-15:30",
                "id":"local$66b3cf20-6e76-4fd9-8dc6-a50a804069a0",
                "parentPath":"/Applications/mule-example-hello"
              }
            ]
        }
      ]
}
Key Type Summary Child of

total

Integer

Amount of available applications

data

Array

List of available applications

name

String

Application name

data

id

String

Application ID. Notice that one application can have several versions

data

href

String

Full link to the resource

data

versions

Array

List of available versions of the same application (an application is distinguished by its name)

data

name

String

Version name. By default a timestamp, but can be something else, like "1.0a"

versions

id

String

Application version ID

versions

parentPath

String

Path to the generic application on the repository

versions

Common Return codes

200

The operation was successful

500

Error while retrieving applications info/ Wrong user and password/ Unauthorized user

501

Application was not found

MMC Version

From

3.2.2

/api/repository/{applicationId}

GET

LIST

Lists all application versions with the same specified application ID.

Request

SYNTAX

Key Type Summary Child of

applicationId

String

ID of the application on the repository. Do not confuse with version ID. An application can be composed of one or more versions; each version will have its own ID

Using CURL on Windows

curl --basic -u admin:admin http://localhost:8080/mmc/api/repository/local$43d80f90-b30b-4988-a83b-8172b649b11c

Using CURL on Linux

curl --basic -u admin:admin 'http://localhost:8080/mmc/api/repository/local$43d80f90-b30b-4988-a83b-8172b649b11c'

Response

JSON

{
  "total":2,
  "data":
    [
      {
        "name":"v3",
        "id":"local$fb62caeb-8bd9-4ec7-ad85-cad711b00490",
        "parentPath":"/Applications/mule-example-hello"
      },
      {
        "name":"v4",
        "id":"local$3458da13-5702-4d03-b0d1-4e7eeaea5f2f",
        "parentPath":"/Applications/mule-example-hello"
      }
    ]
}
Key Type Summary Child of

total

Integer

Amount of available versions of the application

data

Array

List of available versions of the application

name

String

Version of the application

data

id

String

ID of the version

data

parentPath

String

Path of the application within the repository

data

Common Return codes

200

The operation was successful

500

Error while retrieving applications info/ Wrong user and password/ Unauthorized user

501

Application was not found

502

Invalid Application ID. Check that the entered ID is not a version ID

MMC version

From

3.2.2

DELETE

REMOVE

Removes an application and all its corresponding versions from the repository.

Request

SYNTAX

Key Type Summary Child of

versionId

String

Id of the application version. Invoke LIST ALL to obtain it.

Using CURL on Windows

 curl --basic -u admin:admin -X DELETE http://localhost:8080/mmc/api/repository/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469

Using CURL on Linux

curl --basic -u admin:admin -X DELETE 'http://localhost:8080/mmc/api/repository/local$a89eb3d0-68b9-44a0-9f6b-712b0895f469'

Response

JSON

200 OK

Common Return codes

200

The operation was successful

500

Error while removing the repository application

501

Application was not found

502

Policy error while removing application

MMC version

From

3.2.2