[XAPID-377] Updated swagger.yaml
diff --git a/api.yaml b/api.yaml
new file mode 100644
index 0000000..333bbc2
--- /dev/null
+++ b/api.yaml
@@ -0,0 +1,138 @@
+swagger: "2.0"
+info:
+ version: "v1"
+ title: APID analytics API
+host: playground.apistudio.io
+basePath: /try/64e409ad-aebb-4bbc-977e-f0e0f22209d4
+schemes:
+ - http
+ - https
+consumes:
+ - application/json
+produces:
+ - application/json
+paths:
+ '/analytics/{bundle_scope_uuid}':
+ x-swagger-router-controller: analytics
+ parameters:
+ - name: bundle_scope_uuid
+ in: path
+ required: true
+ description: bundle UUID that can be mapped to a scope by APID
+ type: string
+ - name: analytics_data
+ in: body
+ description: The analytics data you want to post
+ required: true
+ schema:
+ $ref: "#/definitions/records"
+ post:
+ responses:
+ "200":
+ description: Success
+ "400":
+ description: Bad Request
+ schema:
+ $ref: "#/definitions/errClientError"
+ "500":
+ description: Server error
+ schema:
+ $ref: "#/definitions/errServerError"
+ default:
+ description: Error
+ schema:
+ $ref: "#/definitions/errResponse"
+
+definitions:
+ records:
+ type: object
+ required:
+ - records
+ properties:
+ records:
+ type: array
+ minItems: 1
+ items:
+ $ref: "#/definitions/eachRecord"
+ example: {
+ "records":[{
+ "response_status_code": 400,
+ "client_received_start_timestamp": 1462850097576,
+ "client_id":"0GJKn7EQmNkKYcGL7x3gHaawWLs5gUPr"
+ },{
+ "response_status_code": 200,
+ "client_id":"2ngXgr6Rl2PXWiEmbt8zCkWY3Ptjb8ep",
+ "request_verb" : "GET",
+ "api_product":" test_product",
+ "access_token" : "fewGWG343LDV346345YCDS",
+ "apiproxy" : "OAuthProxy",
+ "apiproxy_revision" : "2",
+ "client_ip": "10.16.9.11",
+ "client_sent_end_timestamp": 1462850097894,
+ "client_received_start_timestamp": 1462850097576,
+ "client_received_end_timestamp": 1462850097580,
+ "client_sent_start_timestamp": 1462850097894,
+ "request_path" : "/oauth/oauthv2/auth_code/",
+ "request_uri": "/oauth/oauthv2/auth_code/?response_type=code&redirect_url=http%3A%2F%2Fexample.com&client_id=A1h6yYAVeADnEKji8M37zCSn6olcmQDB",
+ "useragent" : "Chrome",
+ "target" : "target_name",
+ "target_received_end_timestamp": 1462850097800,
+ "target_received_start_timestamp": 1462850097800,
+ "target_response_code" : 200,
+ "target_sent_end_timestamp" : 1462850097802,
+ "target_sent_start_timestamp" : 1462850097802
+ }]
+ }
+
+ eachRecord:
+ description: Each record is basically a map of key value pair. client_received_start_timestamp is a required property but more fields can be added
+ type: object
+ required:
+ - client_received_start_timestamp
+ properties:
+ client_received_start_timestamp:
+ type: integer
+ format: int64
+ example: {
+ "response_status_code":400,
+ "client_received_start_timestamp":1462850097576,
+ "client_id":"0GJKn7EQmNkKYcGL7x3gHaawWLs5gUPr"
+ }
+
+ errClientError:
+ required:
+ - errrorCode
+ - reason
+ properties:
+ errrorCode:
+ type: string
+ reason:
+ type: string
+ example: {
+ "errrorCode":"UNKNOWN_SCOPE",
+ "reason":"No tenant found for this scopeuuid : UUID"
+ }
+
+ errServerError:
+ required:
+ - errrorCode
+ - reason
+ properties:
+ errrorCode:
+ type: string
+ reason:
+ type: string
+ example: {
+ "errrorCode":"INTERNAL_SERVER_ERROR",
+ "reason":"Service is not initialized completely"
+ }
+
+ errResponse:
+ required:
+ - errrorCode
+ - reason
+ properties:
+ errrorCode:
+ type: string
+ reason:
+ type: string
\ No newline at end of file
diff --git a/swagger.yaml b/swagger.yaml
deleted file mode 100644
index c877b84..0000000
--- a/swagger.yaml
+++ /dev/null
@@ -1,126 +0,0 @@
-swagger: "2.0"
-info:
- version: "v1"
- title: Swagger API
-host: playground.apistudio.io
-basePath: /try/64e409ad-aebb-4bbc-977e-f0e0f22209d4
-schemes:
- - http
- - https
-consumes:
- - application/json
-produces:
- - application/json
-paths:
- '/analytics/{bundle_scope_uuid}':
- x-swagger-router-controller: analytics
- parameters:
- - name: bundle_scope_uuid
- in: path
- required: true
- description: bundle UUID that can be mapped to a scope by APID
- type: string
- - name: analytics_data
- in: body
- description: The analytics data you want to post
- required: true
- schema:
- $ref: "#/definitions/records"
- post:
- responses:
- "200":
- description: Success
- default:
- description: Error
- schema:
- $ref: "#/definitions/errResponse"
-
-definitions:
- records:
- type: array
- minItems: 1
- items:
- $ref: "#/definitions/eachRecord"
-
- eachRecord:
- type: object
- required:
- - access_token
- - apiproxy
- - apiproxy_revision
- - client_id
- - client_ip
- - client_received_end_timestamp
- - client_received_start_timestamp
- - client_sent_end_timestamp
- - client_sent_start_timestamp
- - request_path
- - request_uri
- - request_verb
- - response_status_code
- - useragent
- - target
- - target_received_end_timestamp
- - target_received_start_timestamp
- - target_response_code
- - target_sent_end_timestamp
- - target_sent_start_timestamp
- properties:
- access_token:
- type: string
- apiproxy:
- type: string
- apiproxy_revision:
- type: string
- client_id:
- type: string
- client_ip:
- type: string
- client_received_end_timestamp:
- type: integer
- format: int64
- client_received_start_timestamp:
- type: integer
- format: int64
- client_sent_end_timestamp:
- type: integer
- format: int64
- client_sent_start_timestamp:
- type: integer
- format: int64
- request_path:
- type: string
- request_uri:
- type: string
- request_verb:
- type: string
- response_status_code:
- type: integer
- useragent:
- type: string
- target:
- type: string
- target_received_end_timestamp:
- type: integer
- format: int64
- target_received_start_timestamp:
- type: integer
- format: int64
- target_response_code:
- type: integer
- target_sent_end_timestamp:
- type: integer
- format: int64
- target_sent_start_timestamp:
- type: integer
- format: int64
-
- errResponse:
- required:
- - errrorCode
- - reason
- properties:
- errrorCode:
- type: string
- reason:
- type: string
\ No newline at end of file