Skip to content

Commit

Permalink
Add get-package-stats spec for /epm/packages/{pkgName}/stats endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Jul 22, 2021
1 parent a974371 commit 7d98448
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 0 deletions.
54 changes: 54 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,48 @@
}
]
}
},
"/epm/packages/{pkgName}/stats": {
"get": {
"summary": "Get stats for a package",
"tags": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"response": {
"$ref": "#/components/schemas/package_usage_stats"
}
},
"required": [
"response"
]
}
}
}
}
},
"operationId": "get-package-stats",
"security": [
{
"basicAuth": []
}
]
},
"parameters": [
{
"schema": {
"type": "string"
},
"name": "pkgName",
"in": "path",
"required": true
}
]
}
},
"components": {
Expand Down Expand Up @@ -2389,6 +2431,18 @@
"$ref": "#/components/schemas/new_package_policy"
}
]
},
"package_usage_stats": {
"title": "Package usage stats",
"type": "object",
"properties": {
"agent_policy_count": {
"type": "integer"
}
},
"required": [
"agent_policy_count"
]
}
}
},
Expand Down
33 changes: 33 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,31 @@ paths:
- sucess
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
'/epm/packages/{pkgName}/stats':
get:
summary: Get stats for a package
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
response:
$ref: '#/components/schemas/package_usage_stats'
required:
- response
operationId: get-package-stats
security:
- basicAuth: []
parameters:
- schema:
type: string
name: pkgName
in: path
required: true
components:
securitySchemes:
basicAuth:
Expand Down Expand Up @@ -1502,5 +1527,13 @@ components:
version:
type: string
- $ref: '#/components/schemas/new_package_policy'
package_usage_stats:
title: Package usage stats
type: object
properties:
agent_policy_count:
type: integer
required:
- agent_policy_count
security:
- basicAuth: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Package usage stats
type: object
properties:
agent_policy_count:
type: integer
required:
- agent_policy_count
2 changes: 2 additions & 0 deletions x-pack/plugins/fleet/common/openapi/entrypoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ paths:
$ref: paths/package_policies@delete.yaml
'/package_policies/{packagePolicyId}':
$ref: 'paths/package_policies@{package_policy_id}.yaml'
'/epm/packages/{pkgName}/stats':
$ref: 'paths/epm@packages@{pkg_name}@stats.yaml'
components:
securitySchemes:
basicAuth:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
get:
summary: Get stats for a package
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
response:
$ref: ../components/schemas/package_usage_stats.yaml
required:
- response
operationId: get-package-stats
security:
- basicAuth: []
parameters:
- schema:
type: string
name: pkgName
in: path
required: true

0 comments on commit 7d98448

Please sign in to comment.