Console Events
Events allow users to be notified when certain operations are performed in the Console.
Event properties
All the events triggered by the Console share some common properties:
Property | Value | Description |
---|---|---|
eventName | string | The name of the event, usually in the form of subject_action |
eventTimestamp | number | The timestamp of the event emission |
payload | object | Contains the event-specific payload |
Event types
Below are explained the events that can be triggered by the Console.
Project Created
This event will be triggered when a Project is created successfully.
- Event Payload
- Example
- JSON Schema
- Project JSON Schema
- Example
Property | Value | Description |
---|---|---|
tenantId | string | The identifier of the Company the Project belongs to |
projectId | string | The identifier of the newly created Project |
sourceTemplateId | string | The identifier of the project template used to create the Project |
project | object | The Project metadata (ideally, the whole Project resource, plus some additional information related to the creation process) |
{
"eventName": "project_created",
"eventTimestamp": 123456,
"payload": {
"tenantId": "my-company-id",
"projectId": "0000000000000001",
"sourceTemplateId": "0000000000000002",
// See the Project resource tab
"project": {...}
}
}
{
"additionalProperties": false,
"properties": {
"eventName": {
"const": "project_created",
"type": "string"
},
"eventTimestamp": {
"type": "number"
},
"payload": {
"additionalProperties": false,
"properties": {
"projectId": {
"type": "string",
"description": "The identifier of the Project that was created"
},
"tenantId": {
"type": "string",
"description": "The identifier of the Company the Project belongs to"
},
"sourceTemplateId": {
"type": "string",
"description": "The identifier of the project template used to create the Project"
},
// See the Project resource tab
"project": {...}
},
"type": "object"
}
},
"required": ["eventName", "eventTimestamp", "payload"],
"type": "object"
}
The following schema is potentially non-exhaustive and may not cover all the possible properties of a Project resource.
{
"description": "The Project metadata (ideally, the whole Project resource, plus some additional information related to the creation process)",
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"isRepositoryCreated": {
"type": "boolean",
"description": "Indicates if the repository was created. A false value indicates that the repository creation failed."
},
"areNamespacesCreated": {
"type": "array",
"description": "The outcome of the namespaces creation process",
"items": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"envId": {
"type": "string"
},
"error": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"errorCode": {
"type": "string"
},
"statusCode": {
"type": "string"
}
}
},
"message": {
"type": "string"
},
"labels": {
"type": "object",
"additionalProperties": true
},
"deployServiceAccount": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"base64CA": {
"type": "string"
}
}
}
}
}
},
"availableNamespaces": {
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"value"
]
}
},
"configurationGitPath": {
"type": "string"
},
"defaultBranch": {
"type": "string"
},
"description": {
"type": "string"
},
"environments": {
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"envId": {
"type": "string"
},
"envPrefix": {
"type": "string"
},
"hosts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"isBackoffice": {
"type": "boolean"
},
"scheme": {
"type": "string",
"description": "an url schema, usually one of 'http' or 'https'"
}
}
}
},
"description": {
"type": "string"
},
"isProduction": {
"type": "boolean",
"default": false
},
"cluster": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"clusterId": {
"type": "string"
}
}
},
"deploy": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string"
}
}
}
},
"required": [
"envId"
]
}
},
"name": {
"type": "string"
},
"projectId": {
"type": "string"
},
"repository": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"providerId": {
"type": "string"
}
}
},
"repositoryUrl": {
"type": "string"
},
"tenantId": {
"type": "string"
},
"imagePullSecretNames": {
"type": "array",
"items": {
"type": "string",
},
},
}
}
{
"tenantId": "my-company-id",
"projectId": "project-id",
"name": "project name",
"isRepositoryCreated": true,
"configurationGitPath": "the/configuration/git/path/configurations",
"repositoryUrl": "https://api.git.baseurl/the/configuration/git/path/configurations",
"dockerImageNameSuggestion": {"type": "PROJECT_ID"},
"repository": {"providerId": "git-provider-id"},
"environments": [
{
"label": "Development",
"envId": "DEV",
"envPrefix": "DEV",
"hosts": [{
"host": "your.host.development.eu",
"isBackoffice": false
}],
"isProduction": false,
"cluster": {
"namespace": "project-development",
"clusterId": "mongoObjectId",
},
"deploy": {
"type": "gitlab-ci",
"providerId": "git-provider-id"
}
},
{
"label": "Production",
"envId": "PROD",
"envPrefix": "PROD",
"hosts": [
{
"host": "your.host.prod.eu",
"isBackoffice": false
},
{
"host": "cms.host.prod.eu",
"isBackoffice": true
}
],
"isProduction": true,
"cluster": {
"namespace": "console-e2e-test-production",
"clusterId": "mongoObjectId",
},
"deploy": {
"type": "gitlab-ci",
"providerId": "gitlab-bot-targa"
}
}
],
"pipelines": {"providerId": "pipelines-provider-id", "type": "gitlab-ci"},
"enabledSecurityFeatures": {
"seccompProfile": false,
"appArmor": true,
"hostProperties": true,
"privilegedPod": false
},
"areNamespacesCreated": [
{
"namespace": "project-development",
"envId": "DEV",
"labels": {
"mia-platform.eu/company": "company-id",
"mia-platform.eu/environment": "DEV",
"mia-platform.eu/project": "project name",
"kubernetes.io/metadata.name": "your.host.development.eu",
"app.kubernetes.io/managed-by": "mia-platform"
}
},
{
"namespace": "project-production",
"envId": "PROD",
"error": {
"message": "namespaces \"project-production\" already exists",
"errorCode": "FNC",
"statusCode": "409"
},
"message": "failed namespace creation",
"labels": {
"mia-platform.eu/company": "company-id",
"mia-platform.eu/environment": "PROD",
"mia-platform.eu/project": "project name",
"kubernetes.io/metadata.name": "your.host.prod.eu",
"app.kubernetes.io/managed-by": "mia-platform"
}
}
]
}
Service Created
This event will be triggered when a microservice is successfully generated from a marketplace template or example.
The event is triggered as soon as the service's repository is successfully created, hence there is no guarantee that the service will be found in the Project configuration, yet.
- Event Payload
- Example
- JSON Schema
Property | Value | Description |
---|---|---|
tenantId | string | The identifier of the Company the service belongs to |
projectId | string | The identifier of the Project the service belongs to |
repositoryURL | string | The URL of the repository that hosts the service code |
serviceName | string | The name of the service inside the Project configuration |
templateId | string | The identifier of the template in the Console marketplace from which the service was created |
{
"eventName": "service_created",
"eventTimestamp": 123456,
"payload": {
"tenantId": "my-company-id",
"projectId": "0000000000000001",
"repositoryURL": "http://gihub.com/my-repository",
"serviceName": "my-service",
"templateId": "0000000000000002"
}
}
{
"type": "object",
"required": ["eventName", "eventTimestamp", "payload"],
"additionalProperties": false,
"properties": {
"eventName": {"const": "service_created", "type": "string"},
"eventTimestamp": {"type": "number"},
"payload": {
"type": "object",
"additionalProperties": false,
"properties": {
"tenantId": {"type": "string"},
"projectId": {"type": "string"},
"repositoryURL": {"type": "string"},
"serviceName": {"type": "string"},
"templateId": {"type": "string"}
},
}
},
}
Tag or Version Created
This event will be triggered when a Project is successfully tagged from Console. In an Enhanced Workflow project, this event will be triggered when a version is created.
- Event Payload
- Example
- JSON Schema
- Project JSON Schema
Property | Value | Description |
---|---|---|
tenantId | string | The identifier of the Company the service belongs to |
projectId | string | The identifier of the Project the service belongs to |
tagName | string | The name of the tag created from the Console |
ref | string | The ref of the tag |
message | string | The message of the tag compiled from the Console |
releaseDescription | string | The release description of the tag compiled from the Console |
project | object | The Project metadata (ideally, the whole Project resource) |
{
"eventName": "tag_created",
"eventTimestamp": 123456,
"payload": {
"tenantId": "my-company-id",
"projectId": "0000000000000001",
"tagName": "v1.0.0",
"ref": "af132fr",
"message": "tag message compiled from the Console",
"releaseDescription": "release description compiled from the Console",
"project": {
"_id": "0000000000000001",
"name": "my-project",
"tenantId": "my-company-id",
"projectId": "0000000000000001",
"repository": {
"type": "git",
"providerId": "0000000000000002"
}
}
}
}
{
"type": "object",
"required": ["eventName", "eventTimestamp", "payload"],
"additionalProperties": false,
"properties": {
"eventName": {"const": "tag_created", "type": "string"},
"eventTimestamp": {"type": "number"},
"payload": {
"type": "object",
"additionalProperties": false,
"properties": {
"tenantId": {"type": "string"},
"projectId": {"type": "string"},
"tagName": {"type": "string"},
"ref": {"type": "string"},
"message": {"type": "string"},
"releaseDescription": {"type": "string"},
// See the Project metadata in the dedicated Tab
"project": {...}
}
}
}
}
The following schema is potentially non-exhaustive and may not cover all the possible properties of a Project resource.
:::
{
"description": "The Project metadata (ideally, the whole Project resource)",
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"availableNamespaces": {
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"value"
]
}
},
"configurationGitPath": {
"type": "string"
},
"defaultBranch": {
"type": "string"
},
"description": {
"type": "string"
},
"environments": {
"type": "array",
"default": [],
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"envId": {
"type": "string"
},
"envPrefix": {
"type": "string"
},
"hosts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"isBackoffice": {
"type": "boolean"
},
"scheme": {
"type": "string",
"description": "an url schema, usually one of 'http' or 'https'"
}
}
}
},
"description": {
"type": "string"
},
"isProduction": {
"type": "boolean",
"default": false
},
"cluster": {
"type": "object",
"properties": {
"namespace": {
"type": "string"
},
"clusterId": {
"type": "string"
}
}
},
"deploy": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string"
}
}
}
},
"required": [
"envId"
]
}
},
"name": {
"type": "string"
},
"projectId": {
"type": "string"
},
"repository": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"providerId": {
"type": "string"
}
}
},
"repositoryUrl": {
"type": "string"
},
"tenantId": {
"type": "string"
},
"imagePullSecretNames": {
"type": "array",
"items": {
"type": "string"
}
},
"monitoring": {
"type": "object",
"properties": {
"systems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
},
"required": ["type"]
}
}
},
"required": ["systems"]
},
"containerRegistries": {
"type": "array"
}
}
}
User added
Available from v12.3.0
This event will be triggered when a user gains access to a company, project, or environment, either directly or via a group.
This event does not guarantee that the user in question already had access to the resource via another group, or directly.
- Event Payload
- Example
- JSON Schema
Property | Value | Description |
---|---|---|
userId | string | The user identifier |
email | string | The user email |
roleId | string | The identifier of the role assigned to the user |
groupId | string | The identifier of the group through which the user was added to the Company (if any) |
resource | object | The field identifies the resource affected by the operation. By inheritance, all lower level resources could also be affected |
{
"eventName": "user_added",
"eventTimestamp": 123456,
"payload": {
"userId": "my-user-id",
"email": "my-user-email@mia-platform.eu",
"roleId": "guest",
"groupId": "group1",
"resource": {
"companyId": "my-company-id",
"projectId": "my-project-oid",
"environmentId": "my-env-id",
}
}
}
{
"additionalProperties": false,
"properties": {
"eventName": {
"const": "company_user_added",
"type": "string"
},
"eventTimestamp": {
"type": "number"
},
"payload": {
"additionalProperties": false,
"properties": {
"userId": {
"type": "string",
"description": "The user identifier"
},
"email": {
"type": "string",
"description": "The user email"
},
"roleId": {
"type": "string",
"description": "The identifier of the role assigned to the user"
},
"groupId": {
"type": "string",
"description": "The identifier of the group through which the user was added to the Company (if any)"
},
"resource": {
"type": "object",
"description": "The resource that was affected by the addition. Can be a Company (only companyId is defined), a Project (companyId and projectId are defined) or an Environment (companyId, projectId and environmentId are defined).",
"required": ["companyId"],
"properties": {
"companyId": {
"type": "string",
"description": "The identifier of the Company to which the user was added"
},
"projectId": {
"type": "string",
"description": "The identifier of the Project to which the user was added"
},
"environmentId": {
"type": "string",
"description": "The identifier of the Environment to which the user was added"
},
}
},
},
"required": ["companyId", "userId", "email", "roleId"],
"type": "object"
}
},
"required": ["eventName", "eventTimestamp", "payload", "resource"],
"type": "object"
}
User edited
Available from v12.3.0
This event will be triggered when a user changes access to a company, project, or environment, either directly or via a group.
This event does not guarantee that the user in question already has an higher-privileged access to the resource via another group, or directly.
- Event Payload
- Example
- JSON Schema
Property | Value | Description |
---|---|---|
userId | string | The user identifier |
email | string | The user email |
roleId | string | The identifier of the role assigned to the user |
groupId | string | The identifier of the group through which the user was added to the Company (if any) |
resource | object | The field identifies the resource affected by the operation. By inheritance, all lower level resources could also be affected |
{
"eventName": "company_user_edited",
"eventTimestamp": 123456,
"payload": {
"companyId": "my-company-id",
"userId": "my-user-id",
"email": "my-user-email@mia-platform.eu",
"roleId": "guest",
"groupId": "group1",
"resource": {
"companyId": "my-company-id",
"projectId": "my-project-oid",
"environmentId": "my-env-id",
}
}
}
{
"additionalProperties": false,
"properties": {
"eventName": {
"const": "company_user_edited",
"type": "string"
},
"eventTimestamp": {
"type": "number"
},
"payload": {
"additionalProperties": false,
"properties": {
"userId": {
"type": "string",
"description": "The user identifier"
},
"email": {
"type": "string",
"description": "The user email"
},
"roleId": {
"type": "string",
"description": "The identifier of the role assigned to the user"
},
"groupId": {
"type": "string",
"description": "The identifier of the group through which the user role was modified within the Company (if any)"
},
"resource": {
"type": "object",
"description": "The resource that was affected by the addition. Can be a Company (only companyId is defined), a Project (companyId and projectId are defined) or an Environment (companyId, projectId and environmentId are defined).",
"required": ["companyId"],
"properties": {
"companyId": {
"type": "string",
"description": "The identifier of the Company to which the user was added"
},
"projectId": {
"type": "string",
"description": "The identifier of the Project to which the user was added"
},
"environmentId": {
"type": "string",
"description": "The identifier of the Environment to which the user was added"
},
}
},
},
"required": ["companyId", "userId", "email", "roleId", "resource"],
"type": "object"
}
},
"required": ["eventName", "eventTimestamp", "payload"],
"type": "object"
}
User removed
Available from v12.3.0
This event will be triggered when a user loses access to a company, project, or environment, either directly or via a group.
This event does not guarantee that the user in question already had access to the resource via another group, or directly.
- Event Payload
- Example
- JSON Schema
Property | Value | Description |
---|---|---|
userId | string | The user identifier |
email | string | The user email |
roleId | string | The identifier of the role assigned to the user |
groupId | string | The identifier of the group through which the user was added to the Company (if any) |
resource | object | The field identifies the resource affected by the operation. By inheritance, all lower level resources could also be affected |
{
"eventName": "company_user_removed",
"eventTimestamp": 123456,
"payload": {
"companyId": "my-company-id",
"userId": "my-user-id",
"email": "my-user-email@mia-platform.eu",
"groupId": "group1",
"resource": {
"companyId": "my-company-id",
"projectId": "my-project-oid",
"environmentId": "my-env-id",
}
}
}
{
"additionalProperties": false,
"properties": {
"eventName": {
"const": "company_user_removed",
"type": "string"
},
"eventTimestamp": {
"type": "number"
},
"payload": {
"additionalProperties": false,
"properties": {
"userId": {
"type": "string",
"description": "The user identifier"
},
"email": {
"type": "string",
"description": "The user email"
},
"roleId": {
"type": "string",
"description": "The identifier of the role assigned to the user"
},
"groupId": {
"type": "string",
"description": "The identifier of the group through which the user was removed from the Company (if any)"
},
"resource": {
"type": "object",
"description": "The resource that was affected by the addition. Can be a Company (only companyId is defined), a Project (companyId and projectId are defined) or an Environment (companyId, projectId and environmentId are defined).",
"required": ["companyId"],
"properties": {
"companyId": {
"type": "string",
"description": "The identifier of the Company to which the user was added"
},
"projectId": {
"type": "string",
"description": "The identifier of the Project to which the user was added"
},
"environmentId": {
"type": "string",
"description": "The identifier of the Environment to which the user was added"
},
}
},
},
"required": ["companyId", "userId", "email", "resource"],
"type": "object"
}
},
"required": ["eventName", "eventTimestamp", "payload"],
"type": "object"
}