Get Resources Relationships

Get Resources Relationships

Get resources that satisfy filtering criteria and are related to specified listof resources with the given relationship type

Request
URI
POST
https://{api_host}/suite-api/api/resources/bulk/relationships
COPY
Query Parameters
integer
page
Optional
Constraints: default: 0

Page number from which data needs to be displayed (0-based)

integer
pageSize
Optional
Constraints: default: 1000

Expected number of entries per page


Request Body

Query spec that encapsulates various filtering criteria for related resources look up

resource-relationships-query of type(s) application/json
Required

Show optional properties

{
    "relationshipType": "string",
    "resourceIds": [
        {}
    ]
}
"{\n  \"relationshipType\" : \"DESCENDANT\",\n  \"resourceIds\" : [ \"51d18139-1392-48f3-b8f4-2aba18449192\", \"8b95242e-b662-4bbe-9475-cfbc86296245\" ],\n  \"resourceQuery\" : {\n    \"name\" : [ \"VMware Cloud Foundation Operations Node-VMware Cloud Foundation Cluster Node\" ],\n    \"adapterKind\" : [ \"VMWARE\" ],\n    \"resourceKind\" : [ \"ResourcePool\" ],\n    \"collectorName\" : [ \"local_collector\" ],\n    \"collectorId\" : [ 1 ],\n    \"maintenanceScheduleId\" : [ \"b12b4d87-17cb-45d0-9762-925844020132\" ],\n    \"adapterInstanceId\" : [ \"b99fa172-236c-4403-ac0a-44dde9421828\" ],\n    \"resourceState\" : [ \"STARTED\" ],\n    \"resourceStatus\" : [ \"DATA_RECEIVING\" ],\n    \"credentialId\" : [ \"0dbf1899-c17e-4231-8ae8-695ed983fd42\" ],\n    \"resourceId\" : [ \"1c5cbc77-4ad1-4a46-a142-3d5043ba7e10\" ],\n    \"statKeyInclusive\" : true,\n    \"propertyConditions\" : {\n      \"conjunctionOperator\" : \"OR\",\n      \"conditions\" : [ {\n        \"key\" : \"property_name\",\n        \"operator\" : \"EQ\",\n        \"stringValue\" : \"property_value\"\n      } ]\n    },\n    \"statConditions\" : {\n      \"conjunctionOperator\" : \"OR\",\n      \"conditions\" : [ {\n        \"key\" : \"stat|key1\",\n        \"operator\" : \"LT_EQ\",\n        \"doubleValue\" : 1.0\n      } ]\n    },\n    \"resourceTag\" : [ {\n      \"category\" : \"category_name\",\n      \"name\" : \"tag_name\"\n    } ]\n  },\n  \"hierarchyDepth\" : 5\n}"
string
relationshipType
Required

Relationship Types between resources. All relationships are many-to-many.
Representation names are plural.

Possible values are : PARENT, CHILD, DESCENDANT, ANCESTOR, ALL,
array of string
resourceIds
Required

Resource uuids to get the related resources for

object
resourceQuery
Optional

Object used to lookup resources with various filtering criteria

integer As int32 As int32
hierarchyDepth
Optional

Relation hierarchy depth. Used with relationship types DESCENDANT, ANCESTOR and ALL. Defaults to 10.

Authentication
This operation uses the following authentication methods.
Responses
200

The Collection of Resources related to given set of resources and matching the query Spec

Returns resources-relation of type(s) application/json
"{\n  \"relationshipType\" : \"DESCENDANT\",\n  \"resourcesRelations\" : [ {\n    \"resource\" : {\n      \"creationTime\" : 1744473855297,\n      \"resourceKey\" : {\n        \"name\" : \"VM1\",\n        \"adapterKindKey\" : \"VMWARE\",\n        \"resourceKindKey\" : \"VirtualMachine\",\n        \"resourceIdentifiers\" : [ {\n          \"identifierType\" : {\n            \"name\" : \"VMEntityObjectID\",\n            \"dataType\" : \"STRING\",\n            \"isPartOfUniqueness\" : true\n          },\n          \"value\" : \"vm-123\"\n        }, {\n          \"identifierType\" : {\n            \"name\" : \"VMEntityVCID\",\n            \"dataType\" : \"STRING\",\n            \"isPartOfUniqueness\" : true\n          },\n          \"value\" : \"CBAD174A-622E-4650-805A-064F824FFA76\"\n        }, {\n          \"identifierType\" : {\n            \"name\" : \"VMEntityName\",\n            \"dataType\" : \"STRING\",\n            \"isPartOfUniqueness\" : true\n          },\n          \"value\" : \"VM1\"\n        } ]\n      },\n      \"credentialInstanceId\" : \"51f8f60d-4a39-4839-9924-698d022e2e10\",\n      \"resourceStatusStates\" : [ ],\n      \"dtEnabled\" : true,\n      \"badges\" : [ ],\n      \"relatedResources\" : [ ],\n      \"identifier\" : \"2b6c345c-cf77-45c9-b5f3-e37c578b1f29\"\n    },\n    \"relatedResources\" : [ \"083efb86-c82f-4f48-8f01-ba3ce0d345f4\", \"4d7babc5-f263-4072-a158-bc40af3e3502\" ]\n  } ]\n}"
object
pageInfo
Optional

Represents page information for a paged result

string
relationshipType
Required

Relationship Types between resources. All relationships are many-to-many.
Representation names are plural.

Possible values are : PARENT, CHILD, CONTAINS, CONTAINED_BY, REFERENCES, REFERENCED_BY, USES, USED_BY, SELF, DESCENDANT, ANCESTOR, TST, ALL,
array of object
resourcesRelations
Required

Resources info combined with lists of query resource identifiers to which they are related

array of object
links
Optional

Collection of links


404

If could find none of the resources from ResourceRelationshipsQuery.resourceIds

Operation doesn't return any data structure

500

If there is an error during the query

Operation doesn't return any data structure

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