Skip to content

Add Microsoft.Security views API spec #34531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{

Check failure on line 1 in specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/examples/View_example.json

View check run for this annotation

Azure Pipelines / Swagger PrettierCheck

specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/examples/View_example.json#L1

specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/examples/View_example.json(1,1): error : Code style issues found, please run prettier. > npm install > npx prettier --write specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/examples/View_example.json
"parameters": {
"scopes": [
"/subscriptions/cfbbd179-59d2-4052-aa06-9270a38aa9d6",
"/subscriptions/8e22af33-2b2b-4f43-be9a-82aae2f0c2b5/resourcegroups/cus-test-platform/providers/Microsoft.Security/securityConnectors/TestNotifications"
],
"scenarioName": "secureScopre/cloudInitiativeMetrics",
"scenarioParameters": {
"startDateTime": "2025-05-06T07:06:02.280Z"
}
},
"responses": {
"200": {
"body": {
"scenarioResult": {
"overtimeMetrics": {
"type": "overtimeMetricsResponse",
"properties": {
"overtimeMetrics": {
"secureScoreOverTime": [
{
"values": [
95.44,
93.15,
95.28,
95.3,
81.83,
59.89,
41.92,
40.81,
0,
0,
88.86,
0,
66.02,
49.55
],
"dates": [
"2025-04-29T00:00:00Z",
"2025-04-28T00:00:00Z",
"2025-04-27T00:00:00Z",
"2025-04-26T00:00:00Z",
"2025-04-24T00:00:00Z",
"2025-04-23T00:00:00Z",
"2025-04-21T00:00:00Z",
"2025-04-19T00:00:00Z",
"2025-04-18T00:00:00Z",
"2025-04-16T00:00:00Z",
"2025-04-14T00:00:00Z",
"2025-04-13T00:00:00Z",
"2025-04-12T00:00:00Z",
"2025-04-10T00:00:00Z"
]
}
]
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{

Check notice on line 1 in specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/views.json

View workflow job for this annotation

GitHub Actions / TypeSpec Requirement

Brownfield services will soon be required to convert from OpenAPI to TypeSpec. See https://aka.ms/azsdk/typespec.

Check failure on line 1 in specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/views.json

View check run for this annotation

Azure Pipelines / Swagger PrettierCheck

specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/views.json#L1

specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/views.json(1,1): error : Code style issues found, please run prettier. > npm install > npx prettier --write specification/security/resource-manager/Microsoft.Security/preview/2025-05-01-preview/views.json
"swagger": "2.0",
"info": {
"title": "Microsoft Defender for Cloud",
"description": "API spec for Microsoft.Security (Azure Security Center) resource provider",
"version": "2025-05-01-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/providers/Microsoft.Security/views": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

views

rename to getView or fetchView or similar verb

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to 'view'

"post": {
"tags": [
"Views"
],
"description": "Fetch Microsoft Defender for Cloud data over a specified view",
"operationId": "Views",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
},
{
"name": "scenarioName",
"in": "body",
"required": true,
"type": "string",
"description": "The name of the scenario for which the data is requested"
},
{
"name": "scenarioParameters",
"in": "body",
"required": true,
"type": "object",
"description": "The parameters for the specified scenario and view"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets discuss why the scenario needs a generic schema

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scheduled a dedicated discussion on the topic

}
],
"responses": {
"200": {
"description": "Result of the query operation",
"schema": {
"$ref": "#/definitions/ScenarioResponse"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets discuss why the scenario needs a generic schema

},
"default": {
"description": "An error occurred while processing the request. See the error.code parameter to identify the specific error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"View example": {
"$ref": "./examples/View_example.json"
}
}
}
}
},
"definitions": {
"ScenarioResponse": {
"description": "Query result.",
"type": "object"
},
"ErrorResponse": {
"title": "Error response.",
"type": "object",
"description": "An error response from the API.",
"properties": {
"error": {
"$ref": "#/definitions/Error",
"description": "Error information."
}
},
"required": [
"error"
]
},
"Error": {
"title": "Error info.",
"type": "object",
"description": "Error details.",
"properties": {
"code": {
"type": "string",
"description": "Error code identifying the specific error."
},
"message": {
"type": "string",
"description": "A human readable error message."
},
"details": {
"type": "array",
"description": "Error details",
"items": {
"$ref": "#/definitions/ErrorDetails"
},
"x-ms-identifiers": []
}
},
"required": [
"code",
"message"
]
},
"ErrorDetails": {
"title": "Error details.",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Error code identifying the specific error."
},
"message": {
"type": "string",
"description": "A human readable error message."
}
},
"additionalProperties": {
"type": "object"
},
"required": [
"code",
"message"
]
}
}
}
Loading