Loading TOC...

PUT /manage/v2/hosts/{id|name}/properties

Summary

Initiate a properties change on the specified host.

URL Parameters
format The format of the data in the request body. Can be json or xml. If present, the format parameter overrides the request Content-type header.
Request Headers
Accept The expected MIME type of the response. If the format parameter is present, it takes precedence over the Accept header. Supported values: application/xml, application/json.
Content-type The MIME type of the data in the request body, either application/xml or application/json.
Response Headers
Content-type The MIME type of the data in the response body. Use the Accept header or format request parameter to specify a preferred format. The format parameter takes precedence over the Accept header if both are present.

Response

Upon success, MarkLogic Server returns a status code 204 (No Content) or a status code 202 (Accepted). If the payload is malformed or the host does not exist, a status code of 400 (Bad Request) is returned. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges.

Required Privileges

This operation requires the manage-admin role, or the following privilege:

http://marklogic.com/xdmp/privileges/manage-admin

http://marklogic.com/xdmp/privileges/manage

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

Usage Notes

The data in the request body can contain one or more properties to modify. Set bootstrap-host to true if it is to serve as the bootstrap host for the cluster; otherwise set to false. For details on the bootstrap host, see Database Replication in MarkLogic Server in the Database Replication Guide.

The data in the request body has the following structure:

dynamic-host

host-name

The internet host name.

group

A group name or id.

bind-port

The distributed protocol server socket bind internet port number.

foreign-bind-port

The distributed protocol foreign server socket bind internet port number.

zone

Zone the host belongs to.

bootstrap-host

host-mode

The mode of this host

host-mode-description

The description for this host mode

Example


$ cat host-prop.xml
==> 
<host-properties xmlns="http://marklogic.com/manage">
  <zone>my-new-zone</zone>
</host-properties>

$ curl --anyauth --user user:password -X PUT -d @./host-prop.xml \
    -i -H "Content-type: application/xml" \
    http://localhost:8002/manage/v2/hosts/my-host/properties

==> The zone property of host my-host is modified. MarkLogic Server
    returns headers similar to the following:

HTTP/1.1 204 No Content
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
    

Example


$ cat host-prop.json
==> 
{ "zone":"my-new-zone" }

$ curl --anyauth --user user:password -X PUT -d @./host-prop.json \
    -i -H "Content-type: application/json" \
    http://localhost:8002/manage/v2/hosts/my-host/properties

==> The zone property of host my-host is modified. MarkLogic Server
    returns headers similar to the following:

HTTP/1.1 204 No Content
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
    

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