Danny,
Your answer helped me.
Thank you for that and as it was expressed in stackoverflow post I'll be 
updating it there.



Ernest Gulik

From: [email protected] 
[mailto:[email protected]] On Behalf Of Danny Sokolsky
Sent: Tuesday, October 20, 2015 5:19 PM
To: MarkLogic Developer Discussion <[email protected]>
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

That return is in the wrong place.  It should be after the let statements:

{
  let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
return
  xdmp:database-backup(
    xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )
};

I'm not sure what that last expression is.  If you want to return a document 
node, then you need a comma before it.

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Gulik, Ernest
Sent: Tuesday, October 20, 2015 3:13 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

Thank you for a quick reply.
I commented out import of admin library,
Added simple return line, so the code looks like this:

....
{
  let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
  xdmp:database-backup(
    xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )
  return document { "Done"}
};

But still the same error on trying to install it.
Is there something else that should be returned here?

Ernest Gulik

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Danny Sokolsky
Sent: Tuesday, October 20, 2015 4:45 PM
To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

Additionally, there is no need to import the admin library.

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Danny Sokolsky
Sent: Tuesday, October 20, 2015 2:40 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

It looks like your function has a syntax error in it:

let $dbname := map:get($params, $dbname)
  let $s3bucket := map:get($params, $s3bucket)
  xdmp:database-backup(
    (:xdmp:database-forests(xdmp:database($dbname)), $s3bucket ):)
    xdmp:database-forests(xdmp:database($dbname)), "s3://bucketname/folder" )


It is missing the return after the let statements.

-Danny

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Gulik, Ernest
Sent: Tuesday, October 20, 2015 2:26 PM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] Invalid content RESTAPI-INVALIDCONTENT: 
(err:FOER0000) - when installing rest-api extension for backups in MarkLogic 7

Hello everyone,
There's simple xquery function for backups that works pretty great.
I wanted to automate it, knowing that we can install new extensions.
My code, error and command can be found on 
stackoverflow<http://stackoverflow.com/questions/33246818/marklogic-7-database-backup-with-rest-api>.
I didn't want to create another copy of my post.
If anyone has some suggestions as to what could be causing 
RESTAPI-INVALIDCONTENT: (err:FOER0000)
I would greatly appreciate it.
Is such thing even supported in ML7?
Digging through bunch of other functions under /opt/MarkLogic seems like this 
should work
but I can't seem to find anything about that anywhere in documentation.

Thank you,
Ernest Gulik

_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to