What's on this page

Managing Assemblies

This section covers the API calls the manage assembly instances during their life. It is based around the state model for Stratoss™ Lifecycle Manager (LM).

Associated with each example is a table explaining the fields in the example. This includes the name of the field, a brief description and whether the field is mandatory. Whether a field is required or not is based on the context of the examples. The underlying API definition may mark a field as optional, but in some contexts, the fields must be supplied.

In the examples below field names shown in italics are example names and not the real one to be used in messages.

Standard Response Header

Each of the API calls returns a response header in the following format when the call is successful.

Example response Header:

{
  "location": "http://192.168.99.100:8280/api/processes/9d63c16e-6685-4e7b-9123-81c196f99536",
  "date": "Fri, 08 Sep 2017 09:12:38 GMT",
  "server": "LM Ishtar/1.1.0-SNAPSHOT",
  "transfer-encoding": "chunked",
  "x-application-context": "ishtar:prod",
  "content-type": null
}

The ‘location’ item in the response header is a URL that will allow the caller to find out the state of the process that has been requested. See the following section.

Process Controller

This call allows the requestor of an intent to check the status of the associated process.

Request Format

Aspect Value
Endpoint URL /api/processes/{id}
HTTP Method GET

The URL in the response header Location field is the URL that the requester must use to find the state of the process.

Example URL for Process Controller call:

http://192.168.99.100:8280/api/processes/9d63c16e-6685-4e7b-9123-81c196f99536

Create Assembly

Creates a new instance of an assembly based on the given descriptor and the properties.

Request Format

Aspect Value
Endpoint URL /api/intent/createAssembly
HTTP Method POST

Example Request:

{
  "assemblyName": "WED_102",
  "descriptorName": "assembly::t_single::1.0",
  "intendedState": "Active",
  "properties": {
      "data": "exampleValue",
      "deploymentLocation": "admin@local"
  }
}

Request parameters:

Field Description Mandatory
assemblyName The name of the assembly instance. Must be unique, must not start with a number, contain a space and must not contain double underscore character combination. Yes
descriptorName The name of the assembly descriptor as defined at the head of the descriptor file Yes
intendedState The state the assembly instance will be transitioned to once the assembly has been created. Allowed values “Installed”, “Inactive”, “Active” Yes
Properties A set of tuples that match to the required properties for the assembly instance. The list of actual properties is dependent upon the assembly descriptor Yes – depending upon descriptor requirements

Response Format:

Aspect Value
Response Code 201 - CREATED

Change Assembly State

This requests LM to transition an assembly instance from one state to another.

Request Format

Aspect Value
Endpoint URL /api/intent/changeAssemblyState
HTTP Method POST

Example Request

Changing state of assembly instance using name:

{
  "assemblyName": "WED_102",
  "intendedState": "Inactive"
}

Changing state of assembly instance using id:

{
  "assemblyId": "1c3bd18a-05e9-4f49-b510-0e4785b2f0ae",
  "intendedState": "Inactive"
}

Request parameters:

Field Description Mandatory
assemblyName The name of the assembly instance. Must be unique, must not start with a number, contain a space and must not contain double underscore character combination. Yes (if assemblyId not supplied)
assemblyId The id of the assembly instance. This can be retrieved using the GetAssembly calls Yes (if assemblyName not supplied)
intendedState The state the assembly instance will be transitioned to once the assembly has been created. Allowed values “Installed”, “Inactive”, “Active” Yes

Response Format

Aspect Value
Response Code 201 - CREATED

Delete Assembly

This requests LM to delete an assembly instance.

Request Format

Aspect Value
Endpoint URL /api/intent/deleteAssembly
HTTP Method POST

Example Request

Delete assembly instance using name:

{
  "assemblyName": "WED_102"
}

Delete assembly instance using id:

{
  "assemblyId": "1c3bd18a-05e9-4f49-b510-0e4785b2f0ae"
}

Request parameters:

Field Description Mandatory
assemblyName The name of the assembly instance. Must be unique, must not start with a number, contain a space and must not contain double underscore character combination. Yes (if assemblyId not supplied)
assemblyId The id of the assembly instance. This can be retrieved using the GetAssembly calls Yes (if assemblyName not supplied)

3.1.5.3 Response Format

Aspect Value
Response Code 201 - CREATED

Heal Components

This allows an assembly instances to be healed in the event that their resource have broken.

Request Format

Aspect Value
Endpoint URL /api/intent/healAssembly
HTTP Method POST

Example Request

Heal assembly component using names:

{
  "assemblyName": "WED_102",
  "brokenComponentName": "WED_102__t_single"
}

Heal assembly instance using ids:

{
  "assemblyId": "5fd27c1e-403c-402b-a033-fef0940974d5",
  "brokenComponentId": "15a07604-377d-4fa2-955f-2a379560c24d"
}

Heal assembly instance using a mixture:

{
  "assemblyName": "WED_102",
  "brokenComponentId": "15a07604-377d-4fa2-955f-2a379560c24d"
}

Request parameters:

Field Description Mandatory
assemblyName The name of the assembly instance. Must be unique, must not start with a number, contain a space and must not contain double underscore character combination. Yes (if assemblyId not supplied)
assemblyId The id of the assembly instance. This can be retrieved using the GetAssembly calls Yes (if assemblyName not supplied)
brokenComponentId This is the id of the component within the assembly instance. This can be found by using the GetAssembly calls. Yes (if brokenComponentName or brokenComponentMetricKey is not used)
brokenComponentName The name of the component within the assembly instance. It can be found using the GetAssembly calls. Yes (if brokenComponentId or brokenComponentMetricKey is not used)
brokenComponentMetricKey This is the id of the component within the assembly instance (currently using same id as brokenComponentId). This can be found by using the GetAssembly calls. Yes (if brokenComponentId or brokenComponentName is not used)

Response Format

Aspect Value
Response Code 201 - CREATED

Scale Components

This allows scalable components of an assembly to be scaled in or out.

Request Format

Aspect Value
Endpoint URL /api/intent/scaleInAssembly
HTTP Method POST
Aspect Value
Endpoint URL /api/intent/scaleOutAssembly
HTTP Method POST

Example Request

Scale a cluster by name (depends on the endpoint as to whether it is “In” or “Out”:

{
  "assemblyName": "WED_102",
  "clusterName": "storage_cluster"
}

Scale a cluster by id (depends on the endpoint as to whether it is “In” or “Out”.

{
  "assemblyId": "5fd27c1e-403c-402b-a033-fef0940974d5",
  "clusterName": "storage_cluster"
}

Request parameters

Field Description Mandatory
assemblyName The name of the assembly instance. Must be unique, must not start with a number, contain a space and must not contain double underscore character combination. Yes (if assemblyId not supplied)
assemblyId The id of the assembly instance. This can be retrieved using the GetAssembly calls Yes (if assemblyName not supplied)
clusterName The name of the cluster to be scaled. This is the name defined in the assembly descriptor for the cluster Yes

Response Format

Aspect Value
Response Code 201 - CREATED

Upgrade Assembly

Upgrade an assembly. This means changing the descriptor that is associated with an assembly instance. This may cause the state of the assembly components to change while the upgrade is achieved.

Request Format

Aspect Value
Endpoint URL /api/intent/upgradeAssembly
HTTP Method POST

Example Request

Upgrade assembly by name:

{
  "assemblyName": "WED_102",
  "descriptorName": "assembly::t_single::2.0",
  "properties": {
      "data": "exampleValue",
      "deploymentLocation": "demo@local"
  }
}

Upgrade assembly by Id:

{
  "assemblyId": "5fd27c1e-403c-402b-a033-fef0940974d5",
  "descriptorName": "assembly::t_single::2.0",
  "properties": {
      "data": "exampleValue",
      "deploymentLocation": "demo@local"
  }
}

Request parameters

Field Description Mandatory
assemblyName The name of the assembly instance. Must be unique, must not start with a number, contain a space and must not contain double underscore character combination. Yes (if assemblyId not supplied)
assemblyId The id of the assembly instance. This can be retrieved using the GetAssembly calls Yes (if assemblyName not supplied)
descriptorName The name of the assembly descriptor as defined at the head of the descriptor file Yes
Properties A set of tuples that match to the required properties for the assembly instance. The list of actual properties is dependent upon the assembly descriptor Yes – depending upon descriptor requirements

Response Format

Aspect Value
Response Code 201 - CREATED