KesselInventoryService_AddResourceRelationships
const url = 'https://example.com/api/kessel/v1beta2/resources/relationships';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"inventoryId":"example","type":"example","reporterType":"example","reporterInstanceId":"example","localResourceId":"example","reporter":{},"common":{},"transactionId":"example","writeVisibility":"WRITE_VISIBILITY_UNSPECIFIED"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/kessel/v1beta2/resources/relationships \ --header 'Content-Type: application/json' \ --data '{ "inventoryId": "example", "type": "example", "reporterType": "example", "reporterInstanceId": "example", "localResourceId": "example", "reporter": {}, "common": {}, "transactionId": "example", "writeVisibility": "WRITE_VISIBILITY_UNSPECIFIED" }'Adds one or more relationships to an existing Resource.
If the Resource does not yet exist for this Reporter, it is created with the provided relationship fields as its initial representation. All other relationships already reported for that Resource are unaffected.
Unlike ReportResource, which asserts the complete state of a Resource,
this operation is a targeted mutation: it only touches the specific
relationship fields and values named in the request. Attribute fields,
other relationship fields, and metadata are left exactly as they were.
Only relationship-typed fields from the Resource’s schema are accepted; attribute fields are rejected.
The relationships added through this API are used to determine relationship check outcomes via the Check and CheckForUpdate APIs.
This API does not guarantee immediate read-your-writes consistency by default.
If a reporter requires newly added relationships to be visible in subsequent
checks (e.g., Check), the request must explicitly set write_visibility = IMMEDIATE.
Request Bodyrequired
Section titled “Request Bodyrequired”Request to add one or more relationships to a Resource without reporting the complete set of relationships. Only relationship-typed fields are accepted; attribute fields are rejected.
object
Partial reporter representation containing only relationship fields.
Merged additively into existing reporter relationships.
At least one of reporter or common must be provided.
object
Partial common representation containing only relationship fields.
At least one of reporter or common must be provided.
object
Responses
Section titled “Responses”OK
object
Examplegenerated
{}default
Section titled “default”Default error response
The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.
object
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
A list of messages that carry the error details. There is a common set of message types for APIs to use.
Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
object
The type of the serialized message.
Examplegenerated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}