diff --git a/docs/specs/openapi.json b/docs/specs/openapi.json index 1b12afdd7e..66c6f4d554 100644 --- a/docs/specs/openapi.json +++ b/docs/specs/openapi.json @@ -5827,191 +5827,10 @@ } }, "/recommendations/openshift": { - "get": { - "tags": [ "Optimizations" ], - "summary": "Get all recommendations", - "description": "This feature is in limited preview for select customers", - "externalDocs": { - "description": "Please refer to this blog post if you want to be included in the preview", - "url": "https://www.redhat.com/en/blog/red-hat-insights-brings-resource-optimization-red-hat-openshift" - }, - "operationId": "getRecommendationList", - "parameters": [ - { - "name": "cluster", - "in": "query", - "description": "Cluster alias or UUID", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "workload_type", - "in": "query", - "description": "Workload type", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "workload", - "in": "query", - "description": "Workload name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "container", - "in": "query", - "description": "Container name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "project", - "in": "query", - "description": "Project name", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "start_date", - "in": "query", - "description": "Start date", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "end_date", - "in": "query", - "description": "End date", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "offset", - "in": "query", - "description": "Pagination offset", - "required": false, - "schema": { - "type": "integer", - "minimum": 0 - } - }, - { - "name": "limit", - "in": "query", - "description": "Pagination limit", - "required": false, - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 100 - } - }, - { - "name": "order_by", - "in": "query", - "description": "Options are cluster, project, workload_type, workload, container, last_reported", - "required": false, - "schema": { - "type": "string", - "example": "last_reported" - } - }, - { - "name": "order_how", - "in": "query", - "description": "Options are ASC, DESC", - "required": false, - "schema": { - "type": "string", - "example": "DESC" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecommendationList" - } - } - } - }, - "401": { - "description": "User is not authorized", - "content": { - "text/plain": { - "schema": { - "type": "string", - "example": "User is not authorized to access the resource" - } - } - } - } - } - } + "$ref": "/api/cost-management/v1/recommendations/openshift/openapi.json#/paths/~1recommendations~1openshift" }, "/recommendations/openshift/{recommendation-id}": { - "get": { - "tags": [ "Optimizations" ], - "description": "This feature is in limited preview for select customers", - "externalDocs": { - "description": "Please refer to this blog post if you want to be included in the preview", - "url": "https://www.redhat.com/en/blog/red-hat-insights-brings-resource-optimization-red-hat-openshift" - }, - "operationId": "getRecommendationById", - "parameters": [ - { - "in": "path", - "name": "recommendation-id", - "required": true, - "schema": { - "type": "string" - }, - "description": "The recommendation UUID" - } - ], - "summary": "Get recommendation for container", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json; charset=UTF-8": { - "schema": { - "$ref": "#/components/schemas/Recommendation" - } - } - } - }, - "401": { - "description": "User is not authorized", - "content": { - "text/plain": { - "schema": { - "type": "string", - "example": "User is not authorized to access the resource" - } - } - } - } - } - } + "$ref": "/api/cost-management/v1/recommendations/openshift/openapi.json#/paths/~1recommendations~1openshift~1%7Brecommendation-id%7D" } }, "externalDocs": { @@ -6974,29 +6793,6 @@ } } }, - "Notifications": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "NOTICE", - "WARNING", - "CRITICAL" - ] - }, - "message": { - "type": "string", - "example": "There is not enough data available to generate a recommendation." - }, - "code": { - "type": "number" - } - } - } - }, "OrganizationFilter": { "type": "object", "properties": { @@ -7104,797 +6900,6 @@ } ] }, - "Recommendation": { - "type": "object", - "properties": { - "cluster_alias": { - "type": "string", - "example": "test_cost_ocp_ros_3c462dbe" - }, - "cluster_uuid": { - "type": "string", - "example": "d29c4b8b-f1a8-471c-ab95-b64e36bb51a9" - }, - "container": { - "type": "string", - "example": "pod-ros-A11" - }, - "id": { - "type": "string", - "example": "721eb376-13a9-43ab-868e-755aa1ce7f2a" - }, - "last_reported": { - "type": "string", - "format": "date-time", - "example": "2023-04-18T15:48:54.000Z" - }, - "project": { - "type": "string", - "example": "project-ros-A1" - }, - "recommendations": { - "type": "object", - "properties": { - "duration_based": { - "type": "object", - "properties": { - "long_term": { - "type": "object", - "properties": { - "current": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 2 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 30.715 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 1.91 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 16.391 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - }, - "config": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 2.11 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 31.674 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 1.92 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 16.396 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - }, - "notifications": { - "$ref": "#/components/schemas/Notifications" - }, - "pods_count": { - "type": "integer", - "example": 1 - }, - "confidence_level": { - "type": "number", - "example": 0.5 - }, - "duration_in_hours": { - "type": "number", - "example": 361 - }, - "monitoring_end_time": { - "type": "string", - "format": "date-time", - "example": "2023-04-18T15:00:00.000Z" - }, - "monitoring_start_time": { - "type": "string", - "format": "date-time", - "example": "2023-04-03T15:00:00.000Z" - }, - "variation": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 3 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 344 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 4 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 500 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - } - } - }, - "medium_term": { - "type": "object", - "properties": { - "current": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 2.09 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 30.715 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 1.91 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 16.391 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - }, - "config": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 622 - }, - "format": { - "type": "string", - "example": "millicores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 31.674 - }, - "format": { - "type": "string", - "example": "GiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 1.92 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 16.396 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - }, - "notifications": { - "$ref": "#/components/schemas/Notifications" - }, - "pods_count": { - "type": "integer", - "example": 1 - }, - "confidence_level": { - "type": "number", - "example": 0.5 - }, - "duration_in_hours": { - "type": "number", - "example": 169 - }, - "monitoring_end_time": { - "type": "string", - "format": "date-time", - "example": "2023-04-18T15:00:00.000Z" - }, - "monitoring_start_time": { - "type": "string", - "format": "date-time", - "example": "2023-04-11T15:00:00.000Z" - }, - "variation": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 2 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 959.4 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 5 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 200.333 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - } - } - }, - "short_term": { - "type": "object", - "properties": { - "current": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 2.09 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 30.715 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 1.91 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 16.391 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - }, - "config": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 2.11 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 31.674 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 1.92 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 16.396 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - }, - "notifications": { - "$ref": "#/components/schemas/Notifications" - }, - "pods_count": { - "type": "integer", - "example": 1 - }, - "confidence_level": { - "type": "number", - "example": 0.5 - }, - "duration_in_hours": { - "type": "number", - "example": 25 - }, - "monitoring_end_time": { - "type": "string", - "format": "date-time", - "example": "2023-04-18T15:00:00.000Z" - }, - "monitoring_start_time": { - "type": "string", - "format": "date-time", - "example": "2023-04-17T15:00:00.000Z" - }, - "variation": { - "type": "object", - "properties": { - "limits": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 5 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 929.111 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - }, - "requests": { - "type": "object", - "properties": { - "cpu": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 3 - }, - "format": { - "type": "string", - "example": "cores" - } - } - }, - "memory": { - "type": "object", - "properties": { - "amount": { - "type": "number", - "example": 500 - }, - "format": { - "type": "string", - "example": "MiB" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "source_id": { - "type": "string", - "example": "0920ff0d-f1d6-4fe2-8bf3-18e6074bd27b" - }, - "workload": { - "type": "string", - "example": "pod-ros-A11" - }, - "workload_type": { - "type": "string", - "example": "deploymentconfig" - } - } - }, - "RecommendationList": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Recommendation" - } - }, - "meta": { - "type": "object", - "properties": { - "count": { - "type": "integer", - "minimum": 0 - }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100 - }, - "offset": { - "type": "integer", - "minimum": 0 - } - } - }, - "links": { - "type": "object", - "properties": { - "first": { - "type": "string" - }, - "previous": { - "type": "string" - }, - "next": { - "type": "string" - }, - "last": { - "type": "string" - } - } - } - } - }, "ResourceTypeListPagination": { "allOf": [{ "$ref": "#/components/schemas/ListPagination"