Set Relationship

Set Relationship
Set (Replace) Resource as RelationshipType of a specific Resource

This API exposes replace semantics. Therefore, all the existing relationships of the
specified relationshipType will be removed and replaced with the resources
specified as part of the request body.

  • If at least a few of the Resource that are part of relatedIds list
    are valid resources then the operation is performed.

  • If there are few Resource that are part of relatedIds list
    that will result in a cyclical relationship, then the operation is aborted.

NOTE: Setting relationship is not synchronous.
As a result, the set operation may not happen immediately. It is recommended
to query the relationships of the specific Resource back to ensure that the
operation was indeed successful.

Request
URI
PUT
https://{api_host}/suite-api/api/resources/{id}/relationships/{relationshipType}
COPY
Path Parameters
string
id
Required

The UUID of the source resource

string
relationshipType
Required

The type of relationship of the objects; Uses the RelationshipType.representation value

Possible values are : parents, children,

Request Body

UUID of resources to set as related to this resource

uuid-values of type(s) application/json
Required

Show optional properties

{
    "uuids": [
        {}
    ]
}
"{\n  \"uuids\" : [ \"df6de846-0e97-408d-bcff-be0026eba68a\", \"b3a3b7ef-7871-4238-86f4-3a5f10294450\" ]\n}"
array of string
uuids
Required

Represents a list of UUID(s)

Authentication
This operation uses the following authentication methods.
Responses
204

The relationship is set successfully

Operation doesn't return any data structure

404

All of the Resource that are part of the relatedIds list are invalid/non-existent

Operation doesn't return any data structure

Code Samples
COPY
                    curl -X PUT -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"uuids":["string"]}' https://{api_host}/suite-api/api/resources/{id}/relationships/{relationshipType}