Page 1 of 1

REST API Rule Attach

Posted: Mon May 17, 2021 5:18 pm
by dan.kelleher
Hi All,

I've worked out how to validate the existing or new rule for a cube, but can't find where in the documentation it shows how to attach. Does anyone know the function?

request:

Code: Select all

api/v1/Cubes('xxx')/tm1.CheckRules
body (blank to check existing rule):

Code: Select all

{"Rules": "this is an error"}
response:

Code: Select all

{
    "@odata.context": "../$metadata#Collection(ibm.tm1.api.v1.RuleSyntaxError)",
    "value": [
        {
            "LineNumber": 1,
            "Message": "Syntax error on or before: \"\nthis is an error\n missing left square bracket \" "
        }
    ]
}
Thanks,

Dan

Re: REST API Rule Attach

Posted: Mon May 17, 2021 5:39 pm
by dan.kelleher
Managed to figure it out:

PATCH request:

Code: Select all

api/v1/Cubes('xxx')
Body:

Code: Select all

{"Rules": "this is an error"}
Response:

Code: Select all

{
    "@odata.context": "$metadata#Cubes/$entity",
    "@odata.etag": "W/\"e8d228a6c97159561df48d9ecf2a4c71a1a657b6\"",
    "Name": "xxx",
    "Rules": "this is an error",
    "DrillthroughRules": null,
    "LastSchemaUpdate": "2021-05-15T22:41:39.227Z",
    "LastDataUpdate": "2021-05-17T17:31:54.785Z",
    "Attributes": {
        "Caption": "xxx"
    }
}