Skip to content

Commit

Permalink
Add collection endpoint (#4995)
Browse files Browse the repository at this point in the history
* Add collection endpoint

* Fix model issue

* Run prettier check

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Address PR comments

* Rename common fields

* Add extra fields

* Fix check issues

* Add tenant id

* Run prettier check

* Update specification/apisecurity/resource-manager/Microsoft.ApiSecurity/preview/2021-03-01-preview/apisecurity.json

Co-authored-by: Arcturus <ufo54153@gmail.com>

* Update specification/apisecurity/resource-manager/Microsoft.ApiSecurity/preview/2021-03-01-preview/apisecurity.json

Co-authored-by: Arcturus <ufo54153@gmail.com>

* Update specification/apisecurity/resource-manager/Microsoft.ApiSecurity/preview/2021-03-01-preview/apisecurity.json

Co-authored-by: Arcturus <ufo54153@gmail.com>

* Update specification/apisecurity/resource-manager/Microsoft.ApiSecurity/preview/2021-03-01-preview/apisecurity.json

Co-authored-by: Arcturus <ufo54153@gmail.com>

* Address PR comments

* Address PR comments

* Address PR comments

Co-authored-by: Arcturus <ufo54153@gmail.com>
  • Loading branch information
nasimkhli and ArcturusZhang committed Oct 15, 2021
1 parent 86fd958 commit 35d4710
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 0 deletions.
Expand Up @@ -291,6 +291,125 @@
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.ApiSecurity/collections": {
"get": {
"tags": [
"ApiSecurityCollection"
],
"operationId": "ApiSecurityCollections_List",
"description": "Get collections.",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"name": "tenantId",
"in": "query",
"required": false,
"type": "string",
"description": "The tenantId of the collection output."
},
{
"name": "pageSize",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"description": "The pageSize of the collection output."
},
{
"name": "skip",
"in": "query",
"required": false,
"type": "integer",
"format": "int32",
"description": "The number of collection output needs to be skipped.",
"x-ms-skip-url-encoding": true
},
{
"name": "x-ms-continuation",
"in": "header",
"required": false,
"type": "string",
"description": "The database continuation token."
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ApiCollectionList"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"Collections_Get_MaximumSet_Gen": {
"$ref": "./examples/Collections_Get_MaximumSet_Gen.json"
},
"Collections_Get_MinimumSet_Gen": {
"$ref": "./examples/Collections_Get_MinimumSet_Gen.json"
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.ApiSecurity/collections/{collectionName}": {
"get": {
"tags": [
"ApiSecurityCollection"
],
"operationId": "ApiSecurityCollections_Get",
"description": "Get a specific collection by name",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"name": "collectionName",
"in": "path",
"required": true,
"type": "string",
"description": "name of the collection."
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CollectionDocument"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"CollectionByName_Get_MaximumSet_Gen": {
"$ref": "./examples/CollectionByName_Get_MaximumSet_Gen.json"
},
"CollectionByName_Get_MinimumSet_Gen": {
"$ref": "./examples/CollectionByName_Get_MinimumSet_Gen.json"
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -338,6 +457,126 @@
}
},
"description": "The response of the List DefenderSetting operation"
},
"ApiCollectionList": {
"type": "object",
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/CollectionDocument"
}
},
"nextLink": {
"type": "string",
"description": "Link to the next set of results."
},
"totalApiCollectionsCount": {
"type": "integer",
"format": "int32"
},
"totalApiEndpointsCount": {
"type": "integer",
"format": "int32"
},
"totalKubernetesClustersCount": {
"type": "integer",
"format": "int32"
},
"totalShadowApiEndpointsCount": {
"type": "integer",
"format": "int32"
},
"continuationToken": {
"type": "string"
}
}
},
"CollectionDocument": {
"type": "object",
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/CollectionDocumentProperties",
"description": "The collection documents properties."
},
"id": {
"type": "string",
"readOnly": true
},
"name": {
"type": "string",
"readOnly": true
},
"type": {
"type": "string",
"readOnly": true
},
"systemData": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData",
"readOnly": true,
"description": "The system metadata relating to this resource."
}
},
"description": "collections",
"x-ms-azure-resource": false
},
"CollectionDocumentProperties": {
"type": "object",
"properties": {
"accountId": {
"type": "string",
"readOnly": true,
"description": "The accountId."
},
"subscriptionId": {
"type": "string",
"readOnly": true,
"description": "The subscriptionId."
},
"collectionId": {
"type": "string",
"readOnly": true,
"description": "The collectionId."
},
"collectionName": {
"type": "string",
"readOnly": true,
"description": "The collectionName."
},
"userFriendlyCollectionName": {
"type": "string",
"readOnly": true,
"description": "The userFriendlyCollectionName."
},
"uriPath": {
"type": "string",
"readOnly": true,
"description": "The uriPath."
},
"hostingEnvironment": {
"type": "string",
"readOnly": true,
"description": "The hostingEnvironment."
},
"apiEndpointActivity": {
"type": "string",
"readOnly": true,
"description": "The apiEndpointActivity."
},
"numberOfApiEndpoints": {
"type": "integer",
"format": "int32",
"readOnly": true,
"description": "The numberOfApiEndpoints."
},
"apiDocumentationFound": {
"type": "boolean",
"readOnly": true,
"description": "The apiDocumentationFound."
}
},
"description": "The collection documents properties."
}
},
"parameters": {
Expand Down
@@ -0,0 +1,36 @@
{
"parameters": {
"api-version": "2021-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"collectionName": "testcollectionname"
},
"responses": {
"200": {
"body": {
"properties": {
"accountId": "123",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"collectionId": "1",
"collectionName": "testname",
"userFriendlyCollectionName": "testfriendlyname",
"uriPath": "test.com",
"hostingEnvironment": "testenv",
"apiEndpointActivity": "Active",
"numberOfApiEndpoints": 12,
"apiDocumentationFound": true
},
"id": "1234",
"name": "apisecurity",
"type": "Microsoft.ApiSecurity/collections",
"systemData": {
"createdBy": "user1",
"createdByType": "User",
"createdAt": "2021-10-08T03:33:30.289Z",
"lastModifiedBy": "user1",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-10-08T03:33:30.289Z"
}
}
}
}
}
@@ -0,0 +1,12 @@
{
"parameters": {
"api-version": "2021-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"collectionName": "testcollectionname"
},
"responses": {
"200": {
"body": {}
}
}
}
@@ -0,0 +1,49 @@
{
"parameters": {
"api-version": "2021-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"tenantId": "2468",
"pageSize": 20,
"skip": 40,
"x-ms-continuation": ""
},
"responses": {
"200": {
"body": {
"value": [
{
"properties": {
"accountId": "123",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"collectionId": "12345",
"collectionName": "testcollectionname",
"userFriendlyCollectionName": "testuserfriendlyname",
"uriPath": "test.com",
"hostingEnvironment": "testenv",
"apiEndpointActivity": "Active",
"numberOfApiEndpoints": 12,
"apiDocumentationFound": true
},
"id": "1234",
"name": "apisecurity",
"type": "Microsoft.ApiSecurity/collections",
"systemData": {
"createdBy": "user1",
"createdByType": "User",
"createdAt": "2021-10-08T03:33:30.289Z",
"lastModifiedBy": "user1",
"lastModifiedByType": "User",
"lastModifiedAt": "2021-10-08T03:33:30.289Z"
}
}
],
"nextLink": "",
"totalApiCollectionsCount": 7,
"totalApiEndpointsCount": 3,
"totalKubernetesClustersCount": 4,
"totalShadowApiEndpointsCount": 30,
"continuationToken": ""
}
}
}
}
@@ -0,0 +1,11 @@
{
"parameters": {
"api-version": "2021-03-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {}
}
}
}

0 comments on commit 35d4710

Please sign in to comment.