Skip to main content

relationships

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

Overview

Namerelationships
TypeResource
Idazure.cloud_health.relationships

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
childEntityNamestringResource name of the child entity. Required.
discoveredBystringDiscovered by which discovery rule. If set, the relationship cannot be deleted manually.
displayNamestringDisplay name.
parentEntityNamestringResource name of the parent entity. Required.
provisioningStatestringThe status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Creating", and "Deleting". (Succeeded, Failed, Canceled, Creating, Deleting)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectOptional set of tags (key-value pairs).
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, health_model_name, relationship_name, subscription_idGet a Relationship.
list_by_health_modelselectresource_group_name, health_model_name, subscription_idtimestampList Relationship resources by HealthModel.
create_or_updateinsertresource_group_name, health_model_name, relationship_name, subscription_idCreate a Relationship.
create_or_updatereplaceresource_group_name, health_model_name, relationship_name, subscription_idCreate a Relationship.
deletedeleteresource_group_name, health_model_name, relationship_name, subscription_idDelete a Relationship.

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
health_model_namestringName of health model resource. Required.
relationship_namestringName of the relationship. Must be unique within a health model. For example, a concatenation of parentEntityName and childEntityName can be used as the name. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
timestampstring (date-time)Timestamp to use for the operation. When specified, the version of the resource at this point in time is retrieved. If not specified, the latest version is used. Default value is None.

SELECT examples

Get a Relationship.

SELECT
id,
name,
childEntityName,
discoveredBy,
displayName,
parentEntityName,
provisioningState,
systemData,
tags,
type
FROM azure.cloud_health.relationships
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND health_model_name = '{{ health_model_name }}' -- required
AND relationship_name = '{{ relationship_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a Relationship.

INSERT INTO azure.cloud_health.relationships (
properties,
resource_group_name,
health_model_name,
relationship_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ health_model_name }}',
'{{ relationship_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Create a Relationship.

REPLACE azure.cloud_health.relationships
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND health_model_name = '{{ health_model_name }}' --required
AND relationship_name = '{{ relationship_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete a Relationship.

DELETE FROM azure.cloud_health.relationships
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND health_model_name = '{{ health_model_name }}' --required
AND relationship_name = '{{ relationship_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;