From 7a17a163c48fcf896f0ad73581885db6e566961d Mon Sep 17 00:00:00 2001 From: Abhishek Singhal Date: Mon, 21 Nov 2022 14:09:35 -0800 Subject: [PATCH 1/2] Added ImpactedResources for Tenant. --- .../2022-05-01-preview/ResourceHealth.json | 81 +++++++++++++++++++ .../examples/ImpactedResources_Get.json | 2 +- .../ImpactedResources_GetByTenantId.json | 21 +++++ ...es_ListBySubscriptionId_ListByEventId.json | 6 +- ...esources_ListByTenantId_ListByEventId.json | 36 +++++++++ 5 files changed, 142 insertions(+), 4 deletions(-) create mode 100644 specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_GetByTenantId.json create mode 100644 specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListByTenantId_ListByEventId.json diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json index 3ae8eea8a6a5..db5ec5f4db4c 100644 --- a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json @@ -341,6 +341,87 @@ } } }, + "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources": { + "get": { + "tags": [ + "EventImpactedResources" + ], + "operationId": "ImpactedResources_ListByTenantIdAndEventId", + "description": "Lists impacted resources in the tenant by an event.", + "parameters": [ + { + "$ref": "#/parameters/EventTrackingIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilterParameter" + } + ], + "responses": { + "200": { + "description": "The list of impacted resources in the tenant by an event.", + "schema": { + "$ref": "#/definitions/eventImpactedResourceListResult" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListEventsByTenantId": { + "$ref": "./examples/ImpactedResources_ListByTenantId_ListByEventId.json" + } + } + } + }, + "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/impactedResources/{impactedResourceName}": { + "get": { + "tags": [ + "EventImpactedResources" + ], + "operationId": "ImpactedResources_GetByTenantId", + "description": "Gets the specific impacted resource in the tenant by an event.", + "parameters": [ + { + "$ref": "#/parameters/EventTrackingIdParameter" + }, + { + "$ref": "#/parameters/ImpactedResourceNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The details of Impacted Resource.", + "schema": { + "$ref": "#/definitions/eventImpactedResource" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "ImpactedResourcesGet": { + "$ref": "./examples/ImpactedResources_GetByTenantId.json" + } + } + } + }, "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events": { "get": { "tags": [ diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_Get.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_Get.json index 4512494b1e7b..2d15ecd03809 100644 --- a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_Get.json +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_Get.json @@ -8,7 +8,7 @@ "responses": { "200": { "body": { - "id": "Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456", + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456", "name": "abc-123-ghj-456", "type": "Microsoft.ResourceHealth/events/impactedResources", "properties": { diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_GetByTenantId.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_GetByTenantId.json new file mode 100644 index 000000000000..f3a8d6d69dbe --- /dev/null +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_GetByTenantId.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "eventTrackingId": "BC_1-FXZ", + "impactedResourceName": "abc-123-ghj-456", + "api-version": "2022-05-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456", + "name": "abc-123-ghj-456", + "type": "Microsoft.ResourceHealth/events/impactedResources", + "properties": { + "targetResourceType": "Microsoft.Compute/VirtualMachines", + "targetResourceId": "{resourceId}", + "targetRegion": "westus" + } + } + } + } +} diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListBySubscriptionId_ListByEventId.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListBySubscriptionId_ListByEventId.json index f5cf171a8182..001e036738fa 100644 --- a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListBySubscriptionId_ListByEventId.json +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListBySubscriptionId_ListByEventId.json @@ -10,7 +10,7 @@ "body": { "value": [ { - "id": "Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456", + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456", "name": "abc-123-ghj-456", "type": "Microsoft.ResourceHealth/events/impactedResources", "properties": { @@ -20,7 +20,7 @@ } }, { - "id": "Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/jkl-901-hgy-445", + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/jkl-901-hgy-445", "name": "jkl-901-hgy-445", "type": "Microsoft.ResourceHealth/events/impactedResources", "properties": { @@ -45,7 +45,7 @@ } }, { - "id": "Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789", + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789", "name": "wer-345-tyu-789", "type": "Microsoft.ResourceHealth/events/impactedResources", "properties": { diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListByTenantId_ListByEventId.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListByTenantId_ListByEventId.json new file mode 100644 index 000000000000..2954aeb38979 --- /dev/null +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/ImpactedResources_ListByTenantId_ListByEventId.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "eventTrackingId": "BC_1-FXZ", + "api-version": "2022-05-01-preview", + "$filter": "targetRegion eq 'westus'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/abc-123-ghj-456", + "name": "abc-123-ghj-456", + "type": "Microsoft.ResourceHealth/events/impactedResources", + "properties": { + "targetResourceType": "Microsoft.Compute/VirtualMachines", + "targetResourceId": "{resourceId-1}", + "targetRegion": "westus" + } + }, + { + "id": "/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789", + "name": "wer-345-tyu-789", + "type": "Microsoft.ResourceHealth/events/impactedResources", + "properties": { + "targetResourceType": "Microsoft.Compute/VirtualMachines", + "targetResourceId": "{resourceId-2}", + "targetRegion": "westus" + } + } + ], + "nextLink": "{originalRequestUrl}?$skipToken={OpaquePageNumber}" + } + } + } +} From 1af201c99053c218b4f747123b5f2e402bc1338d Mon Sep 17 00:00:00 2001 From: abhishek-corp Date: Thu, 1 Dec 2022 15:06:58 -0800 Subject: [PATCH 2/2] Added new API listSecurityAdvisoryImpactedResources for Subscriptions and Tenants. --- .../2022-05-01-preview/ResourceHealth.json | 87 +++++++++++++++++++ ...es_ListBySubscriptionId_ListByEventId.json | 66 ++++++++++++++ ...esources_ListByTenantId_ListByEventId.json | 65 ++++++++++++++ 3 files changed, 218 insertions(+) create mode 100644 specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json create mode 100644 specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json index db5ec5f4db4c..38ac802789bf 100644 --- a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/ResourceHealth.json @@ -422,6 +422,93 @@ } } }, + "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources": { + "post": { + "tags": [ + "SecurityAdvisoryImpactedResources" + ], + "operationId": "SecurityAdvisoryImpactedResources_ListBySubscriptionIdAndEventId", + "description": "Lists impacted resources in the subscription by an event (Security Advisory).", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/EventTrackingIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilterParameter" + } + ], + "responses": { + "200": { + "description": "The list of impacted resources in the subscription by an event (Security Advisory).", + "schema": { + "$ref": "#/definitions/eventImpactedResourceListResult" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListSecurityAdvisoryImpactedResourcesBySubscriptionId": { + "$ref": "./examples/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json" + } + } + } + }, + "/providers/Microsoft.ResourceHealth/events/{eventTrackingId}/listSecurityAdvisoryImpactedResources": { + "post": { + "tags": [ + "SecurityAdvisoryImpactedResources" + ], + "operationId": "SecurityAdvisoryImpactedResources_ListByTenantIdAndEventId", + "description": "Lists impacted resources in the tenant by an event (Security Advisory).", + "parameters": [ + { + "$ref": "#/parameters/EventTrackingIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilterParameter" + } + ], + "responses": { + "200": { + "description": "The list of impacted resources in the tenant by an event (Security Advisory).", + "schema": { + "$ref": "#/definitions/eventImpactedResourceListResult" + } + }, + "default": { + "description": "DefaultErrorResponse", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListSecurityAdvisoryImpactedResourcesByTenantId": { + "$ref": "./examples/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json" + } + } + } + }, "/subscriptions/{subscriptionId}/providers/Microsoft.ResourceHealth/events": { "get": { "tags": [ diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json new file mode 100644 index 000000000000..abeb037e6716 --- /dev/null +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListBySubscriptionId_ListByEventId.json @@ -0,0 +1,66 @@ +{ + "parameters": { + "subscriptionId": "subscriptionId", + "eventTrackingId": "BC_1-FXZ", + "api-version": "2022-05-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/jkl-901-hgy-445", + "name": "jkl-901-hgy-445", + "type": "Microsoft.ResourceHealth/events/impactedResources", + "properties": { + "info": [ + { + "key": "key-A", + "value": "sample-1" + }, + { + "key": "key-B", + "value": "sample-2" + }, + { + "key": "key-C", + "value": "sample-3" + }, + { + "key": "key-D", + "value": "sample-4" + } + ] + } + }, + { + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789", + "name": "wer-345-tyu-789", + "type": "Microsoft.ResourceHealth/events/impactedResources", + "properties": { + "info": [ + { + "key": "key-E", + "value": "sample-5" + }, + { + "key": "key-F", + "value": "sample-6" + }, + { + "key": "key-G", + "value": "sample-7" + }, + { + "key": "key-H", + "value": "sample-8" + } + ] + } + } + ], + "nextLink": "{originalRequestUrl}?$skipToken={OpaquePageNumber}" + } + } + } +} diff --git a/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json new file mode 100644 index 000000000000..219563064c69 --- /dev/null +++ b/specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2022-05-01-preview/examples/SecurityAdvisoryImpactedResources_ListByTenantId_ListByEventId.json @@ -0,0 +1,65 @@ +{ + "parameters": { + "eventTrackingId": "BC_1-FXZ", + "api-version": "2022-05-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/jkl-901-hgy-445", + "name": "jkl-901-hgy-445", + "type": "Microsoft.ResourceHealth/events/impactedResources", + "properties": { + "info": [ + { + "key": "key-A", + "value": "sample-1" + }, + { + "key": "key-B", + "value": "sample-2" + }, + { + "key": "key-C", + "value": "sample-3" + }, + { + "key": "key-D", + "value": "sample-4" + } + ] + } + }, + { + "id": "/subscriptions/{subscripitionId}/providers/Microsoft.ResourceHealth/events/BC_1-FXZ/impactedResources/wer-345-tyu-789", + "name": "wer-345-tyu-789", + "type": "Microsoft.ResourceHealth/events/impactedResources", + "properties": { + "info": [ + { + "key": "key-E", + "value": "sample-5" + }, + { + "key": "key-F", + "value": "sample-6" + }, + { + "key": "key-G", + "value": "sample-7" + }, + { + "key": "key-H", + "value": "sample-8" + } + ] + } + } + ], + "nextLink": "{originalRequestUrl}?$skipToken={OpaquePageNumber}" + } + } + } +}