Skip to content

Commit

Permalink
Merge pull request #398 from RedHatInsights/create-pull-request/patch
Browse files Browse the repository at this point in the history
Syncing API
  • Loading branch information
fhlavac authored Sep 25, 2024
2 parents 6003204 + 8e7ca3f commit 76f1803
Show file tree
Hide file tree
Showing 9 changed files with 481 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7936,7 +7936,7 @@
"Purge": {
"properties": {
"finished_before": {
"default": "2024-08-12",
"default": "2024-08-25",
"description": "Purge tasks completed earlier than this timestamp. Format '%Y-%m-%d[T%H:%M:%S]'",
"format": "date-time",
"type": "string"
Expand Down
113 changes: 108 additions & 5 deletions packages/common/config/apis/hcc-insights/export-service/content.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
"openapi": {
"components": {
"schemas": {
"ErrorResponse": {
"properties": {
"code": {
"example": 12345,
"type": "integer"
},
"message": {
"example": "Something went wrong",
"type": "string"
}
},
"type": "object"
},
"Export": {
"allOf": [
{
Expand Down Expand Up @@ -243,6 +256,7 @@
"paths": {
"/exports": {
"get": {
"description": "Provides a list of export requests and the resolution status of each request. Use this endpoint to review all of the export requests that the user has requested.",
"operationId": "getExports",
"parameters": [
{
Expand Down Expand Up @@ -336,15 +350,27 @@
}
},
"description": "Matching Exports"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Unexpected server side error"
}
},
"security": [
{
"3ScaleIdentity": []
}
]
],
"summary": "List the export requests"
},
"post": {
"description": "Creates a new export request. Use this endpoint to create an export request that will call the solicited services so that the services can gather the requested data.",
"operationId": "createExport",
"requestBody": {
"content": {
Expand All @@ -365,17 +391,39 @@
}
},
"description": "Export scheduled"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": ""
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": ""
}
},
"security": [
{
"3ScaleIdentity": []
}
]
],
"summary": "Create a new export request"
}
},
"/exports/{id}": {
"delete": {
"description": "Delete the specified export request. Use this endpoint to delete available export requests.",
"operationId": "deleteExport",
"parameters": [
{
Expand All @@ -390,15 +438,47 @@
"responses": {
"202": {
"description": "Export deleted (if it existed)"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Not a valid export UUID"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Record not found"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Error deleting payload entry"
}
},
"security": [
{
"3ScaleIdentity": []
}
]
],
"summary": "Delete an existing export request"
},
"get": {
"description": "Download the exported data from the specified export request. When the export request is ready, use this endpoint to download the exported data.",
"operationId": "downloadExport",
"parameters": [
{
Expand All @@ -421,17 +501,29 @@
}
},
"description": "Export data"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Not ready for download"
}
},
"security": [
{
"3ScaleIdentity": []
}
]
],
"summary": "Download the exported data"
}
},
"/exports/{id}/status": {
"get": {
"description": "Check the status of the specified export request. Use this endpoint to check the status of an export request.",
"operationId": "getExportStatus",
"parameters": [
{
Expand All @@ -453,13 +545,24 @@
}
},
"description": "Export status"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Unexpected server side error"
}
},
"security": [
{
"3ScaleIdentity": []
}
]
],
"summary": "Check the status of the export request"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1793,13 +1793,14 @@
"type": "string"
},
"User": {
"description": "At least one of password, ssh_key must be set, validator takes care of it.\nOn update empty string can be used to remove password or ssh_key,\nbut at least one of them still must be present.\n",
"properties": {
"name": {
"example": "user1",
"type": "string"
},
"password": {
"description": "Plaintext passwords are also supported, they will be hashed and stored using the SHA-512 algorithm.\n",
"description": "Plaintext passwords are also supported, they will be hashed and stored using the SHA-512 algorithm.\nThe password is never returned in the response.\nEmpty string can be used to remove the password during update but only with ssh_key set.\n",
"example": "$6$G91SvTj7uVp3xhqj$zVa8nqnJTlewniDII5dmvsBJnj3kloL3CXWdPDu9.e677VoRQd5zB6GKwkDvfGLoRR7NTl5nXLnJywk6IPIvS.",
"format": "password",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@
},
{
"$ref": "#/components/schemas/WebhookPropertiesDTO"
},
{
"$ref": "#/components/schemas/PagerDutyPropertiesDTO"
}
],
"type": "object"
Expand Down Expand Up @@ -740,7 +743,8 @@
"camel",
"drawer",
"email_subscription",
"webhook"
"webhook",
"pagerduty"
],
"type": "string"
},
Expand Down Expand Up @@ -1362,6 +1366,31 @@
],
"type": "object"
},
"PagerDutyPropertiesDTO": {
"properties": {
"secretToken": {
"maxLength": 32,
"type": "string"
},
"severity": {
"$ref": "#/components/schemas/PagerDutySeverity"
}
},
"required": [
"severity",
"secretToken"
],
"type": "object"
},
"PagerDutySeverity": {
"enum": [
"critical",
"error",
"warning",
"info"
],
"type": "string"
},
"RenderEmailTemplateRequest": {
"properties": {
"payload": {
Expand Down
51 changes: 51 additions & 0 deletions packages/common/config/apis/hcc-insights/inventory/content.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,16 @@
"$ref": "#/components/schemas/NonStrictUUID",
"description": "A durable and reliable platform-wide group identifier. Applications should use this identifier to reference hosts."
},
"HostIdOut": {
"description": "A single Host ID that belongs to a host.",
"properties": {
"id": {
"$ref": "#/components/schemas/HostId"
}
},
"title": "A Host ID query result",
"type": "object"
},
"HostIds": {
"description": "A comma-separated list of host IDs that belong to the group.",
"items": {
Expand Down Expand Up @@ -3249,6 +3259,47 @@
]
}
},
"/host_exists": {
"get": {
"description": "Find one host by insights_id, if it exists. <br /><br /> Required permissions: inventory:hosts:read",
"operationId": "api.host.get_host_exists",
"parameters": [
{
"$ref": "#/components/parameters/insightsId"
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HostIdOut"
}
}
},
"description": "Found a matching host."
},
"400": {
"description": "Invalid request."
},
"404": {
"description": "Host not found."
},
"409": {
"description": "Multiple matching hosts detected."
}
},
"security": [
{
"ApiKeyAuth": []
}
],
"summary": "Find one host by insights_id, if it exists",
"tags": [
"hosts"
]
}
},
"/hosts": {
"delete": {
"description": "Delete the entire list of hosts filtered by the given parameters. <br /><br /> Required permissions: inventory:hosts:write",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@
},
{
"$ref": "#/components/schemas/WebhookPropertiesDTO"
},
{
"$ref": "#/components/schemas/PagerDutyPropertiesDTO"
}
],
"type": "object"
Expand Down Expand Up @@ -740,7 +743,8 @@
"camel",
"drawer",
"email_subscription",
"webhook"
"webhook",
"pagerduty"
],
"type": "string"
},
Expand Down Expand Up @@ -1362,6 +1366,31 @@
],
"type": "object"
},
"PagerDutyPropertiesDTO": {
"properties": {
"secretToken": {
"maxLength": 32,
"type": "string"
},
"severity": {
"$ref": "#/components/schemas/PagerDutySeverity"
}
},
"required": [
"severity",
"secretToken"
],
"type": "object"
},
"PagerDutySeverity": {
"enum": [
"critical",
"error",
"warning",
"info"
],
"type": "string"
},
"RenderEmailTemplateRequest": {
"properties": {
"payload": {
Expand Down
Loading

0 comments on commit 76f1803

Please sign in to comment.