Loading TOC...

POST /manage/v2/protected-paths

Summary

This resource endpoint creates a new protected path using a name or id passed in a payload.

Request Headers
Accept The expected MIME type of the request body. If the format parameter is present, it takes precedence over the Accept header.
Content-type The MIME type of the data in the request body. Depending upon the value of the format parameter or Accept header, one of application/xml, application/json, or text/html.
Response Headers
Content-type The MIME type of the data in the response body. Depending upon the value of the format parameter or Accept header, one of application/xml, application/json, or text/html.

Response

A successful call to the endpoint will return the HTTP code 201 (Created). The request has been fulfilled, resulting in the creation of a new resource. A status code of 400 (Bad Request) indicates that a protected path already exists, or that the payload is malformed. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges for this action.

Consumes
application/xmlXML Content
application/jsonJSON Content
Produces
application/jsonJSON Content
application/xmlXML Content

Required Privileges

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

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

Usage Notes

This resource endpoint creates a new protected path using a name or id passed in a payload.

A "path-expression" is required.

Payload must be valid according to the schema type protected-path-properties in the manage-protected-path-properties.xsd schema. JSON payloads are internally converted to XML before validation.

The structure of the output returned from this REST API is as follows:

path-id

Identifier for a protected-path definition

path-expression

The XPath that specifies the XML element or JSON property in a protected-path definition

path-namespaces

Namespace bindings

This is a complex structure with the following children:

path-namespace

A namespace binding specification.

This is a complex structure with the following children:

prefix

A QName prefix.

namespace-uri

A namespace URI.

permissions

The default set of permissions used in document creation.

This is a complex structure with the following children:

permission

Permission representation.

This is a complex structure with the following children:

role-id

A role identifier (unique key).

role-name

The Role name (unique)

capability

The action/task permitted by a permission

Example

> curl -X POST --anyauth -u admin:admin 
            -d @file.xml -H "Content-Type:application/xml"  http://localhost:8002/manage/v2/protected-paths
            

Payload (as file.xml):

<?xml version="1.0" encoding="UTF-8"?>
<protected-path-default-list xsi:schemaLocation="http://marklogic.com/manage/security manage-security.xsd" xmlns="http://marklogic.com/manage/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <meta>
    <uri>/manage/v2/protected-paths</uri>
    <current-time>2017-05-02T02:05:22.0612961-07:00</current-time>
    <elapsed-time units="sec">0.0108556</elapsed-time>
  </meta>
  <list-items>
    <list-count units="quantity">0</list-count>
  </list-items>
  <relations>
    <relation-group array="true">
      <typeref>security-database</typeref>
      <relation-count units="quantity">1</relation-count>
      <relation array="true">
	<uriref>/manage/v2/databases/Security</uriref>
	<roleref>database</roleref>
	<idref>7161534863501463199</idref>
      </relation>
    </relation-group>
  </relations>
</protected-path-default-list>

This is the payload for POST as XML. The call does not return any content, beyond headers.

Example

> 
            curl -X POST --anyauth -u admin:admin \
            -d @file.json -H "Content-Type:application/json" \
            http://localhost:8002/manage/v2/protected-paths
            

Payload (as file.json):

	{
		"protected-path-default-list":{
			"meta":{
				"uri":"/manage/v2/protected-paths",
				"current-time":"2017-05-02T02:05:22.0595251-07:00",
				"elapsed-time":{
					"units":"sec",
					"value":0.0121588}
				}
			,
			"list-items":{
				"list-count":{
					"units":"quantity",
					"value":0}
				}
			,
			"relations":{
				"relation-group":{
					"typeref":"security-database",
					"relation-count":{
						"units":"quantity",
						"value":1}
					,
					"relation":{
						"uriref":"/manage/v2/databases/Security",
						"roleref":"database",
						"idref":"7161534863501463199",
						"nameref":"Security"}
					}
				}
			,
			"related-views":{
				"related-view":[
					{
						"view-type":"root",
						"view-name":"default",
						"view-uri":"/manage/v2"}
					]
				}
			}
		}
   

This is the payload for POST as JSON. The call does not return any content, beyond headers

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy