IBM Support

Why remapping URLs in Registry Services?

Technical Blog Post


Abstract

Why remapping URLs in Registry Services?

Body

An interesting tool that Registry Services provides is a command line interface (CLI) that can be used to change URLs in Service Providers and Registration Records. It is safe and very flexible to attend several use cases. An example: suppose that a Service Provider is running on AustinSP1 server, and this server crashes; the URLs for all the records that are created by this Service Provider in Registry Services still point to AustinSP1, which is no longer accessible.

The following sections will explain how to solve this and similar problems.

 

First of all, let's take a look at the general syntax.

 

Command syntax

 

By using the Registry Service CLI, the general syntax for the remapUrl command is:

 

./frs.sh|frs.bat remapUrl -registryType provider|resource [-filterRule query_string] -patternRule regular_expression -replacementValue URL_replacement[-keyStore file_name_path] [-keyStorePassword password] [-trustStore file_name_path]

 

You can get further information about the command, such as possible return codes and required arguments, in the Jazz for Service Management Info Center (http://www-03preprod.ibm.com/support/knowledgecenter/SSEKCU_1.1.0.3/com.ibm.psc.doc_1.1.0.3/rs_original/cli/rs_r_remap_url_command.html?lang=en)

 

Purpose

 

The goal of remapUrl command is to let server administrators dinamically replace contents from Service Providers and Registration Records, created by a particular Service Provider, based on regular expressions; these replacements are done on the database records that are returned after a query by using the search criteria specified in the “filterRule” argument.

 

Replacing a Service Provider address

 

There are a few options that can be used when remapping URLs in Registry Services. However, the most used arguments are certainly the -patternRule, -replacementValue and -filterRule. By combining the power of regular expressions used in -patternRule, with the possibility to filter records by using the default query mechanism, it is possible to handle several scenarios.

 

For example, the Registry Services server has a Service Provider record with the following URL:

 

http://server1.austin.ibm.com/providers/example

 

Then, for any reason, the server is moved to:

 

http://server2.austin.ibm.com/providers/example

 

By using the remapUrl command, we can easily change the Service Provider record and make URLs point to the new server:

 

./frs.sh remapUrl -registryType provider -patternRule server1 -replacementValue server2

 

Or we can tell it to find any attributes containing the serverN hostname and change them to server2, i.e:

 

./frs.sh remapUrl -registryType provider -patternRule server\d -replacementValue server2

 

Remapping Registration Records

 

This next example changes all Registration Records with ComputerSystem type owned by a Service Provider (12345), replacing “IBM”, case insensitive value, with “Lenovo”.

 

frs.bat -registryType resource -patternRule IBM -replacementValue Lenovo -filterRule “oslc.where=rdf:type=<http://open-services.net/ns/crtv#ComputerSystem> and oslc:serviceProvider=<http://myserver/oslc/providers/12345&gt;”

 

Important Notes

 

Make sure that all URLs are valid after remapping, this is a powerful mechanism and can easily corrupt the database. Moreover, only database backups can revert the changes, so be careful when using the remapUrl CLI.

[{"Business Unit":{"code":"BU050","label":"BU NOT IDENTIFIED"},"Product":{"code":"SSHPN2","label":"Tivoli"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

UID

ibm11276006