diff --git a/descriptors/ModuleDescriptor-template.json b/descriptors/ModuleDescriptor-template.json index 152e5ce..0ad318f 100644 --- a/descriptors/ModuleDescriptor-template.json +++ b/descriptors/ModuleDescriptor-template.json @@ -82,15 +82,20 @@ "methods": [ "POST" ], - "pathPattern": "/cyclops/sets/{setName}", + "pathPattern": "/cyclops/sets/{setName}/add", "permissionsRequired": [ - "cyclops.sets.modify" - ], - "permissionsDesired": [ "cyclops.sets.add-objects", - "cyclops.sets.remove-objects" - ] - }, + ], + }, + { + "methods": [ + "POST" + ], + "pathPattern": "/cyclops/sets/{setName}/remove", + "permissionsRequired": [ + "cyclops.sets.remove-objects", + ], + }, { "methods": [ "POST" @@ -141,19 +146,13 @@ "permissionName": "cyclops.sets.delete", "displayName": "CYCLOPS: Delete set" }, - { - "permissionName": "cyclops.sets.modify", - "displayName": "CYCLOPS: Add/remove objects to/from set" - }, { "permissionName": "cyclops.sets.add-objects", "displayName": "CYCLOPS: Add objects to set (UNIMPLEMENTED)", - "subPermissions": ["cyclops.sets.modify"] }, { "permissionName": "cyclops.sets.remove-objects", "displayName": "CYCLOPS: Remove objects from set (UNIMPLEMENTED)", - "subPermissions": ["cyclops.sets.modify"] }, { "permissionName": "cyclops.sets.modify-tags", diff --git a/htdocs/index.html b/htdocs/index.html index 6aeed55..0489681 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -70,8 +70,8 @@
  • retrieve from set "test.mike"
  • retrieve from set "test.mike" using only supported params
  • -
  • -
  • +
  • +
  • diff --git a/ramls/Makefile b/ramls/Makefile index bbe7047..e1c25be 100644 --- a/ramls/Makefile +++ b/ramls/Makefile @@ -19,7 +19,8 @@ schemalint: z-schema set-schema.json z-schema sets-schema.json z-schema retrieve-schema.json - z-schema addremoveobjects-schema.json + z-schema addobjects-schema.json + z-schema removeobjects-schema.json z-schema addremovetag-schema.json examplelint: @@ -30,8 +31,8 @@ examplelint: z-schema set-schema.json examples/set-example.json z-schema sets-schema.json examples/show-sets-example.json z-schema retrieve-schema.json examples/retrieve-example.json - z-schema addremoveobjects-schema.json examples/addobject-example.json - z-schema addremoveobjects-schema.json examples/removeobject-example.json + z-schema addobjects-schema.json examples/addobject-example.json + z-schema removeobjects-schema.json examples/removeobject-example.json z-schema addremovetag-schema.json examples/addtag-example.json z-schema addremovetag-schema.json examples/removetag-example.json diff --git a/ramls/addremoveobjects-schema.json b/ramls/addobjects-schema.json similarity index 66% rename from ramls/addremoveobjects-schema.json rename to ramls/addobjects-schema.json index f3d33ab..9e43f4b 100644 --- a/ramls/addremoveobjects-schema.json +++ b/ramls/addobjects-schema.json @@ -1,36 +1,35 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "description": "A request to add objects to, or remove objects from, a set", + "description": "A request to add objects to a set", "type": "object", "properties": { - "op": { - "type": "string", - "description": "Operation to perform: add or remove", - "enum": ["add", "remove"] - }, "from": { "type": "string", - "description": "Name of the set from which records are to be added to this one. Mandatory for 'add', prohibited for 'delete'" + "description": "Name of the set from which records are to be added to this one" }, "cond": { "type": "string", - "description": "An SQL-like WHERE condition specifying the selection of records included in the operation" + "description": "An SQL-like WHERE condition specifying the selection of records to be added" }, "filter": { "type": "string", - "description": "The name of a filter to be applied to selection of records included in the operation" + "description": "The name of a filter to be applied to selection of records to be added" }, "tag": { "type": "string", - "description": "A comma-separated list of the names of tags, specifying that only those selected records with any of the tags will be be included in the operation" + "description": "A comma-separated list of the names of tags, specifying that only those selected records with any of the tags will be added" }, "omitTag": { "type": "string", - "description": "A comma-separated list of the names of tags, specifying that only those selected records without any of the tags will be be included in the operation" + "description": "A comma-separated list of the names of tags, specifying that only those selected records without any of the tags will be be added" + }, + "limit": { + "type": "string", + "description": "A maximum number of objects that will be added to the set" } }, "additionalProperties": false, "required": [ - "op" + "from" ] } diff --git a/ramls/cyclops.raml b/ramls/cyclops.raml index bc6ea24..51a7472 100644 --- a/ramls/cyclops.raml +++ b/ramls/cyclops.raml @@ -116,24 +116,31 @@ documentation: application/json: type: !include retrieve-schema.json example: !include examples/retrieve-example.json - post: - description: "add objects to, or remove objects from, a set" - body: - application/json: - type: !include addremoveobjects-schema.json - examples: - add: - value: !include examples/addobject-example.json - remove: - value: !include examples/removeobject-example.json - responses: - 204: - description: No content is returned. delete: description: "Delete a set" responses: 204: description: No content is returned. + /add: + post: + description: "add objects to a set" + body: + application/json: + type: !include addobjects-schema.json + example: !include examples/addobject-example.json + responses: + 204: + description: No content is returned. + /remove: + post: + description: "remove objects from a set" + body: + application/json: + type: !include removeobjects-schema.json + example: !include examples/removeobject-example.json + responses: + 204: + description: No content is returned. /tag: /{tagName}: uriParameters: diff --git a/ramls/examples/addobject-example.json b/ramls/examples/addobject-example.json index 269cec3..198e1fa 100644 --- a/ramls/examples/addobject-example.json +++ b/ramls/examples/addobject-example.json @@ -1,8 +1,8 @@ { - "op": "add", "from": "mike", "cond": "date >= \"2025-01-01\"", "filter": "jurassic", "tag": "dino,ptero", - "omitTag": "croc" + "omitTag": "croc", + "limit": "200" } diff --git a/ramls/examples/removeobject-example.json b/ramls/examples/removeobject-example.json index 6a97d7d..0c58494 100644 --- a/ramls/examples/removeobject-example.json +++ b/ramls/examples/removeobject-example.json @@ -1,5 +1,4 @@ { - "op": "remove", "cond": "date < \"2025-01-01\"", "filter": "cretaceous", "tag": "dino", diff --git a/ramls/removeobjects-schema.json b/ramls/removeobjects-schema.json new file mode 100644 index 0000000..9fdb9ca --- /dev/null +++ b/ramls/removeobjects-schema.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "A request to remove objects from a set", + "type": "object", + "properties": { + "cond": { + "type": "string", + "description": "An SQL-like WHERE condition specifying the selection of records to be deleted" + }, + "filter": { + "type": "string", + "description": "The name of a filter to be applied to selection of records to be deleted" + }, + "tag": { + "type": "string", + "description": "A comma-separated list of the names of tags, specifying that only those selected records with any of the tags will be deleted" + }, + "omitTag": { + "type": "string", + "description": "A comma-separated list of the names of tags, specifying that only those selected records without any of the tags will be deleted" + } + }, + "additionalProperties": false +}