Skip to main content

relationships

Creates, updates, deletes, gets or lists a relationships resource.

Overview

Namerelationships
TypeResource
Idcloudflare.cloudforce_one.relationships

Fields

The following fields are returned by SELECT queries:

Returns a list of events related to the specified starting event.

NameDatatypeDescription
attackerstring
attackerCountrystring
categorystring
datasetIdstring
datestring
eventstring
hasChildrenboolean
indicatorstring
indicatorTypestring
indicatorTypeIdnumber
insightstring
killChainnumber
mitreAttackarray
mitreCapecarray
numReferencednumber
numReferencesnumber
rawIdstring
referencedarray
referencedIdsarray
referencesarray
referencesIdsarray
releasabilityIdstring
tagsarray
targetCountrystring
targetIndustrystring
tlpstring
uuidstring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, event_iddirection, maxDepth, relationshipTypes, indicatorTypeIds, datasetId, includeParent, page, pageSizeThe event_id must be defined (to list existing events (and their IDs), use the Filter and List Events endpoint). Also, must provide query parameters.
post_dosevent_create_bulk_with_relationshipsinsertaccount_id, data, datasetIdThis method is deprecated. Please use event_create_bulk instead
createexecaccount_id, parentId, childIds, relationshipType, datasetIdCreates a directed relationship between two events. The relationship is from parent to child with a specified type.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
event_idstringThe event ID.
datasetIdstringThe dataset ID to search within.
directionstringThe direction to traverse the graph. Defaults to 'both' to search all.
includeParentbooleanWhether to include the starting event in the results. Defaults to true.
indicatorTypeIdsarrayAn optional array of indicator type IDs to filter the results by.
maxDepthnumberThe maximum depth to traverse. Defaults to 5.
pagenumber
pageSizenumber
relationshipTypesstringAn optional array of relationship types to filter by.

SELECT examples

The event_id must be defined (to list existing events (and their IDs), use the Filter and List Events endpoint). Also, must provide query parameters.

SELECT
attacker,
attackerCountry,
category,
datasetId,
date,
event,
hasChildren,
indicator,
indicatorType,
indicatorTypeId,
insight,
killChain,
mitreAttack,
mitreCapec,
numReferenced,
numReferences,
rawId,
referenced,
referencedIds,
references,
referencesIds,
releasabilityId,
tags,
targetCountry,
targetIndustry,
tlp,
uuid
FROM cloudflare.cloudforce_one.relationships
WHERE account_id = '{{ account_id }}' -- required
AND event_id = '{{ event_id }}' -- required
AND direction = '{{ direction }}'
AND maxDepth = '{{ maxDepth }}'
AND relationshipTypes = '{{ relationshipTypes }}'
AND indicatorTypeIds = '{{ indicatorTypeIds }}'
AND datasetId = '{{ datasetId }}'
AND includeParent = '{{ includeParent }}'
AND page = '{{ page }}'
AND pageSize = '{{ pageSize }}'
;

INSERT examples

This method is deprecated. Please use event_create_bulk instead

INSERT INTO cloudflare.cloudforce_one.relationships (
data,
datasetId,
account_id
)
SELECT
'{{ data }}' /* required */,
'{{ datasetId }}' /* required */,
'{{ account_id }}'
RETURNING
createdEventsCount,
createdIndicatorsCount,
createdRelationshipsCount,
errorCount,
errors
;

Lifecycle Methods

Creates a directed relationship between two events. The relationship is from parent to child with a specified type.

EXEC cloudflare.cloudforce_one.relationships.create
@account_id='{{ account_id }}' --required
@@json=
'{
"childIds": "{{ childIds }}",
"datasetId": "{{ datasetId }}",
"parentId": "{{ parentId }}",
"relationshipType": "{{ relationshipType }}"
}'
;