Import Project From Manifest (Via API)
Create your authorization token
To use this guide, you'll need your access-token
.
For help generating a token, refer to this guide.
Upload Manifest File
For a full list of system compatible manifest files please refer to this guide.
Upload the manifest file to the system. The parameters for this case are:
Parameter | Type | Explanation | Required |
---|---|---|---|
instance-id | string | This parameter will be given by illustria team. | Yes |
auth-token | string | Use the parameter from previous step. | Yes |
path-to-manifest-file | string | The location of your manifest file. | Yes |
Example Code
curl --request POST \
--url https://<instance-id>.illustria.io/artifacts/upload \
--header 'Authorization: Bearer <auth-token>' \
--header 'Content-Type: multipart/form-data' \
--form files=@<path-to-manifest-file>
The response of this request is the artifact-id
.
Make sure you keep it as this is the identifier of your file in the system.
Import Your Project
Upload the manifest file to the system. The parameters for this case are:
Parameter | Type | Explanation | Required | Default value |
---|---|---|---|---|
instance-id | string | This parameter will be given by illustria team. | Yes | - |
auth-token | string | Use the parameter from previous step. | Yes | - |
project-name | string | Unique identifier or title for your project. | No | project-id - Sets the project name as its id. |
project-description | string | Detailed summary of the project's objectives and scope. | No | empty-string |
package-manager | string | Which package manger is used to install/uninstall software packages. | Yes | - |
artifact-id | string | Id generated from uploading a manifest. | Yes | - |
project-version | string | Specific release or iteration of the project. | No | CUSTOM |
Once you have the artifact-id
you can import your project:
- Use The GraphQL query:
curl --request POST \
--url https://<instance-id>.illustria.io/graphql \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <auth-token>' \
--data '
{
"query": "mutation ImportProject($applicationName: String!, $description: String!, $artifactType: String!, $mainArtifactId: String!, $projectVersion: String) { importProjectFromManifest(applicationName: $applicationName, description: $description, packageManager: $artifactType, mainArtifactId: $mainArtifactId, projectVersion: $projectVersion) { __typename ... on GQLTask { id_ }}}",
"variables": {
"applicationName": "<project-name>",
"description": "<project-description>",
"artifactType": "<package-manager>",
"mainArtifactId": "<artifact-id>",
"projectVersion": "<project-version>"
}
}
'
The response of this request is the task-id
which allows you to follow the import process.
Check import status and fetch project data
Parameter | Type | Explanation | Required | Default value |
---|---|---|---|---|
instance-id | string | This parameter will be given by illustria team. | Yes | - |
auth-token | string | Use the parameter from previous step. | Yes | - |
task-id | string | Unique identifier for a specific task. | No | empty-array - Shows all running tasks. |
You can follow the status of your project's import process using the following API:
curl --request POST \
--url https://<instance-id>.illustria.io/graphql \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <auth-token>' \
--data '{
"query": "query Search($filters: GQLFilterParams) { search(searchType: TASK, filters: $filters) { __typename ... on GQLSearchResults { totalRecordsCount filteredRecordsCount records { __typename ... on GQLTask { status } } } } }",
"variables": {
"filters": {
"recordIds": ["<task-id>"]
}
}
}'
Once completed, you can get your projects data using the following API:
curl --request POST \
--url https://<instance-id>.illustria.io/graphql \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <auth-token>' \
--data '
{
"query": "query Search($filters: GQLFilterParams) { search(searchType: APPLICATION, filters: $filters) { __typename ... on GQLSearchResults { totalRecordsCount missingRecordsCount filteredRecordsCount records { __typename ... on GQLApplication { id_ packagesCount versionName versionType applicationIndex { __typename ... on GQLApplicationIndex { id_ displayName } } } } } } }",
"variables": {
"filters": {
}
}
}
'