PluginManagerResource

PluginManager facade resource

GraphViz

Schema

The considered APS type (download) extends the Resource APS type(s) and looks as follows:

{
  "name": "PluginManagerResource",
  "id": "http://a8n.bss/exchangerates/plugin-manager/1.0",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "global": true
  },
  "operations": {
    "getPluginsList": {
      "path": "/applications",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "StorePluginDTO"
        }
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "getPluginInfo": {
      "path": "/applications/{pluginName}",
      "verb": "GET",
      "response": {
        "type": "StorePluginInformationDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "pluginName": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "installPlugin": {
      "path": "/applications/{pluginName}/install",
      "verb": "POST",
      "response": {
        "type": "object"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "pluginName": {
          "kind": "path",
          "type": "string"
        },
        "configuration": {
          "kind": "body",
          "type": "string"
        }
      }
    },
    "getPluginConfig": {
      "path": "/applications/{pluginName}/configuration",
      "verb": "GET",
      "response": {
        "type": "PluginConfigDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "pluginName": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "setPluginConfig": {
      "path": "/applications/{pluginName}/configure",
      "verb": "POST",
      "response": {
        "type": "PluginResponseDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "pluginName": {
          "kind": "path",
          "type": "string"
        },
        "configuration": {
          "kind": "body",
          "type": "string",
          "required": true
        }
      }
    },
    "testPluginConnection": {
      "path": "/applications/{pluginName}/test-connection",
      "verb": "POST",
      "response": {
        "type": "PluginResponseDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "pluginName": {
          "kind": "path",
          "type": "string"
        },
        "configuration": {
          "kind": "body",
          "type": "string",
          "required": true
        }
      }
    },
    "disablePlugin": {
      "path": "/applications/{pluginName}/disable",
      "verb": "POST",
      "response": {
        "type": "PluginResponseDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "pluginName": {
          "kind": "path",
          "type": "string"
        }
      }
    },
    "enablePlugin": {
      "path": "/applications/{pluginName}/enable",
      "verb": "POST",
      "response": {
        "type": "PluginResponseDTO"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "pluginName": {
          "kind": "path",
          "type": "string"
        }
      }
    }
  },
  "structures": {
    "StoreApplicationStatus": {
      "type": "object"
    },
    "StoreApplicationVersionDisplayMode": {
      "type": "object"
    },
    "StorePluginDTO": {
      "type": "object",
      "properties": {
        "storeAppId": {
          "type": "string",
          "description": "Plugin identifier (unique in subsystem)",
          "required": true
        },
        "status": {
          "type": "string",
          "description": "Plugin status",
          "required": true
        },
        "version": {
          "type": "string",
          "description": "Installed version. Should be returned if plugin is installed"
        },
        "versionDisplayMode": {
          "type": "string",
          "description": "Allows to specify if versions are not supported (and should not be displayed)"
        }
      }
    },
    "StorePluginInformationDTO": {
      "type": "object",
      "properties": {
        "storeAppId": {
          "type": "string",
          "description": "App store identifier (unique in subsystem)",
          "required": true
        },
        "appId": {
          "type": "string",
          "description": "Plugin identifier",
          "required": true
        },
        "applicationViewId": {
          "type": "string",
          "description": "Plugin view identifier",
          "required": true
        },
        "applicationViewType": {
          "type": "string",
          "description": "Type of view that is opened during navigation to applicationViewId"
        },
        "installComponentName": {
          "type": "string",
          "description": "Component name for installation shared component"
        },
        "status": {
          "type": "string",
          "description": "Plugin status",
          "required": true
        },
        "version": {
          "type": "string",
          "description": "Installed version. Should be returned if plugin is installed "
        },
        "versionDisplayMode": {
          "type": "string",
          "description": "Allows to specify if versions are not supported and should not be displayed"
        },
        "installationMethod": {
          "type": "string",
          "description": "Plugin uninstallation method",
          "required": true
        },
        "uninstallationMethod": {
          "type": "string",
          "description": "Plugin uninstallation method",
          "required": true
        }
      }
    },
    "CurrencyPairDTO": {
      "type": "object",
      "properties": {
        "base": {
          "type": "CurrencyDTO"
        },
        "quote": {
          "type": "CurrencyDTO"
        }
      }
    },
    "CurrencyDTO": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "required": true
        },
        "name": {
          "type": "string",
          "readonly": true
        }
      }
    },
    "PluginSyncDTO": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "default": "WARNING",
          "enum": [
            "IN_PROGRESS",
            "SUCCESS",
            "ERROR",
            "WARNING"
          ]
        },
        "syncTime": {
          "type": "string",
          "readonly": true,
          "format": "date-time"
        }
      }
    },
    "PluginConfigDTO": {
      "type": "object",
      "properties": {
        "configSchema": {
          "type": "object"
        },
        "config": {
          "type": "object"
        },
        "state": {
          "type": "string",
          "enum": [
            "ENABLED",
            "DISABLED",
            "DELETED"
          ]
        },
        "supportedCurrencyPairs": {
          "type": "array",
          "items": {
            "type": "CurrencyPairDTO"
          }
        },
        "lastPluginSync": {
          "type": "PluginSyncDTO"
        }
      }
    },
    "PluginResponseStatus": {
      "type": "object"
    },
    "PluginResponseDTO": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Response status",
          "required": true
        },
        "message": {
          "type": "string",
          "description": "Response message"
        }
      }
    }
  }
}

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

getPluginsList

GET

/applications

StorePluginDTO

Get the list of the installed exchange rate plugins.

getPluginInfo

GET

/applications/{pluginName}

StorePluginInformationDTO

Get information about an exchange rate plugin.

installPlugin

POST

/applications/{pluginName}/install

PluginResponseDTO

Install an exchange rate plugin.

getPluginConfig

GET

/applications/{pluginName}/configuration

PluginConfigDTO

Get exchange rate plugin configuration.

setPluginConfig

POST

/applications/{pluginName}/configure

PluginResponseDTO

Save exchange rate plugin configuration if it is valid.

testPluginConnection

POST

/applications/{pluginName}/test-connection

PluginResponseDTO

Test connection of an exchange rate plugin.

disablePlugin

POST

/applications/{pluginName}/disable

PluginResponseDTO

Disable an exchange rate plugin. This stops update of the rates that were obtained from this plugin.

enablePlugin

POST

/applications/{pluginName}/enable

PluginResponseDTO

Enable an exchange rate plugin.

getPluginsList

HTTP Request

GET /aps/2/resources/{aps-id}/applications

Description

Get the list of the installed exchange rate plugins.

Returns

StorePluginDTO

getPluginInfo

HTTP Request

GET /aps/2/resources/{aps-id}/applications/{pluginName}

Description

Get information about an exchange rate plugin.

Parameters

PARAMETER

TYPE

DESCRIPTION

pluginName

String

Plugin name

Returns

StorePluginInformationDTO

installPlugin

HTTP Request

POST /aps/2/resources/{aps-id}/applications/{pluginName}/install

Description

Install an exchange rate plugin.

Parameters

PARAMETER

TYPE

DESCRIPTION

pluginName

String

Plugin name

configuration

String

Configuration.

Returns

PluginResponseDTO

getPluginConfig

HTTP Request

GET /aps/2/resources/{aps-id}/applications/{pluginName}/configuration

Description

Get exchange rate plugin configuration.

Parameters

PARAMETER

TYPE

DESCRIPTION

pluginName

String

Plugin name

Returns

PluginConfigDTO

setPluginConfig

HTTP Request

POST /aps/2/resources/{aps-id}/applications/{pluginName}/configure

Description

Save exchange rate plugin configuration if it is valid.

Parameters

PARAMETER

TYPE

DESCRIPTION

pluginName

String

Plugin name

configuration

String

Configuration.

Returns

PluginResponseDTO

testPluginConnection

HTTP Request

POST /aps/2/resources/{aps-id}/applications/{pluginName}/test-connection

Description

Test connection of an exchange rate plugin.

Parameters

PARAMETER

TYPE

DESCRIPTION

pluginName

String

Plugin name

configuration

String

Configuration.

Returns

PluginResponseDTO

disablePlugin

HTTP Request

POST /aps/2/resources/{aps-id}/applications/{pluginName}/disable

Description

Disable an exchange rate plugin. This stops update of the rates that were obtained from this plugin.

Parameters

PARAMETER

TYPE

DESCRIPTION

pluginName

String

Plugin name

Returns

PluginResponseDTO

enablePlugin

HTTP Request

POST /aps/2/resources/{aps-id}/applications/{pluginName}/enable

Description

Enable an exchange rate plugin.

Parameters

PARAMETER

TYPE

DESCRIPTION

pluginName

String

Plugin name

Returns

PluginResponseDTO

Structures

StoreApplicationStatus

Contract: enum values should match CBStore AppStatus enum.

StoreApplicationVersionDisplayMode

Contract: enum values should match CBStore VersionDisplayMode enum.

StorePluginDTO

A structure of this kind represents general information about an exchange rate plugin.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

storeAppId

String

Required

status

String

Required

version

String

Not Required

versionDisplayMode

String

Not Required

StorePluginInformationDTO

Plugin information

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

storeAppId

String

Required

appId

String

Required

applicationViewId

String

Required

applicationViewType

String

Not Required

installComponentName

String

Not Required

status

String

Required

version

String

Not Required

versionDisplayMode

String

Not Required

installationMethod

String

Required

uninstallationMethod

String

Required

CurrencyPairDTO

A structure of this kind represents a pair of sales and billing currencies.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

base

CurrencyDTO

Not Required

A structure with sales currency name and ISO code.

quote

CurrencyDTO

Not Required

A structure with billing currency name and ISO code.

CurrencyDTO

A structure of this kind represents a currency.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

code

String

Required

Currency code in ISO 4217 format.

name

String

Not Required Read Only

Currency name that is suitable for displaying in the en_US locale.

PluginSyncDTO

A structure of this kind represents exchange rate synchronization status of a plugin.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

status

Enum

Not Required

WARNING

syncTime

String

Not Required Read Only

PluginConfigDTO

A structure of this kind represents configuration of an exchange rate plugin.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

configSchema

Object

Not Required

config

Object

Not Required

state

Enum

Not Required

supportedCurrencyPairs

Array of CurrencyPairDTO

Not Required

lastPluginSync

PluginSyncDTO

Not Required

PluginResponseStatus

Possible statuses

PluginResponseDTO

A structure of this kind represents a plugin response that includes status and message.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

status

String

Required

message

String

Not Required

Examples

Installing Exchange Rate Plugin

To install a plugin, you need to perform the API requests below using the provider token.

First, get the plugin-manager application resource ID using the following request:

GET /aps/2/resources/?implementing(http://a8n.bss/exchangerates/plugin-manager)

The response will look similar to this:

HTTP/1.1 200 OK

  {
      "aps": {
          "modified": "2022-04-08T11:27:47Z",
          "id": "105fd2a0-d20e-47d7-925e-9aad23b3a8fd",
          "type": "http://a8n.bss/exchangerates/plugin-manager/1.0",
          "status": "aps:ready",
          "revision": 2
      }
  }

After that, install the plugin using a request similar to the one below, providing the application ID from the response you received. Optionally, you can provide configuration payload to install and configure the plugin.

POST /aps/2/resources/105fd2a0-d20e-47d7-925e-9aad23b3a8fd/applications/plugin_name/install

    {
        "base_currencies":"USD,EUR",
        "app_id":"ad5ab247a30548bb9a18820b4d7f602a"
    }

As a result, you will receive a response like this:

HTTP/1.1 200 OK

  {"status":"SUCCESS"}

Get a List of Plugins

To obtain a list of plugins, make a request like this:

GET /aps/2/resources/105fd2a0-d20e-47d7-925e-9aad23b3a8fd/applications

As a result, you will receive a response like this:

HTTP/1.1 200 OK

  {
        "storeAppId": "OpenExchangeRates",
        "status": "installed_latest",
        "versionDisplayMode": "display_none"
  }

Pause a Plugin

You can temporarily disable a plug-in so that it stops processing requests to the exchange rate provider. You can do this using the request similar to this one:

POST /aps/2/resources/105fd2a0-d20e-47d7-925e-9aad23b3a8fd/applications/OpenExchangeRates/disable

As a result, you will receive a response like this:

HTTP/1.1 200 OK

  {
      "status": "SUCCESS"
  }

To enable a plugin, perform the following request:

POST /aps/2/resources/105fd2a0-d20e-47d7-925e-9aad23b3a8fd/applications/OpenExchangeRates/enable

You will get a response similar to this:

HTTP/1.1 200 OK

  {
      "status": "SUCCESS"
  }