From 214f0935c009bce3af27080af77aea21bb59a6d1 Mon Sep 17 00:00:00 2001 From: Runbo Zhao Date: Thu, 7 Jul 2022 01:15:10 -0700 Subject: [PATCH] network discovery public api --- static/oas/iot/api/public/ndEndpoint.yaml | 48 +++++++++++++++ static/oas/iot/api/public/ndGraphUpdate.yaml | 47 +++++++++++++++ static/oas/iot/api/public/ndL2L3Update.yaml | 47 +++++++++++++++ static/oas/iot/components/examples.yaml | 26 ++++++++ static/oas/iot/components/schemas.yaml | 62 +++++++++++++++++++- static/oas/iot/iot.yaml | 47 +++++++++++++++ 6 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 static/oas/iot/api/public/ndEndpoint.yaml create mode 100644 static/oas/iot/api/public/ndGraphUpdate.yaml create mode 100644 static/oas/iot/api/public/ndL2L3Update.yaml diff --git a/static/oas/iot/api/public/ndEndpoint.yaml b/static/oas/iot/api/public/ndEndpoint.yaml new file mode 100644 index 00000000..993f907a --- /dev/null +++ b/static/oas/iot/api/public/ndEndpoint.yaml @@ -0,0 +1,48 @@ +parameters: +- description: The customer ID to which the API call is directed + in: query + name: customerid + required: true + schema: + type: string +requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary +responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/NetworkDiscoveryEndpointUpdateResponseSchema' + examples: + resolveSecurityAlertResponseExample: + $ref: '../../components/examples.yaml#/examples/NetworkDiscoveryEndpointUpdateResponseExample: +' + '4XX': + description: Client Error Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/ErrorResponse' + examples: + Bad Request: + $ref: '../../components/examples.yaml#/examples/BadRequestResponseExample' + Unauthrorized Request: + $ref: '../../components/examples.yaml#/examples/UnauthorizedResponseExample' + '5XX': + description: Server Error Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/ErrorResponse' + examples: + resolveSecurityAlertResponseExample: + $ref: '../../components/examples.yaml#/examples/ServerErrorResponseExample' \ No newline at end of file diff --git a/static/oas/iot/api/public/ndGraphUpdate.yaml b/static/oas/iot/api/public/ndGraphUpdate.yaml new file mode 100644 index 00000000..dbdeb3e6 --- /dev/null +++ b/static/oas/iot/api/public/ndGraphUpdate.yaml @@ -0,0 +1,47 @@ +parameters: +- description: The customer ID to which the API call is directed + in: query + name: customerid + required: true + schema: + type: string +requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary +responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/NetworkDiscoveryGraphUpdateResponseSchema' + examples: + resolveSecurityAlertResponseExample: + $ref: '../../components/examples.yaml#/examples/NetworkDiscoveryGraphUpdateResponseExample' + '4XX': + description: Client Error Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/ErrorResponse' + examples: + Bad Request: + $ref: '../../components/examples.yaml#/examples/BadRequestResponseExample' + Unauthrorized Request: + $ref: '../../components/examples.yaml#/examples/UnauthorizedResponseExample' + '5XX': + description: Server Error Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/ErrorResponse' + examples: + resolveSecurityAlertResponseExample: + $ref: '../../components/examples.yaml#/examples/ServerErrorResponseExample' \ No newline at end of file diff --git a/static/oas/iot/api/public/ndL2L3Update.yaml b/static/oas/iot/api/public/ndL2L3Update.yaml new file mode 100644 index 00000000..dbdeb3e6 --- /dev/null +++ b/static/oas/iot/api/public/ndL2L3Update.yaml @@ -0,0 +1,47 @@ +parameters: +- description: The customer ID to which the API call is directed + in: query + name: customerid + required: true + schema: + type: string +requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary +responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/NetworkDiscoveryGraphUpdateResponseSchema' + examples: + resolveSecurityAlertResponseExample: + $ref: '../../components/examples.yaml#/examples/NetworkDiscoveryGraphUpdateResponseExample' + '4XX': + description: Client Error Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/ErrorResponse' + examples: + Bad Request: + $ref: '../../components/examples.yaml#/examples/BadRequestResponseExample' + Unauthrorized Request: + $ref: '../../components/examples.yaml#/examples/UnauthorizedResponseExample' + '5XX': + description: Server Error Response + content: + application/json: + schema: + $ref: '../../components/schemas.yaml#/schemas/ErrorResponse' + examples: + resolveSecurityAlertResponseExample: + $ref: '../../components/examples.yaml#/examples/ServerErrorResponseExample' \ No newline at end of file diff --git a/static/oas/iot/components/examples.yaml b/static/oas/iot/components/examples.yaml index 7a144135..c6035152 100644 --- a/static/oas/iot/components/examples.yaml +++ b/static/oas/iot/components/examples.yaml @@ -725,4 +725,30 @@ examples: ] } ] + } + + NetworkDiscoveryGraphUpdateResponseExample: + value: { + api: "/network/ndNodeGraphBulkUpdate", + ver: "v4.0", + message: "success", + updatedNodes: 0 + } + + NetworkDiscoveryL2L3UpdateResponseExample: + value: { + api: "/network/ndNodeL2L3BulkUpdate", + ver: "v4.0", + message: "success", + updatedInterface: 2, + updatedSubnet: 2, + updatedDevice: 1 + } + + NetworkDiscoveryEndpointUpdateResponseExample: + value: { + api: "/network/ndNodeEndpointBulkUpdate", + ver: "v4.0", + message: "success", + updatedNodeEndpoints: 4 } \ No newline at end of file diff --git a/static/oas/iot/components/schemas.yaml b/static/oas/iot/components/schemas.yaml index 7e31bef3..b836fb89 100644 --- a/static/oas/iot/components/schemas.yaml +++ b/static/oas/iot/components/schemas.yaml @@ -901,4 +901,64 @@ schemas: description: List of firewalls that enforce the policy rule deviceGroups: type: array - description: (Panorama) List of device groups containing firewalls that enforce the policy rule \ No newline at end of file + description: (Panorama) List of device groups containing firewalls that enforce the policy rule + + NetworkDiscoveryGraphUpdateResponseSchema: + type: object + properties: + api: + type: string + description: API path + ver: + type: string + description: API version + message: + type: string + description: successful message + updatedNodes: + type: integer + description: number of graph node updated + + NetworkDiscoveryL2L3UpdateResponseSchema: + type: object + properties: + api: + type: string + description: API path + ver: + type: string + description: API version + message: + type: string + description: successful message + updatedInterface: + type: integer + description: number of interface updated + updatedSubnet: + type: integer + description: number of subnet updated + updatedDevice: + type: integer + description: number of device updated + + NetworkDiscoveryEndpointUpdateResponseSchema: + type: object + properties: + api: + type: string + description: API path + ver: + type: string + description: API version + message: + type: string + description: successful message + updatedInterface: + type: integer + description: number of interface updated + updatedSubnet: + type: integer + description: number of subnet updated + updatedDevice: + type: integer + description: number of device updated \ No newline at end of file diff --git a/static/oas/iot/iot.yaml b/static/oas/iot/iot.yaml index 54c3b1bf..f2924b2b 100644 --- a/static/oas/iot/iot.yaml +++ b/static/oas/iot/iot.yaml @@ -301,6 +301,53 @@ paths: responses: $ref: 'api/public/policyRecommendation.yaml#/responses' + /pub/v4.0/network/ndNodeGraphBulkUpdate: + put: + description: 'Update node graphs lldp, cdp neighbors' + operationId: network-discovery + security: + - X-Key-Id: [] + X-Access-Key: [] + summary: Network Discovery - Graph Update + tags: + - IoT Public API + parameters: + $ref: 'api/public/ndGraphUpdate.yaml#/parameters' + responses: + $ref: 'api/public/ndGraphUpdate.yaml#/responses' + + /pub/v4.0/network/ndNodeL2L3BulkUpdate: + put: + description: 'Update Nodes vlan, interface and subnet data' + operationId: network-discovery + security: + - X-Key-Id: [] + X-Access-Key: [] + summary: Network Discovery - Detail Update + tags: + - IoT Public API + parameters: + $ref: 'api/public/ndL2L3Update.yaml#/parameters' + responses: + $ref: 'api/public/ndL2L3Update.yaml#/responses' + + /pub/v4.0/network/ndNodeEndpointBulkUpdate: + put: + description: 'Update Node endpoint data' + operationId: network-discovery + security: + - X-Key-Id: [] + X-Access-Key: [] + summary: Network Discovery - Endpoint Update + tags: + - IoT Public API + parameters: + $ref: 'api/public/ndEndpoint.yaml#/parameters' + responses: + $ref: 'api/public/ndEndpoint.yaml#/responses' + + + components: securitySchemes: $ref: 'components/securitySchemes.yaml#/securitySchemes' \ No newline at end of file