URI Broker
URI Broker
The URI Broker is an object in the application plug-in web framework, which facilitates calls to the Zowe™ Application Server by constructing URIs that use the context from the calling application plug-in.
- Accessing the URI Broker
- Functions
Accessing the URI Broker
The URI Broker is accessible independent of other frameworks involved such as Angular, and is also accessible through iframe. This is because it is attached to a global when within the Zowe Desktop. For more information, see Zowe Desktop and window management. Access the URI Broker through one of two locations:
Natively:
window.ZoweZLUX.uriBroker
In an iframe:
window.parent.ZoweZLUX.uriBroker
Functions
The URI Broker builds the following categories of URIs depending upon what the application plug-in is designed to call.
Accessing an application plug-in's dataservices
Dataservices can be based on HTTP (REST) or Websocket. For more information, see Dataservices.
HTTP Dataservice URI
pluginRESTUri(plugin:ZLUX.Plugin, serviceName: string, relativePath:string): string
Returns: A URI for making an HTTP service request.
Websocket Dataservice URI
pluginWSUri(plugin: ZLUX.Plugin, serviceName:string, relativePath:string): string
Returns: A URI for making a Websocket connection to the service.
Accessing application plug-in's configuration resources
Defaults and user storage might exist for an application plug-in such that they can be retrieved through the Configuration Dataservice.
There are different scopes and actions to take with this service, and therefore there are a few URIs that can be built:
Standard configuration access
pluginConfigUri(pluginDefinition: ZLUX.Plugin, resourcePath:string, resourceName?:string): string
Returns: A URI for accessing the requested resource under the user's storage.
Scoped configuration access
pluginConfigForScopeUri(pluginDefinition: ZLUX.Plugin, scope: string, resourcePath:string, resourceName?:string): string
Returns: A URI for accessing a specific scope for a given resource.