Skip to content
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

Support Typespec file for Easm api version 2023-03-01-preview #24937

Merged
merged 69 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e365b7b
Add typespec file for easm
thang-bit Jul 23, 2023
ef6ed8b
Change service version doc
thang-bit Jul 23, 2023
be23e95
Update file structure and add config file
thang-bit Jul 24, 2023
fd52e88
Move examples under a version
thang-bit Jul 24, 2023
e408358
Add a openapi.json file
thang-bit Jul 24, 2023
0edf03f
Remove openapi.json file
thang-bit Jul 24, 2023
568d99d
Change operation names and empty object
thang-bit Jul 24, 2023
fe0aa71
Update tspconfig
thang-bit Jul 24, 2023
0e103ca
Change config file to add .net and js emitter
thang-bit Jul 24, 2023
483f677
Add service dir to config file
thang-bit Jul 24, 2023
b89160b
Update csharp config
thang-bit Jul 24, 2023
1a8b702
Add projected name for csharp
thang-bit Jul 24, 2023
8d7ec77
Use original op
thang-bit Jul 24, 2023
06ec3fe
Update disco group list example
thang-bit Jul 24, 2023
0a526ef
Remove observations endpoint
thang-bit Jul 25, 2023
b36bf80
Remove observation models
thang-bit Jul 25, 2023
c4cfb3d
Add java options
thang-bit Jul 26, 2023
7b334ca
Use Azure.Core standard operation and use resource models
thang-bit Aug 3, 2023
8a106c0
Reformat folder structure
thang-bit Aug 4, 2023
4e94ab3
Suppress warnings
thang-bit Aug 4, 2023
160238a
Change metadata to record<unknown>
thang-bit Aug 4, 2023
5fe8b86
Add suppression for Record<unknown>
shadahmed-microsoft Aug 4, 2023
9221caa
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
thang-bit Aug 4, 2023
fc26acf
Merge branch 'Azure:main' into riskiq/Micorosft.Easm/2023-03-01-preview
thang-bit Aug 4, 2023
9fac2ad
Update examples
thang-bit Aug 4, 2023
b34ece5
Merge branch 'riskiq/Micorosft.Easm/2023-03-01-preview' of https://gi…
thang-bit Aug 4, 2023
5557877
Remove unused examples
thang-bit Aug 4, 2023
ca20a80
Change apiversion to apiVersion
thang-bit Aug 4, 2023
b0978c3
Reformat with prettier
thang-bit Aug 4, 2023
cbef843
Use foundations for list operation
thang-bit Aug 7, 2023
045e994
Update examples and list operations
thang-bit Aug 7, 2023
31ec24b
Remove unused minimum set
thang-bit Aug 7, 2023
1f5f162
Update all uuid
thang-bit Aug 7, 2023
dbce1be
Update Assets example
thang-bit Aug 7, 2023
56f411c
Run prettier on Assets_List
thang-bit Aug 7, 2023
53a93f2
update oauth2 definition
shadahmed-microsoft Aug 8, 2023
dd462c8
remove implicitflow model
shadahmed-microsoft Aug 8, 2023
8150801
Update specification/riskiq/Easm/tspconfig.yaml
shadahmed-microsoft Aug 8, 2023
17df78a
Update models.tsp
shadahmed-microsoft Aug 8, 2023
7284ddf
Update routes.tsp
shadahmed-microsoft Aug 8, 2023
b02cb42
Remove typespec-apiview emitter
thang-bit Aug 8, 2023
a16b74d
Merge branch 'riskiq/Micorosft.Easm/2023-03-01-preview' of https://gi…
thang-bit Aug 8, 2023
c989df6
update examples, add client.tsp
shadahmed-microsoft Aug 8, 2023
c6ba52d
run prettier
thang-bit Aug 9, 2023
25b6355
Run prettier on Easm examples
thang-bit Aug 9, 2023
cbe9a65
Update examples, main.tsp. Remove client.tsp
thang-bit Aug 14, 2023
778328a
Add operation id to examples under typespec project
thang-bit Aug 14, 2023
c530976
Add titles to examples
thang-bit Aug 14, 2023
dbc8c10
Reformat typespec files
thang-bit Aug 15, 2023
1682a2a
Update DataConnection validate example
thang-bit Aug 15, 2023
29f776c
Update data connection validation example
thang-bit Aug 15, 2023
6063216
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
thang-bit Aug 15, 2023
b72e315
Update the easm.json file based on tsv tool
thang-bit Aug 15, 2023
22ef6fc
Update swagger file and its examples
thang-bit Aug 16, 2023
eeb7099
Update Easm typespec examples
thang-bit Aug 16, 2023
0d95c60
Update uris in examples
thang-bit Aug 16, 2023
0e79e4f
Update cvss3 name
thang-bit Aug 16, 2023
e8f6c2d
Update cvss3 model with tsp
thang-bit Aug 16, 2023
4d6c0dc
Add totalElements to DiscoGroups, DiscoTemplates, and SavedFilters Li…
thang-bit Aug 30, 2023
28173e5
Run validation for the previous commit
thang-bit Aug 30, 2023
dd50935
Suppress linting rule of typespec generated swagger
thang-bit Sep 13, 2023
2c2e116
Update namespace for dotnet and javascript to the approved namespace
thang-bit Sep 14, 2023
8c04fe6
Update package directory for java sdk from azure-defender-easm to azu…
thang-bit Sep 14, 2023
d744ba8
use AlexaDetails instead of AlexaInfo in java sdk
thang-bit Oct 1, 2023
69990bd
Merge branch 'Azure:main' into riskiq/Micorosft.Easm/2023-03-01-preview
thang-bit Oct 3, 2023
3396b08
Fix git diff issue in Typespec Validation by running npx tsp
thang-bit Oct 3, 2023
320154a
Merge branch 'main' of https://github.com/thang-bit/azure-rest-api-sp…
thang-bit Oct 10, 2023
9ad4542
Remove unused paged result models, add @pagedResult, @nextLink, and @…
thang-bit Oct 10, 2023
9456308
Add decorators to indicate the resource is createOrUpdate or just update
thang-bit Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Assets_GetAssetResource",
"title": "Assets_GetAssetResource",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Assets_ListAssetResource",
"title": "Assets_ListAssetResource",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand All @@ -13,7 +15,7 @@
"body": {
"totalElements": 50000,
"mark": null,
"nextLink": "https://<api-endpoint>/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/workspaces/ThisisaWorkspace/assets?filter=state+%3D+%22confirmed%22&skip=1&maxpagesize=25&api-version=2023-03-01-preview",
"nextLink": "https://eastus.easm.defender.microsoft.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/workspaces/ThisisaWorkspace/assets?filter=state+%3D+%22confirmed%22&skip=1&maxpagesize=25&api-version=2023-03-01-preview",
"value": [
{
"id": "host$$contoso.net",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Assets_UpdateAssets",
"title": "Assets_UpdateAssets",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DataConnections_CreateOrReplaceDataConnection",
"title": "DataConnections_CreateOrReplaceDataConnection",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DataConnections_DeleteDataConnection",
"title": "DataConnections_DeleteDataConnection",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DataConnections_GetDataConnection",
"title": "DataConnections_GetDataConnection",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DataConnections_ListDataConnection",
"title": "DataConnections_ListDataConnection",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand All @@ -9,7 +11,7 @@
"200": {
"body": {
"totalElements": 2,
"nextLink": "https://<api-endpoint>/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/workspaces/ThisisaWorkspace/dataConnections?maxpagesize=25&api-version=2023-03-01-preview",
"nextLink": "https://eastus.easm.defender.microsoft.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/workspaces/ThisisaWorkspace/dataConnections?maxpagesize=25&api-version=2023-03-01-preview",
"value": [
{
"id": "ThisisaDataConnection",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DataConnections_ValidateDataConnection",
"title": "DataConnections_ValidateDataConnection",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryGroups_CreateOrReplaceDiscoGroup",
"title": "DiscoveryGroups_CreateOrReplaceDiscoGroup",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryGroups_GetDiscoGroup",
"title": "DiscoveryGroups_GetDiscoGroup",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryGroups_ListDiscoGroup",
"title": "DiscoveryGroups_ListDiscoGroup",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryGroups_ListRuns",
"title": "DiscoveryGroups_ListRuns",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand All @@ -10,7 +12,7 @@
"200": {
"body": {
"totalElements": 45,
"nextLink": "https://<api-endpoint>/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/workspaces/ThisisaWorkspace/discoGroups/ThisisaDiscoGroup/runs?skip=1&maxpagesize=2&api-version=2023-03-01-preview",
"nextLink": "https://eastus.easm.defender.microsoft.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/workspaces/ThisisaWorkspace/discoGroups/ThisisaDiscoGroup/runs?skip=1&maxpagesize=2&api-version=2023-03-01-preview",
"value": [
{
"submittedDate": "2022-03-29T23:10:01.000+00:00",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryGroups_RunDiscoGroup",
"title": "DiscoveryGroups_RunDiscoGroup",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryGroups_ValidateDiscoGroup",
"title": "DiscoveryGroups_ValidateDiscoGroup",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryTemplates_GetDiscoTemplate",
"title": "DiscoveryTemplates_GetDiscoTemplate",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "DiscoveryTemplates_ListDiscoTemplate",
"title": "DiscoveryTemplates_ListDiscoTemplate",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Reports_GetBillable",
"title": "Reports_GetBillable",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Reports_GetSnapshot",
"title": "Reports_GetSnapshot",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Reports_GetSummary",
"title": "Reports_GetSummary",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "SavedFilters_CreateOrReplaceSavedFilter",
"title": "SavedFilters_CreateOrReplaceSavedFilter",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "SavedFilters_DeleteSavedFilter",
"title": "SavedFilters_DeleteSavedFilter",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "SavedFilters_GetSavedFilter",
"title": "SavedFilters_GetSavedFilter",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "SavedFilters_ListSavedFilter",
"title": "SavedFilters_ListSavedFilter",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"operationId": "Tasks_CancelTask",
"title": "Tasks_CancelTask",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"resourceGroupName": "dummyrg",
"workspaceName": "ThisisaWorkspace",
"taskId": "ThisisaTaskId"
},
"responses": {
"200": {
"body": {
"id": "ThisisaTaskId",
"startedAt": "2022-05-02T19:30:14.432+00:00",
"completedAt": "2022-05-02T19:30:54.432+00:00",
"lastPolledAt": "2022-05-02T19:30:19.432+00:00",
"state": "complete",
"phase": "complete",
"reason": "This is a Task id"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Tasks_GetTask",
"title": "Tasks_GetTask",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"operationId": "Tasks_ListTask",
"title": "Tasks_ListTask",
"parameters": {
"api-version": "2023-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
55 changes: 55 additions & 0 deletions specification/riskiq/Easm/main.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import "@typespec/http";
import "@typespec/rest";
import "@azure-tools/typespec-azure-core";
import "@typespec/versioning";
import "./routes.tsp";
import "./models.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using Azure.Core;
using TypeSpec.Versioning;

@useAuth(
OAuth2Auth<[
{
@doc("implicit flow")
type: OAuth2FlowType.implicit,

@doc("the authorization URL")
authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize",

@doc("list of scopes for the credential")
scopes: ["https://easm.defender.microsoft.com/.default"],
}
]>
)
@versioned(Easm.Versions)
@service({
title: "Defender EASM",
})
@server(
"{endpoint}/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/workspaces/{workspaceName}",
"",
{
@doc("The endpoint hosting the requested resource. For example, https://{region}.easm.defender.microsoft.com")
endpoint: string,

@doc("The ID of the target subscription.")
subscriptionId: string,

@doc("The name of the Resource Group.")
resourceGroupName: string,

@doc("The name of the Workspace.")
workspaceName: string,
}
)
@doc("Defender EASM discovers and maps your digital attack surface to provide an \"outside-in\" perspective using probes to discover assets. The assets are provided with detailed metadata associated, including vulnerabilities, configurations and web components, allowing customers to view and prioritize external risk. The EASM REST API enables you to develop clients that integrate with your application.")
namespace Easm;
@doc("The EASM Defender service version.")
enum Versions {
@doc("Version 2023-03-01-preview")
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
v2023_03_01_preview: "2023-03-01-preview",
}
Loading