Registry Name Service

Registry Name Service

Registry Name Service Cache Update

Retrieves all the Registry Name Service Database updates for this host since lastupdated.

GET https://RNS_Server:24351/REST/service/svccache?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&uuid=<uuid>&lastupdated=<num>
RESPONSE {"services":[{"svcgname":"registry_name_service","svc":1,"cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"role":4,"sorder":1,"lastupdated_usec":1479140226550825},{"svcgname":"dflt_pbpolicy_service","svc":2,"cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"role":4,"sorder":1,"lastupdated_usec":1479140226572396},{"svcgname":"dflt_log_service","svc":4,"cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"role":4,"sorder":1,"lastupdated_usec":1479140226597899},{"svcgname":"dflt_sudopolicy_service","svc":8,"cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"role":4,"sorder":1,"lastupdated_usec":1479140226627291},{"svcgname":"dflt_fim_service","svc":128,"cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"role":4,"sorder":1,"lastupdated_usec":1479140226674180},{"svcgname":"dflt_logarch_service","svc":32,"cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"role":4,"sorder":1,"lastupdated_usec":1479140226701934},{"svcgname":"dflt_pbpolicy_service","svc":2,"cn":"pbtest","uuid":"024352a4-d4d0-48d2-bdcc-76ec429632f7","fqdn":"pbtest","addrs":[{"family":4,"port":24351,"addr":"192.168.16.184"}],"role":1,"sorder":0,"lastupdated_usec":1479152447772617},{"svcgname":"dflt_log_service","svc":4,"cn":"pbtest","uuid":"024352a4-d4d0-48d2-bdcc-76ec429632f7","fqdn":"pbtest","addrs":[{"family":4,"port":24351,"addr":"192.168.16.184"}],"role":1,"sorder":0,"lastupdated_usec":1479152447774991},{"svcgname":"dflt_fim_service","svc":128,"cn":"pbtest","uuid":"024352a4-d4d0-48d2-bdcc-76ec429632f7","fqdn":"pbtest","addrs":[{"family":4,"port":24351,"addr":"192.168.16.184"}],"role":2,"sorder":2,"lastupdated_usec":1479152505459492}]}

Registry Name Service - Get Service Group Info

Retrieves Service Group information from the Registry Name Service Database.

GET https://RNS_Server:24351/REST/service/svcgrp?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>
RESPONSE [{"svcgid":1,"svcgname":"registry_name_service","svc":"registry","updated_usec":"2016-11-14 16:17:06","deleted":false},
{"svcgid":2,"svcgname":"dflt_pbpolicy_service","svc":"pbpolicy","updated_usec":"2016-11-14 16:17:06","deleted":false},
{"svcgid":3,"svcgname":"dflt_log_service","svc":"logsvr","updated_usec":"2016-11-14 16:17:06","deleted":false},
{"svcgid":4,"svcgname":"dflt_sudopolicy_service","svc":"sudopolicy","updated_usec":"2016-11-14 16:17:06","deleted":false},
{"svcgid":5,"svcgname":"dflt_Solr_service","svc":"Solr","updated_usec":"2016-11-14 16:17:06","deleted":false}
{"svcgid":6,"svcgname":"dflt_logarch_service","svc":"logarchive","updated_usec":"2016-11-14 16:17:06","deleted":false},
{"svcgid":7,"svcgname":"dflt_beyondinsight_service","svc":"beyondinsight","updated_usec":"2016-11-14 16:17:06","deleted":false},
{"svcgid":8,"svcgname":"dflt_fim_service","svc":"fim","updated_usec":"2016-11-14 16:17:06","deleted":false}]

Registry Name Service - Get Registry Name Service Host and Service Group Info

Retrieves Registry Name Service Host and Services information.

GET https://RNS_Server:24351/REST/service/svchost/name?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&cn=<cn>&svcgname=<svcgname>
RESPONSE [{"svcgid":1,"svcgname":"registry_name_service","svc":"registry","updated_usec":"2016-11-14 16:17:06","deleted":false,"svcs":[{"svcgid":1,"hostid":1,"role":"primary","sorder":1,"created_usec":"2016-11-14 16:17:06","updated_usec":"2016-11-14 16:17:06","cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"deleted":0}]},            
{"svcgid":2,"svcgname":"dflt_pbpolicy_service","svc":"pbpolicy","updated_usec":"2016-11-14 16:17:06","deleted":false,"svcs":[{"svcgid":2,"hostid":1,"role":"primary","sorder":1,"created_usec":"2016-11-14 16:17:06","updated_usec":"2016-11-14 16:17:06","cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"deleted":0}]},            
{"svcgid":3,"svcgname":"dflt_log_service","svc":"logsvr","updated_usec":"2016-11-14 16:17:06","deleted":false,"svcs":[{"svcgid":3,"hostid":1,"role":"primary","sorder":1,"created_usec":"2016-11-14 16:17:06","updated_usec":"2016-11-14 16:17:06","cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"deleted":0}]},        
{"svcgid":4,"svcgname":"dflt_sudopolicy_service","svc":"sudopolicy","updated_usec":"2016-11-14 16:17:06","deleted":false,"svcs":[{"svcgid":4,"hostid":1,"role":"primary","sorder":1,"created_usec":"2016-11-14 16:17:06","updated_usec":"2016-11-14 16:17:06","cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"deleted":0}]},
{"svcgid":5,"svcgname":"dflt_Solr_service","svc":"Solr","updated_usec":"2016-11-14 16:17:06","deleted":false},            
{"svcgid":6,"svcgname":"dflt_logarch_service","svc":"logarchive","updated_usec":"2016-11-14 16:17:06","deleted":false,"svcs":[{"svcgid":6,"hostid":1,"role":"primary","sorder":1,"created_usec":"2016-11-14 16:17:06","updated_usec":"2016-11-14 16:17:06","cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"deleted":0}]},
{"svcgid":7,"svcgname":"dflt_beyondinsight_service","svc":"beyondinsight","updated_usec":"2016-11-14 16:17:06","deleted":false},        
{"svcgid":8,"svcgname":"dflt_fim_service","svc":"fim","updated_usec":"2016-11-14 16:17:06","deleted":false,"svcs":[{"svcgid":8,"hostid":1,"role":"primary","sorder":1,"created_usec":"2016-11-14 16:17:06","updated_usec":"2016-11-14 16:17:06","cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"deleted":0},{"svcgid":8,"hostid":2,"role":"secondary","sorder":2,"created_usec":"2016-11-14 19:41:45","updated_usec":"2016-11-14 19:40:47","cn":"pbtest","uuid":"024352a4-d4d0-48d2-bdcc-76ec429632f7","fqdn":"pbtest","addrs":[{"family":4,"port":24351,"addr":"192.168.16.184"}],"tnlzone":-1,"deleted":0}]}]

Registry Name Service - Get Registry Name Service Group and Role Information

Retrieves Registry Name Service Group and Role information.

GET https://RNS_Server:24351/REST/service/svchost/role?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&role=<role>&svcgname=<svcgname>
RESPONSE {"svcgid":1,"svcgname":"registry_name_service","svc":"registry","updated_usec":"2016-11-14 16:17:06","deleted":false,"svcs":[{"svcgid":1,"hostid":1,"role":"primary","sorder":1,"created_usec":"2016-11-14 16:17:06","updated_usec":"2016-11-14 16:17:06","cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"deleted":0}]}

Registry Name Service - Get Registry Name Service Host information

Retrieves Registry Name Service Group and Role information.

GET https://RNS_Server:24351/REST/service/host/name?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&cn=<cn>
GET https://RNS_Server:24351/REST/service/host/uuid?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&uuid=<uuid>
GET https://RNS_Server:24351/REST/service/host/fqdn?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&fqdn=<fqdn>
RESPONSE {"hostid":1,"cn":"pbuild","uuid":"7d4504dd-b64f-453c-9a12-53a079a8d4ff","fqdn":"pbuild","addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"tnlzone":0,"updated_usec":"2016-11-14 16:17:06","deleted":false}

Registry Name Service - Delete Service Group

Delete the specified Service Group.

DELETE https://Primary_RNS_Server:24351/REST/service/svcgrp?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&svcgname=<svcgname>

Registry Name Service - Delete Service Host

Delete the specified host from the specified Service Group.

DELETE https://Primary_RNS_Server:24351/REST/service/svchost?appid=<appid>&timestamp=<timestamp>
&hmac=<hmac>&svcgname=<svcgname>&cn=<cn>

Registry Name Service - Delete Host

Delete the specified host from the Registry Name Service.

DELETE https://Primary_RNS_Server:24351/REST/service/host?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>&cn=<cn>

Registry Name Service - Delete Host Completely from RNS Setup

Delete specified host from the Registry Name service and delete the host entry from the service database.

DELETE https://Primary_RNS_Server:24351/REST/service/host?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>&cn=<cn>&remove=true

Registry Name Service - Put Service Group

Add/Update the specified Service Group.

PUT https://Primary_RNS_Server:24351/REST/service/svcgrp?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>
REQUEST { "svc" : { "svcgname" : "<svcgname>", "svc" : "<svc>" }}
RESPONSE { "status" : 0}

Registry Name Service - Put Service Group Host

Assign the specified host as a given role within the specified Service Group.

PUT https://Primary_RNS_Server:24351/REST/service/svchost?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>
REQUEST { "svc" : { "svcgname" : "<svcgname>", "cn" : "<cn>", "role" : "<role>" }}
RESPONSE { "status" : 0}

Registry Name Service - Put Host

Add/Update the named host in Registry Name Service.

PUT https://server1:24351/REST/service/host?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>
REQUEST { "svc" : { "cn" : "<cn>", "fqdn" : "<fqdn>", "uuid", "<uuid>" } }
RESPONSE { "status" : 0}

Registry Name Service - Promote

Promote the specified server (for example, server1) in registry name service group to primary.

PUT https://server1:24351/REST/service/promote?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>
REQUEST {"svcgname" : "<svcgname>"}
RESPONSE { "status" : 0}

REST request is sent to server being promoted.

Promote the specified server to primary with its service group.

PUT https://Primary_RNS_Server:24351/REST/service/promote?appid=<appid>&timestamp=<timestamp>&hmac=<hmac>
REQUEST {"svcgname" : "<svcgname>", "cn" : "<cn>" }
RESPONSE { "status" : 0}

Sync

REST call to set a file to be synchronized within a service group. This is the same as pbadmin –cfg -A <file> <svcgroup>.

Set to Sync

pbrestcall -a <appid> -k <appkey> -l -X PUT https://<host>:<restport>/REST/v1/cfg/sync -d  '{"file":"<file>", "svcs":["<servicegroup>"]}'
pbrestcall -a admin -k d39cf6ea-e292-4c59-b60a-2d9650eb9cad -l -X PUT https://localhost:29106/REST/v1/cfg/sync -d '{"file":"/opt/pbul/policies/myfile", "svcs":["dflt_pbpolicy_service"]}'

Import

pbrestcall -a <appid> -k <appkey> -l -X PUT https://<host>:<restport>/REST/v1/cfg/import -d '{"file":"<filename>"}'
pbrestcall -a admin -k d39cf6ea-e292-4c59-b60a-2d9650eb9cad -l -X PUT https://localhost:29106/REST/v1/cfg/import -d '{"file":"/opt/rnspbul/policies/myfile”}'

If file already exists, use force:

pbrestcall -a <appid> -k <appkey> -l -X PUT https://<host>:<restport>/REST/v1/cfg/import -d '{“force”:1, "file":"<filename>"}'