Skip to content

Commit

Permalink
/agents returns Agent[] not AgentPolicy[] (#105814)
Browse files Browse the repository at this point in the history
Fix the typo in #105679 which indicates `/agents` returns a list of agent policy objects instead of the correct list of agents.

diff from `/paths/agents.yaml`
```diff
-                  $ref: ../components/schemas/agent_policy.yaml
+                  $ref: ../components/schemas/agent.yaml
```

<details><summary>screenshot - before</summary>
<img width="1293" alt="Screen Shot 2021-07-15 at 12 39 14 PM" src="https://user-images.githubusercontent.com/57655/125829619-ddbd74f4-8806-45c4-af94-4b7645e2dc9b.png">
</details>

<details><summary>screenshot - after</summary>
<img width="1302" alt="Screen Shot 2021-07-15 at 12 39 33 PM" src="https://user-images.githubusercontent.com/57655/125829622-2715d071-14ee-4a2d-9ff5-96ece4eea682.png">
</details>
  • Loading branch information
John Schulz authored Jul 15, 2021
1 parent cba23c1 commit c9e11e0
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 156 deletions.
180 changes: 90 additions & 90 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
"list": {
"type": "array",
"items": {
"$ref": "#/components/schemas/agent_policy"
"$ref": "#/components/schemas/agent"
}
},
"total": {
Expand Down Expand Up @@ -1570,6 +1570,95 @@
}
]
},
"agent_type": {
"type": "string",
"title": "AgentType",
"enum": [
"PERMANENT",
"EPHEMERAL",
"TEMPORARY"
]
},
"agent_metadata": {
"title": "AgentMetadata",
"type": "object"
},
"agent_status": {
"type": "string",
"title": "AgentStatus",
"enum": [
"offline",
"error",
"online",
"inactive",
"warning"
]
},
"agent": {
"title": "Agent",
"type": "object",
"properties": {
"type": {
"$ref": "#/components/schemas/agent_type"
},
"active": {
"type": "boolean"
},
"enrolled_at": {
"type": "string"
},
"unenrolled_at": {
"type": "string"
},
"unenrollment_started_at": {
"type": "string"
},
"shared_id": {
"type": "string",
"deprecated": true
},
"access_api_key_id": {
"type": "string"
},
"default_api_key_id": {
"type": "string"
},
"policy_id": {
"type": "string"
},
"policy_revision": {
"type": "number"
},
"last_checkin": {
"type": "string"
},
"user_provided_metadata": {
"$ref": "#/components/schemas/agent_metadata"
},
"local_metadata": {
"$ref": "#/components/schemas/agent_metadata"
},
"id": {
"type": "string"
},
"access_api_key": {
"type": "string"
},
"status": {
"$ref": "#/components/schemas/agent_status"
},
"default_api_key": {
"type": "string"
}
},
"required": [
"type",
"active",
"enrolled_at",
"id",
"status"
]
},
"upgrade_agent": {
"title": "UpgradeAgent",
"oneOf": [
Expand Down Expand Up @@ -1921,95 +2010,6 @@
"path"
]
},
"agent_type": {
"type": "string",
"title": "AgentType",
"enum": [
"PERMANENT",
"EPHEMERAL",
"TEMPORARY"
]
},
"agent_metadata": {
"title": "AgentMetadata",
"type": "object"
},
"agent_status": {
"type": "string",
"title": "AgentStatus",
"enum": [
"offline",
"error",
"online",
"inactive",
"warning"
]
},
"agent": {
"title": "Agent",
"type": "object",
"properties": {
"type": {
"$ref": "#/components/schemas/agent_type"
},
"active": {
"type": "boolean"
},
"enrolled_at": {
"type": "string"
},
"unenrolled_at": {
"type": "string"
},
"unenrollment_started_at": {
"type": "string"
},
"shared_id": {
"type": "string",
"deprecated": true
},
"access_api_key_id": {
"type": "string"
},
"default_api_key_id": {
"type": "string"
},
"policy_id": {
"type": "string"
},
"policy_revision": {
"type": "number"
},
"last_checkin": {
"type": "string"
},
"user_provided_metadata": {
"$ref": "#/components/schemas/agent_metadata"
},
"local_metadata": {
"$ref": "#/components/schemas/agent_metadata"
},
"id": {
"type": "string"
},
"access_api_key": {
"type": "string"
},
"status": {
"$ref": "#/components/schemas/agent_status"
},
"default_api_key": {
"type": "string"
}
},
"required": [
"type",
"active",
"enrolled_at",
"id",
"status"
]
},
"update_package_policy": {
"title": "UpdatePackagePolicy",
"allOf": [
Expand Down
130 changes: 65 additions & 65 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ paths:
list:
type: array
items:
$ref: '#/components/schemas/agent_policy'
$ref: '#/components/schemas/agent'
total:
type: number
page:
Expand Down Expand Up @@ -980,6 +980,70 @@ components:
required:
- id
- status
agent_type:
type: string
title: AgentType
enum:
- PERMANENT
- EPHEMERAL
- TEMPORARY
agent_metadata:
title: AgentMetadata
type: object
agent_status:
type: string
title: AgentStatus
enum:
- offline
- error
- online
- inactive
- warning
agent:
title: Agent
type: object
properties:
type:
$ref: '#/components/schemas/agent_type'
active:
type: boolean
enrolled_at:
type: string
unenrolled_at:
type: string
unenrollment_started_at:
type: string
shared_id:
type: string
deprecated: true
access_api_key_id:
type: string
default_api_key_id:
type: string
policy_id:
type: string
policy_revision:
type: number
last_checkin:
type: string
user_provided_metadata:
$ref: '#/components/schemas/agent_metadata'
local_metadata:
$ref: '#/components/schemas/agent_metadata'
id:
type: string
access_api_key:
type: string
status:
$ref: '#/components/schemas/agent_status'
default_api_key:
type: string
required:
- type
- active
- enrolled_at
- id
- status
upgrade_agent:
title: UpgradeAgent
oneOf:
Expand Down Expand Up @@ -1212,70 +1276,6 @@ components:
- format_version
- download
- path
agent_type:
type: string
title: AgentType
enum:
- PERMANENT
- EPHEMERAL
- TEMPORARY
agent_metadata:
title: AgentMetadata
type: object
agent_status:
type: string
title: AgentStatus
enum:
- offline
- error
- online
- inactive
- warning
agent:
title: Agent
type: object
properties:
type:
$ref: '#/components/schemas/agent_type'
active:
type: boolean
enrolled_at:
type: string
unenrolled_at:
type: string
unenrollment_started_at:
type: string
shared_id:
type: string
deprecated: true
access_api_key_id:
type: string
default_api_key_id:
type: string
policy_id:
type: string
policy_revision:
type: number
last_checkin:
type: string
user_provided_metadata:
$ref: '#/components/schemas/agent_metadata'
local_metadata:
$ref: '#/components/schemas/agent_metadata'
id:
type: string
access_api_key:
type: string
status:
$ref: '#/components/schemas/agent_status'
default_api_key:
type: string
required:
- type
- active
- enrolled_at
- id
- status
update_package_policy:
title: UpdatePackagePolicy
allOf:
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/openapi/paths/agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ get:
list:
type: array
items:
$ref: ../components/schemas/agent_policy.yaml
$ref: ../components/schemas/agent.yaml
total:
type: number
page:
Expand Down

0 comments on commit c9e11e0

Please sign in to comment.