Environments Manager API
Overview
This document describes the way the Environments Manager API interacts and allows the Environments Manager to transfer applications' information between different OCP environments.
Authentication
Navigate to the API Authentication to learn more about Authorization Token Endpoint and Authentication process.
HTTP Code Responses
Omilia's HTTP response codes can be found on the HTTP Codes Responses page.
API Reference
Application Status
Report API version, authentication parameters, and external services status.
GET/envs-manage/api/status
Response Success
{
"version": "1.12.0",
"auth": {
"realm": "master",
"client_id": "ocp",
"url": "https://aws-dev-m.ocp.ai/auth"
},
"server_start_time": "2023-12-08T13:50:22.371715+00:00",
"services_status": {}
}
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
}
Export application
Exports the application.
GET/envs-manager/api/v1/apps/{{app_id}}/export
Query parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The Application ID |
| boolean | no | Select to include NLUs that exist in the target environment in the export. Default is false. |
Response success
"string"
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Promote Application
POST/envs-manager/api/v1/apps/{{app_id}}/promote
URL parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The Application ID |
Response success
{
"data": "string"
}
Bad Request
{
"errors": [
{
"status": 400,
"code": "1022",
"title": "Bad Request",
"detail": "Description too long",
"source": "/body/description",
"meta": {}
}
]
}
Conflict
{
"errors": [
{
"status": 400,
"code": "1022",
"title": "Bad Request",
"detail": "Description too long",
"source": "/body/description",
"meta": {}
}
]
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Import File
Import an application.
Parameter include_nlu
, defines whether NLUs that exist in target environment are included.
POST/envs-manager/api/v1/apps/import
Headers
Content-type : multipart/form-data
Body parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The application file |
| string | no | Select a name for the application name |
| string | yes | Select the group where the application will be imported |
| boolean | no | Select to include NLUs that exist in the target environment in the import. Default is false. |
| boolean | no | The parameter used to import NLUs without creating the models, only apps. (Default is false) |
Response success
{
"data": "string"
}
Bad Request
{
"errors": [
{
"status": 400,
"code": "1022",
"title": "Bad Request",
"detail": "Description too long",
"source": "/body/description",
"meta": {}
}
]
}
Conflict
{
"data": "string"
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Get Apps
Gets all the applications.
GET/envs-manager/api/v1/apps
Response success
[
{
"id": "string",
"created_at": "2023-06-20T12:50:54.362Z",
"updated_at": "2023-06-20T12:50:54.362Z",
"user_id": "string",
"name": "string",
"group": "string",
"component_id": "string",
"sandbox_flowapp_id": "string",
"production_flowapp_id": "string"
}
]
Bad Request
{
"errors": [
{
"status": 400,
"code": "1022",
"title": "Bad Request",
"detail": "Description too long",
"source": "/body/description",
"meta": {}
}
]
}
Get Token
Acquire an access token by providing username and password.
POST/envs-manager/api/v1/auth/token
Body parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The name of the user |
| string | yes | Provide a password |
Response success
{
"access_token": "string"
}
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Introspect Token
Get the endpoint to introspect tokens.
GET/envs-manager/api/v1/auth/token/introspect
Response success
{
"data": {
"sub": "string",
"email": "string",
"preferred_username": "string",
"resource_access": {
"ocp": {
"roles": [
"string"
]
}
},
"ocp_groups": [],
"given_name": "string",
"family_name": "string"
}
}
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Tags
Gets tags.
GET/envs-manager/api/v1/apps/{{app_id}}/tags
URL parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The Application ID |
Response success
{
"total": 0,
"data": [
"string"
]
}
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Export Tag
GET/envs-manager/api/v1/apps/{{app_id}}/tags/{{tag}}/export
Body parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The Application ID |
| string | yes | Select a tag |
| boolean | no | Select to include NLUs that exist in the target environment in the import. Default is true. |
Response success
"string"
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Delete App Tag
Deletes Application Tag.
DELETE/envs-manager/api/v1/apps/{{app_id}}/tags/{{tag}}
Body parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | Select a tag |
| string | yes | The Application ID |
Response success
"string"
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Promote Tag
Promotes tag.
POST/envs-manager/api/v1/apps/{{app_id}}/tags/{{tag}}/promote
Body parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | Select a tag |
| string | yes | The Application ID |
Response success
{
"data": "string"
}
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
Conflict
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}
Import Tag
Imports the resources provided in the zip file but only in the runtime.
POST/envs-manager/api/v1/apps/{{app_id}}/tags/import
URL Parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The Application ID |
Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
| string | yes | The application file |
| string | no | The type of deployment |
Response success
{
"data": "string"
}
Bad Request
{
"errors": [
{
"code": "1022",
"detail": "Description too long",
"meta": {},
"source": "/body/description",
"status": 400,
"title": "Bad Request"
}
]
}
Conflict
{
"data": {
"id": None,
"name": None,
"group": "ocp-qa",
"has_errors": True,
"created": False,
"message": "Errors occurred during app import.",
},
"errors": [
{
"title": "orc_export_test",
"detail": "Oops",
},
{
"title": "orc_export_test_flow",
"detail": "Oops",
},
],
},
Validation Error
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}