Space banner

 

This documentation supports the 20.02 version of BMC Digital Workplace Advanced.

To view the latest version, select the version from the Product Version menu.

Implementing the Asset Service Provider Interface

This topic was edited by a BMC Contributor and has not been approved.  More information.

Tip

Click here to download the JSON (JavaScript Object Notation) snippets included in these topics, and customize them to use according to your requirements.

The Asset SPI is a subset of the remote connector SPIs that a connector can implement to support business features of BMC Digital Workplace Catalog beside the initial handshakes (descriptors, health checks) and actions (because each action is, in a way, specific to its connector).

Assets

Capability:

 com.bmc.dsm.catalog:assetProvider

The asset SPI enables BMC Digital Workplace Catalog to expose assets specific to a connection to end-users within their "My Stuff" area.

Asset Actions also known as "Day-2 Actions"

Asset actions exposed by connectors are simple actions that can be performed on the associated assets. This kind of actions have to be simple enough to not require any input from users.

Any more sophisticated action on My Stuff items should be authored through the "Service Action" functionality of BMC Digital Workplace Catalog.

Asset SPI

POST ${connector_path}/com.bmc.dsm.catalog:getAssets

Lists the assets associated with the specified user.

Note that it is acceptable (but not mandatory) to expose assets that are still being provisioned as long as they have a "pending" status type. If the provisioning fails, the asset should eventually disappear from this list. The same goes for deprovisioned assets.

request
{
  "connectionInstanceId": "DEV",
  "request": {
    "user": {
      "emailAddress": "tanya@example.com",
      "fullName": "Tanya Romero",
      "loginName": "tanya",
      "ntDomain": "NTPROD"
    }
  }
}
response
{
  "response": {
    "assets": [
      {
        "id": "U0VSVklDRV9OekUxX1FXeHNaVzQ",
        "name": "CentOS 8 VM",
		// (optional) URI of the logo via the content end-point.
        "logoUri": "/assets/U0VSVklDRV9OekUxX1FXeHNaVzQ/logo",
        "status": {
		  // ID or key of this status.
          "id": "RUNNING",
		  // Displayable name of this status.
          "name": "Running",
		  // Type of the status, used to apply localization if understood.
		  // Possible values:
		  //   available: the asset was successfully provisioned and his supposed to be available
		  //   pending: the asset is still being provisioned. It is supposed to still be unavailable.
		  //   unavailable: the asset is unavailable because of some condition like being "on pause" or in some failure state.
		  //   retired: the asset is advertised as having been deprovisioned.
		  //            The asset is expected to eventually disappear from the list so as not to clutter it.
          "type": "available"
        },
		// (optional) ID of the importable service corresponding to this asset.
        "serviceId": "0FE249DF-FDDF-4FA3-A249-FBD3A0D777DB",
		// (optional) date at which this asset was successfully provisioned.
        "provisioningTime": "2018-11-31T01:05:07.776Z",
		// (optional) list of simple actions that can be performed on this asset through the day-2 action end-point.
        "day2Actions": [
          {
			// ID of this asset action (as understood by this connector).
            "id": "DESTROY",
			// General type of this asset action. Can be used for as a key for localization or for decoration.
			// Possible values:
			//    cancel: cancels the provisioning of a pending asset.
			//    deprovision: deprovisions or retires a provisioned asset.
			//    other: can be used for any other asset action type.
            "type": "deprovision",
			// Readable name of this asset action.
            "name": "Deprovision"
          }
        ]
      }
	  ...
	]
  }
}


POST ${connector_path}/com.bmc.dsm.catalog:getAsset

Returns the details of one specific asset.

request
{
  "connectionInstanceId": "DEV",
  "request": {
    "user": {
      "emailAddress": "tanya@example.com",
      "fullName": "Tanya Romero",
      "loginName": "tanya",
      "ntDomain": "NTPROD"
    },
	"assetId": "U0VSVklDRV9OekUxX1FXeHNaVzQ"
  }
}
response

The structure of the asset objects is the same as for the com.bmc.dsm.catalog:getAssets call above.

{
  "response": {
	"asset": {
      "id": "U0VSVklDRV9OekUxX1FXeHNaVzQ",
      "name": "CentOS 8 VM",
      "logoUri": "/assets/U0VSVklDRV9OekUxX1FXeHNaVzQ/logo",
      "status": {
        "id": "RUNNING",
        "name": "Running",
        "type": "available"
      },
      "serviceId": "0FE249DF-FDDF-4FA3-A249-FBD3A0D777DB",
      "provisioningTime": "2018-11-31T01:05:07.776Z",
      "day2Actions": [
        {
          "id": "DESTROY",
          "type": "deprovision",
          "name": "Deprovision
        }
      ]
    }
  }
}



POST ${connector_path}/com.bmc.dsm.catalog:performDay2Action

Executes the specified asset action.

request
{
  "connectionInstanceId": "DEV",
  "request": {
	// Specifies the asset the action is executed on.
	"assetId": "U0VSVklDRV9OekUxX1FXeHNaVzQ",
	"actionId": "DESTROY"
  }
}
response
{
  "response": {}
}


Was this page helpful? Yes No Submitting... Thank you

Comments