How Can We Help?

You can create, update, and remove component instances in HEAL using the ‘instances’ API.

Creating Component Instances

You can create component instances in HEAL using the ‘instances’ API.
API Name – instances
Format – POST /api/accounts/<account_identifier>/instances
JSON Format

[ { “name”:”<instance name>”, “identifier”:”<instance identifier>”, “componentName”:”<component name>”, “componentVersion”:”<component version>”, “parentIdentifier”:”<parent identifier>”, “parentName”:”<parent name>”, “serviceIdentifiers”:”<list of service identifiers>”, “agentIdentifiers”:”<list of agent identifiers>”, “discovery”:”<dynamic discovery of an instance>”, “attributes”:”<list of attributes>” } ]

Input Parameters

TypeNameDescriptionSchemaMandatory/Optional
bodynameName of the Component InstancestringMandatory
bodyIdentifierIdentifier of the Component InstancestringOptional
bodycomponentNameName of the componentstringMandatory
bodycomponentVersionVersion of the componentstringMandatory
bodyparentIdentifierIdentifier of the parent component instancestringMandatory
bodyparentNameName of the parent component instance. Provide either parentIdentifier or parentName.stringMandatory
bodyserviceIdentifiersList of the service identifiers. This list specifies the services the component belongs to. This is applicable only for “Host” type component. For other components, this field can be null.stringMandatory
bodyagentIdentifiersList of Identifiers of Agents to which the instance must be mapped.stringOptional
bodydiscoveryIt can be either 0 or 1.
This defines if an instance is manually created or discovered.
stringOptional
bodyattributesList of attributes that need to be associated with the component instance. “HostAddress” attribute is mandatory in the “attributes” field.stringMandatory

You can add multiple blocks in the input json each representing a single component instance i.e. you can create multiple component instances at a time.
Sample Input JSON

[ { “name”: “Payment service”, “identifier”: “0e3912a9-316f-11ea-b371-42010aa001”, “componentName”: “Java Service”, “componentVersion”: 8.1, “parentIdentifier”: null, “parentName”: “CentOS_Host1”, “serviceIdentifiers”: null, “agentIdentifiers”: [ “7fb4c12c-6d84-475f-9aee-593496d00ca8” ], “discovery”: 1, “attributes”: [ { “name”: “HostAddress”, “value”: “192.168.0.35” } ] } ]

Output JSON for Success

{ “message”: “Operation successfully completed”, “responseStatus”: “SUCCESS”, “data”: [ { “id”: 0, “name”: “string”, “identifier”: “string” } ] }

Output JSON for Failure

{ “message”: “Failure message”, “responseStatus”: “FAILURE” }

Updating a Component Instance

You can update data for a component instance in HEAL using ‘instances’ API. You can update data for only one instance at a time. You can simultaneously update multiple attributes of an instance. In order to update data for multiple instances, execute ‘instances’ API separately for each of the component instances.
API Name – instances
Format – PUT /api/accounts/<account_identifier>/instances/{instanceIdentifier}
Input Parameters

TypeNameDescriptionSchemaMandatory/Optional
PathinstanceIdentifierIdentifier of the servicestringMandatory
BodyserviceIdentifiersList of the service identifiers. This list specifies the services the component belongs to. This is applicable only for “Host” type component. For other components, this field can be null.stringMandatory
attributes: List of attributes of the component instance that needs to be updated. At least one attribute needs to be present.
BodynameName of the attributestringMandatory
BodyvalueValue of the attributestringMandatory

Input data JSON

{ “serviceIdentifiers”:”<List of service identifiers>”, “attributes”:”<List of attributes>” }

Sample Input JSON

{ “serviceIdentifiers”: [ “0e3912a9-316f-11ea-b371-42010aa003111” ], “attributes”: [ { “name”: “HostAddress”, “value”: “192.168.0.35” } ] }

Input

http://<keycloak_host>:<keycloak_port>/appsone-controlcenter/v2.0/api/accounts/TopologyAPI/instances/0e3912a9-316f-11ea-b371-42010aa001

Output JSON for Success

{ “message”: “Operation successfully completed.”, “responseStatus”: “SUCCESS”, “data”: null }

Output JSON for Failure

{ “message”: “Failure message”, “responseStatus”: “FAILURE” }

Removing a Component Instance

You can remove a component instance in HEAL using ‘instances’ API.
API Name – instances
Format – DELETE /api/accounts/<account_identifier>/instances/{instanceIdentifier}
Input Parameters

TypeNameDescriptionSchemaMandatory/Optional
PathinstanceIdentifierIdentifier of the component instancestringMandatory

Sample Input

http://<keycloak_host>:<keycloak_port>/appsone-controlcenter/v2.0/api/accounts/TopologyAPI/instances/0e3912a9-316f-11ea-b371-42010aa001

Output JSON for Success

{ “message”: “Operation successfully completed.”, “responseStatus”: “SUCCESS”, “data”: null }

Output JSON for Failure

{ “message”: “Failure message”, “responseStatus”: “FAILURE” }

Table of Contents