Creating S3 blobstore via rest API

rest

#1

I am trying to create a blobstore on S3 via rest api using groovy and json file, this works for creating the repostorys and also works when creating a 'File" blobstore but i cannot get it to work to create an s3 blobstore

I have upgraded to latest version on nexus 3.15

contents of json below
cat s3blob.json
{
“name”: “s3blob”,
“type”: “groovy”,
“content”: “import org.sonatype.nexus.repository.storage.WritePolicy; import groovy.json.JsonSlurper; blobStore.createS3BlobStore(‘testblob’,’,,‘dockertest’,’’,’’,’’,’,’,‘eu-west-1’,’’,‘3’,‘Default’)”
}

I get error below when running

“result” : “javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.sonatype.nexus.internal.provisioning.BlobStoreApiImpl.createS3BlobStore() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)values: [testblob, , dockertest, , , , , …]”


#2

This came up last month… see here: Automatic config of S3 repo using API + groovy scripts


#3

Hi Rich, thanks for responding, i have seen that article and that is exactly what i am trying to do, but like the other user it does not work for me, i am following guides to create a json that contains groovy code, i can get this to work to create a file blobstore and also to create the repositories but does not work creating the S3 blobstore, it seems the only way to automate this process is through the API but without creating the s3 blobstore i cant automate anything.