Retrieve metadata about all transforms installed using the
/v1/config/transforms/{name}
service.
Request Headers | |
---|---|
Accept |
The expected MIME type of the information in the response.
Accepted types: application/json or
application/xml . Ignored if the request includes a
format parameter value.
|
Upon success, MarkLogic Server returns status 200 (OK) and returns the requested information in the response body.
rest-reader
role, or the
following privilege:
http://marklogic.com/xdmp/privileges/rest-reader
For more details, see Discovering Transformations in the REST Application Developer's Guide.
The expected response type can be specified using either the
format
parameter or Accept
header. One or
the other must be supplied. If both are supplied and are different,
the format
parameter takes precedence.
When refresh
is true (the default), transform metadata
is rebuilt from the most recent installation of all transforms. When
set to false, the metadata in the response reflects the contents as of
the last refresh, and may be out of synch if there has been a
subsequent update to the extension. You should only need to set
refresh
to false if you find this request is taking too long.
Transform metadata is only used for informational purposes, so
neither the acessibility nor the output of a transform is affected by
out of date metadata. The implementation is always up to date.
When refresh
is true (the default), extension metadata
is rebuilt from the most recent installation. When set to false, the
metadata in the response reflects the contents as of the last refresh
or App Server restart, and may be out of synch if there has been a
subsequent update to the extension. You should only need to set
refresh
to false if you find this request is taking too long.
$ curl --anyauth --user user:password -i -X GET -H "Accept: application/xml" \ http://localhost:8004/v1/config/transforms ==> A list of installed transforms and their metadata, as XML. For example: Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 211 Connection: close HTTP/1.1 200 OK Content-type: application/xml Server: MarkLogic Content-Length: 101 Connection: close <?xml version="1.0" encoding="UTF-8"?> <rapi:transforms xmlns:rapi="http://marklogic.com/rest-api"> <rapi:transform> <rapi:name>example</rapi:name> <rapi:title>example transform</rapi:title> <rapi:version/> <rapi:provider-name/> <rapi:description/> <rapi:transform-parameters> <rapi:parameter> <rapi:parameter-name>style?</rapi:parameter-name> <rapi:parameter-type>xs:string</rapi:parameter-type> </rapi:parameter> <rapi:parameter> <rapi:parameter-name>tag</rapi:parameter-name> <rapi:parameter-type>xs:string</rapi:parameter-type> </rapi:parameter> </rapi:transform-parameters> <rapi:transform-source>/v1/transforms/example</rapi:transform-source> </rapi:transform> </rapi:transforms>
$ curl --anyauth --user user:password -i -X GET -H "Accept: application/json" \ 'http://localhost:8004/v1/config/transforms' ==> A list of installed transforms and their metadata, as JSON. For example: Server: MarkLogic Content-Type: text/xml; charset=UTF-8 Content-Length: 211 Connection: close HTTP/1.1 200 OK Content-type: application/json Server: MarkLogic Content-Length: 331 Connection: close { "transforms": { "transform": [ { "name": "example", "title": "example transform", "version": "", "provider-name": "", "description": "example transform", "transform-parameters": { "parameter": [ { "parameter-name": "style", "parameter-type": "xs:string?" }, { "parameter-name": "tag", "parameter-type": "xs:string" } ] }, "transform-source": "/v1/transforms/example" } ] } }
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.