Loading TOC...

admin.hostSetForeignPort

admin.hostSetForeignPort(
   $config as element(configuration),
   $host-id as (Number|String),
   $value as Number
) as element(configuration)

Summary

This function configures the specified domestic host to listen for communications from foreign hosts over the specified port.

Parameters
$config A configuration specification, typically as returned from one of the Admin module functions.
$host-id The ID of the domestic host.
$value The port number on which to listen for communications.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/host

http://marklogic.com/xdmp/privileges/admin/host/{id}

Example

  
  const admin = require('/MarkLogic/admin.xqy');
  var cfg = admin.getConfiguration()
  var hid = xdmp.host("master.marklogic.com")
  admin.hostSetForeignPort(cfg, hid, 7998)

   //Configures the specified host to listen for foreign communications over
   //port 7998.//Use admin.saveConfiguration to save the changes to the
   //configuration or pass the configuration to other Admin API functions
   //to make other changes. 
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.