Reporting integration status

To report the integration activation status, the API client must use the /api/integration_management/v2/status endpoint.

Query string parameters

The endpoint accepts the tenantID query string parameter. This parameter specifies the tenant UUID for which the integration status is reported. Usually, it’s a partner tenant where the integration is configured.

If not specified, the tenant UUID where the API client is registered will be used.

Request body structure

Note

This table describes the fields using the following JSON Path syntax:

  • . - a path to the object’s field.

  • [*] - an array that specifies all elements.

For example, the events[*].category notation means that events is an array where all items are objects containing the category field.

Field

Type

Required

Description

application_code

String, up to 1000 characters

Yes (if application_id is not specified)

CyberApp code in the vendor.application format. Mutually exclusive with application_id.

application_id

UUID string

Yes (if application_code is not specified)

ID of the integration. Mutually exclusive with application_code.

module

Object

Yes

Information about integration.

module.name

String, 1 to 255 characters

Yes

Integration name.

module.version

String, up to 255 characters

No

Integration version.

vendor_system

Object

No

Information about the product integrated with Acronis.

vendor_system.name

String, 1 to 255 characters

Yes

Integrated product name.

vendor_system.version

String, up to 255 characters

No

Integrated product version.

events

Array of objects

No

List of events. Event represents an action that integration performed on a tenant.

events[*].category

String, 1 to 150 characters

Yes

Event category is an arbitrary string identifying a group of events, for example, “activation”.

events[*].action

String, 1 to 500 characters

Yes

Event action is an arbitrary string identifying an event, for example, “activated integration”.

events[*].activation_event

Boolean, default false

No

Set to true if the event indicates that integration has been activated on a tenant. This flag will set activated_at to the time when the request was received if integration was inactive before.

events[*].deactivation_event

Boolean, default false

No

Set to true if the event indicates that integration has been deactivated on a tenant. This flag will set deactivated_at to the time when the request was received if integration was active before.

activated_at

Date and time in RFC 3339 format

No

A timestamp of when integration has been activated on a tenant.

deactivated_at

Date and time in RFC 3339 format

No

A timestamp of when integration has been deactivated on a tenant.

Request body example:

{
    "application_code": "<vendor.application>",
    "module": {
        "name": "Integration backend",
        "version": "1.0.0"
    },
    "vendor_system": {
        "name": "Product integrated with Acronis",
        "version": "22.04.1"
    },
    "events": [
        {
            "category": "activation",
            "action": "activated integration",
            "activation_event": true
        }
    ]
}

Before you start

  1. Authenticate to the cloud platform via the Python shell.

    The following variables should be available now:

    >>> base_url  # the base URL of the API
    'https://eu2-cloud.acronis.com/api/integration_management/v2'
    >>> auth  # the 'Authorization' header value with the access token
    {'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImMwMD...'}
    >>> tenant_id  # the UUID of the tenant to which the token provides access
    'ede9f834-70b3-476c-83d9-736f9f8c7dae'
    
  2. Define the following common variables that describe the integration and will be used in status reporting requests:

    >>> # Replace '<vendor.application>' with your application code
    >>> application_code = '<vendor.application>'
    >>> module = {'name': 'Integration backend', 'version': '1.0.0'}
    >>> vendor_system = {'name': 'Product integrated with Acronis', 'version': '22.04.1'}
    

To activate the integration

  1. Define a variable named status, and then assign a dictionary with information about the integration status to this variable:

    >>> status = {
    ...     'application_code': application_code,
    ...     'module': module,
    ...     'vendor_system': vendor_system,
    ...     'events': [{'category': 'activation', 'action': 'activated integration', 'activation_event': True}],
    ... }
    
  2. [Optional] Define the target_tenant_id variable and specify the tenant UUID where you want to report the integration activation:

    >>> target_tenant_id = tenant_id
    
  3. Convert the status object to a JSON text:

    >>> status = json.dumps(status, indent=4)
    
  4. Send a POST request with the JSON text to the /status?tenantID={target_tenant_id} endpoint:

    >>> response = requests.post(
    ...     f'{base_url}/status?tenantID={target_tenant_id}',
    ...     headers={'Content-Type': 'application/json', **auth},
    ...     data=status,
    ... )
    
  5. Check the status code of the response:

    >>> response.status_code
    204
    

    Status code 204 means that the integration has been activated.

To deactivate the integration

  1. Define a variable named status, and then assign a dictionary with information about the integration status to this variable:

    >>> status = {
    ...     'application_code': application_code,
    ...     'module': module,
    ...     'vendor_system': vendor_system,
    ...     'events': [{'category': 'activation', 'action': 'deactivated integration', 'deactivation_event': True}]
    ... }
    
  2. [Optional] Define the target_tenant_id variable and specify the tenant UUID where you want to report the integration deactivation:

    >>> target_tenant_id = tenant_id
    
  3. Convert the status object to a JSON text:

    >>> status = json.dumps(status, indent=4)
    
  4. Send a POST request with the JSON text to the /status?tenantID={target_tenant_id} endpoint:

    >>> response = requests.post(
    ...     f'{base_url}/status?tenantID={target_tenant_id}',
    ...     headers={'Content-Type': 'application/json', **auth},
    ...     data=status,
    ... )
    
  5. Check the status code of the response:

    >>> response.status_code
    204
    

    Status code 204 means that the integration has been deactivated.