diff --git a/packages/common/config/apis.ts b/packages/common/config/apis.ts index 3818f2c8..137965df 100644 --- a/packages/common/config/apis.ts +++ b/packages/common/config/apis.ts @@ -610,15 +610,34 @@ export const apiConfigurations: ReadonlyArray> = [ tags: [apiLabelsMap["identity-and-access-management"]], }, { - id: "rhsm-subscriptions", - displayName: "Subscriptions", - description: "REST interface for the rhsm-subscriptions service", + id: "rhsm-subscriptions-v1", + displayName: "Subscriptions v1", + description: "REST interface for the rhsm-subscriptions service, version 1", icon: "SubscriptionsIcon", - apiContentPath: "./apis/hcc-insights/rhsm-subscriptions/content.json", + apiContentPath: "./apis/hcc-insights/rhsm-subscriptions-v1/content.json", serverUrl: "https://console.redhat.com", getApiContent: () => import( - "./apis/hcc-insights/rhsm-subscriptions/content.json" + "./apis/hcc-insights/rhsm-subscriptions-v1/content.json" + ) as unknown as Promise, + tags: [ + apiLabelsMap["edge"], + apiLabelsMap["inventories"], + apiLabelsMap["openshift"], + apiLabelsMap["rhel"], + apiLabelsMap["subscriptions"], + ], + }, + { + id: "rhsm-subscriptions-v2", + displayName: "Subscriptions v2", + description: "REST interface for the rhsm-subscriptions service, version 2", + icon: "SubscriptionsIcon", + apiContentPath: "./apis/hcc-insights/rhsm-subscriptions-v2/content.json", + serverUrl: "https://console.redhat.com", + getApiContent: () => + import( + "./apis/hcc-insights/rhsm-subscriptions-v2/content.json" ) as unknown as Promise, tags: [ apiLabelsMap["edge"], diff --git a/packages/common/config/apis/hcc-insights/automation-hub/content.json b/packages/common/config/apis/hcc-insights/automation-hub/content.json index 355dde1d..92a8b676 100644 --- a/packages/common/config/apis/hcc-insights/automation-hub/content.json +++ b/packages/common/config/apis/hcc-insights/automation-hub/content.json @@ -7936,7 +7936,7 @@ "Purge": { "properties": { "finished_before": { - "default": "2024-08-02", + "default": "2024-08-12", "description": "Purge tasks completed earlier than this timestamp. Format '%Y-%m-%d[T%H:%M:%S]'", "format": "date-time", "type": "string" diff --git a/packages/common/config/apis/hcc-insights/edge/content.json b/packages/common/config/apis/hcc-insights/edge/content.json index 28abc848..c62ad5ab 100644 --- a/packages/common/config/apis/hcc-insights/edge/content.json +++ b/packages/common/config/apis/hcc-insights/edge/content.json @@ -1691,18 +1691,9 @@ }, "models.InstalledPackage": { "properties": { - "CreatedAt": { - "$ref": "#/components/schemas/models.EdgeAPITime" - }, - "DeletedAt": { - "$ref": "#/components/schemas/gorm.DeletedAt" - }, "ID": { "type": "integer" }, - "UpdatedAt": { - "$ref": "#/components/schemas/models.EdgeAPITime" - }, "arch": { "type": "string" }, diff --git a/packages/common/config/apis/hcc-insights/image-builder/content.json b/packages/common/config/apis/hcc-insights/image-builder/content.json index ad3627f9..f6e7bfe5 100644 --- a/packages/common/config/apis/hcc-insights/image-builder/content.json +++ b/packages/common/config/apis/hcc-insights/image-builder/content.json @@ -1412,18 +1412,42 @@ "type": "object" }, "OpenSCAP": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenSCAPProfile" + }, + { + "$ref": "#/components/schemas/OpenSCAPCompliance" + } + ] + }, + "OpenSCAPCompliance": { + "properties": { + "policy_id": { + "description": "Apply a compliance policy which is defined in the Red Hat Insights Compliance\nservice. This policy can include tailorings. This only works for RHEL images, and the\npolicy needs to be available for the specific RHEL version.\n", + "example": "fef25b3c-b970-46da-a4e1-cc4d855b98dc", + "format": "uuid", + "type": "string" + } + }, + "required": [ + "policy_id" + ], + "type": "object" + }, + "OpenSCAPProfile": { "properties": { "profile_description": { - "description": "The longform policy description", + "description": "The longform profile description", "type": "string" }, "profile_id": { - "description": "The policy reference ID", + "description": "Uses the OpenSCAP tooling directly to apply a pre-defined profile without tailorings.\n", "example": "xccdf_org.ssgproject.content_profile_cis", "type": "string" }, "profile_name": { - "description": "The policy type", + "description": "The profile type", "type": "string" } }, diff --git a/packages/common/config/apis/hcc-insights/rbac/content.json b/packages/common/config/apis/hcc-insights/rbac/content.json index 907df27b..02a8ebec 100644 --- a/packages/common/config/apis/hcc-insights/rbac/content.json +++ b/packages/common/config/apis/hcc-insights/rbac/content.json @@ -3380,285 +3380,6 @@ ] } }, - "/policies/": { - "get": { - "description": "By default, responses are sorted in ascending order by policy name", - "operationId": "listPolicies", - "parameters": [ - { - "$ref": "#/components/parameters/QueryLimit" - }, - { - "$ref": "#/components/parameters/QueryOffset" - }, - { - "$ref": "#/components/parameters/NameFilter" - }, - { - "$ref": "#/components/parameters/ScopeFilter" - }, - { - "$ref": "#/components/parameters/GroupNameFilter" - }, - { - "$ref": "#/components/parameters/GroupUUIDFilter" - }, - { - "description": "Parameter for ordering policies by value. For inverse ordering, supply '-' before the param value, such as: ?order_by=-name", - "in": "query", - "name": "order_by", - "required": false, - "schema": { - "enum": [ - "name", - "modified" - ], - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PolicyPagination" - } - } - }, - "description": "A paginated list of policy objects" - }, - "401": { - "description": "Unauthorized" - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Unexpected Error" - } - }, - "summary": "List the policies in the tenant", - "tags": [ - "Policy" - ] - }, - "post": { - "operationId": "createPolicies", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PolicyIn" - } - } - }, - "description": "Policy to create", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PolicyExtended" - } - } - }, - "description": "An object describing the policy" - }, - "401": { - "description": "Unauthorized" - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Unexpected Error" - } - }, - "summary": "Create a policy in a tenant", - "tags": [ - "Policy" - ] - } - }, - "/policies/{uuid}/": { - "delete": { - "operationId": "deletePolicy", - "parameters": [ - { - "description": "ID of policy to delete", - "in": "path", - "name": "uuid", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Policy deleted" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found" - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Unexpected Error" - } - }, - "summary": "Delete a policy in the tenant", - "tags": [ - "Policy" - ] - }, - "get": { - "operationId": "getPolicy", - "parameters": [ - { - "description": "ID of policy to get", - "in": "path", - "name": "uuid", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PolicyExtended" - } - } - }, - "description": "A policy object" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found" - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Unexpected Error" - } - }, - "summary": "Get a policy in the tenant", - "tags": [ - "Policy" - ] - }, - "put": { - "operationId": "updatePolicy", - "parameters": [ - { - "description": "ID of policy to update", - "in": "path", - "name": "uuid", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PolicyIn" - } - } - }, - "description": "Policy to update", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PolicyExtended" - } - } - }, - "description": "A policy object" - }, - "401": { - "description": "Unauthorized" - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Not Found" - }, - "500": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Error" - } - } - }, - "description": "Unexpected Error" - } - }, - "summary": "Update a policy in the tenant", - "tags": [ - "Policy" - ] - } - }, "/principals/": { "get": { "description": "By default, responses are sorted in ascending order by username", @@ -4451,10 +4172,6 @@ "description": "Operations about roles", "name": "Role" }, - { - "description": "Operations about policies", - "name": "Policy" - }, { "description": "Operations about access", "name": "Access" diff --git a/packages/common/config/apis/hcc-insights/rhsm-subscriptions/content.json b/packages/common/config/apis/hcc-insights/rhsm-subscriptions-v1/content.json similarity index 100% rename from packages/common/config/apis/hcc-insights/rhsm-subscriptions/content.json rename to packages/common/config/apis/hcc-insights/rhsm-subscriptions-v1/content.json diff --git a/packages/common/config/apis/hcc-insights/rhsm-subscriptions-v2/content.json b/packages/common/config/apis/hcc-insights/rhsm-subscriptions-v2/content.json new file mode 100644 index 00000000..72daf725 --- /dev/null +++ b/packages/common/config/apis/hcc-insights/rhsm-subscriptions-v2/content.json @@ -0,0 +1,648 @@ +{ + "extras": {}, + "openapi": { + "components": { + "responses": { + "BadRequest": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "The server could could not process the current request." + }, + "Forbidden": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "The request was valid, but the request was refused by the server." + }, + "InternalServerError": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "An internal server error has occurred and is not recoverable." + }, + "ResourceNotFound": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "The requested resource was not found." + } + }, + "schemas": { + "BillingAccountId": { + "type": "string" + }, + "BillingProviderType": { + "enum": [ + "", + "red hat", + "aws", + "gcp", + "azure", + "oracle", + "_ANY" + ], + "type": "string" + }, + "Error": { + "properties": { + "code": { + "type": "string" + }, + "status": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "code", + "status", + "title" + ] + }, + "Errors": { + "properties": { + "errors": { + "items": { + "$ref": "#/components/schemas/Error" + }, + "type": "array" + } + }, + "required": [ + "errors" + ] + }, + "PageLinks": { + "properties": { + "first": { + "type": "string" + }, + "last": { + "type": "string" + }, + "next": { + "type": "string" + }, + "previous": { + "type": "string" + } + }, + "required": [ + "first", + "last" + ] + }, + "ProductId": { + "format": "ProductId", + "type": "string" + }, + "ReportCategory": { + "enum": [ + "physical", + "virtual", + "cloud", + "hypervisor" + ], + "type": "string" + }, + "ServiceLevelType": { + "description": "Describes the service level that the report was made against. Not set if it wasn't specified as a query parameter.", + "enum": [ + "", + "Premium", + "Standard", + "Self-Support", + "_ANY" + ], + "type": "string" + }, + "SkuCapacity": { + "properties": { + "billing_provider": { + "$ref": "#/components/schemas/BillingProviderType" + }, + "category": { + "$ref": "#/components/schemas/ReportCategory" + }, + "has_infinite_quantity": { + "description": "Denotes unlimited capacity for the offering when true.", + "type": "boolean" + }, + "measurements": { + "description": "The summed standard capacity of the unit-of-measure of the active subscriptions for the offering. Must be in the same order as \"measurements\" in the meta.", + "items": { + "format": "double", + "type": "number" + }, + "type": "array" + }, + "next_event_date": { + "description": "The most immediate date for a subscription event.", + "format": "date-time", + "type": "string" + }, + "next_event_type": { + "$ref": "#/components/schemas/SubscriptionEventType" + }, + "product_name": { + "description": "The offering name.", + "type": "string" + }, + "quantity": { + "description": "The summed subscription quantities across the active subscriptions for the offering.", + "format": "int32", + "type": "integer" + }, + "service_level": { + "$ref": "#/components/schemas/ServiceLevelType" + }, + "sku": { + "description": "The identifier for the offering.", + "type": "string" + }, + "subscriptions": { + "description": "List of active subscriptions that contribute to the quantity and capacity totals.", + "items": { + "$ref": "#/components/schemas/SkuCapacitySubscription" + }, + "type": "array" + }, + "usage": { + "$ref": "#/components/schemas/UsageType" + } + } + }, + "SkuCapacityReport": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/SkuCapacity" + }, + "type": "array" + }, + "links": { + "$ref": "#/components/schemas/PageLinks" + }, + "meta": { + "$ref": "#/components/schemas/SkuCapacityReport_meta" + } + } + }, + "SkuCapacityReportSort": { + "enum": [ + "sku", + "service_level", + "usage", + "next_event_date", + "next_event_type", + "quantity", + "product_name" + ], + "type": "string" + }, + "SkuCapacityReport_meta": { + "properties": { + "count": { + "type": "integer" + }, + "measurements": { + "items": { + "type": "string" + }, + "type": "array" + }, + "product": { + "type": "string" + }, + "report_category": { + "$ref": "#/components/schemas/ReportCategory" + }, + "service_level": { + "$ref": "#/components/schemas/ServiceLevelType" + }, + "subscription_type": { + "$ref": "#/components/schemas/SubscriptionType" + }, + "usage": { + "$ref": "#/components/schemas/UsageType" + } + }, + "required": [ + "count", + "product", + "subscription_type" + ], + "type": "object" + }, + "SkuCapacitySubscription": { + "properties": { + "id": { + "type": "string" + }, + "number": { + "type": "string" + } + } + }, + "SortDirection": { + "enum": [ + "asc", + "desc" + ], + "type": "string" + }, + "SubscriptionEventType": { + "description": "The most immediate subscription event, such as a subscription beginning or ending.", + "enum": [ + "Subscription Start", + "Subscription End" + ], + "type": "string" + }, + "SubscriptionType": { + "enum": [ + "On-demand", + "Annual" + ], + "type": "string" + }, + "UsageType": { + "description": "Describes the usage that the report was made against. Not set if it wasn't specified as a query parameter.", + "enum": [ + "", + "Production", + "Development/Test", + "Disaster Recovery", + "_ANY" + ], + "type": "string" + } + }, + "securitySchemes": { + "Authorization": { + "in": "header", + "name": "Authorization", + "type": "apiKey" + } + } + }, + "info": { + "description": "REST interface for the rhsm-subscriptions service. Please note any deprecated APIs. Our current deprecation policy is to keep deprecated APIs around for at least 6 months.", + "title": "rhsm-subscriptions-api", + "version": "2.0.0" + }, + "openapi": "3.0.2", + "paths": { + "/v2/openapi.json": { + "get": { + "operationId": "getOpenApiJson", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "description": "The request to get the OpenAPI JSON was successful." + } + }, + "summary": "Get the OpenAPI spec in JSON format.", + "tags": [ + "root" + ] + } + }, + "/v2/openapi.yaml": { + "get": { + "operationId": "getOpenApiYaml", + "responses": { + "200": { + "content": { + "application/x-yaml": { + "schema": { + "type": "string" + } + } + }, + "description": "The request to get the OpenAPI YAML was successful." + } + }, + "summary": "Get the OpenAPI spec in YAML format.", + "tags": [ + "root" + ] + } + }, + "/v2/subscriptions/products/{product_id}": { + "description": "Operations for total capacity by SKU for all of the org's active subscriptions for given Swatch product ID.", + "get": { + "operationId": "getSkuCapacityReport", + "parameters": [ + { + "description": "The ID for the product we wish to query", + "explode": false, + "in": "path", + "name": "product_id", + "required": true, + "schema": { + "$ref": "#/components/schemas/ProductId" + }, + "style": "simple" + }, + { + "description": "The number of items to skip before starting to collect the result set", + "explode": true, + "in": "query", + "name": "offset", + "required": false, + "schema": { + "minimum": 0, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The numbers of items to return", + "explode": true, + "in": "query", + "name": "limit", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + }, + "style": "form" + }, + { + "description": "The category to fetch data for", + "explode": true, + "in": "query", + "name": "category", + "required": false, + "schema": { + "$ref": "#/components/schemas/ReportCategory" + }, + "style": "form" + }, + { + "description": "Include only capacity for the specified service level.", + "explode": true, + "in": "query", + "name": "sla", + "required": false, + "schema": { + "$ref": "#/components/schemas/ServiceLevelType" + }, + "style": "form" + }, + { + "description": "Include only capacity for the specified usage level.", + "explode": true, + "in": "query", + "name": "usage", + "required": false, + "schema": { + "$ref": "#/components/schemas/UsageType" + }, + "style": "form" + }, + { + "description": "Include only report data matching the specified billing provider", + "explode": true, + "in": "query", + "name": "billing_provider", + "required": false, + "schema": { + "$ref": "#/components/schemas/BillingProviderType" + }, + "style": "form" + }, + { + "description": "Include only report data matching the specified billing account", + "explode": true, + "in": "query", + "name": "billing_account_id", + "required": false, + "schema": { + "$ref": "#/components/schemas/BillingAccountId" + }, + "style": "form" + }, + { + "description": "Defines the start of the report period. Dates should be provided in ISO 8601 format but the only accepted offset is UTC. E.g. 2017-07-21T17:32:28Z", + "explode": true, + "in": "query", + "name": "beginning", + "required": false, + "schema": { + "format": "date-time", + "type": "string" + }, + "style": "form" + }, + { + "description": "Defines the end of the report period. Defaults to the current time. Dates should be provided in UTC.", + "explode": true, + "in": "query", + "name": "ending", + "required": false, + "schema": { + "format": "date-time", + "type": "string" + }, + "style": "form" + }, + { + "description": "Filter subscriptions to those that contribute to a specific unit of measure", + "explode": true, + "in": "query", + "name": "metric_id", + "required": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "description": "What property to sort by (optional)", + "explode": true, + "in": "query", + "name": "sort", + "required": false, + "schema": { + "$ref": "#/components/schemas/SkuCapacityReportSort" + }, + "style": "form" + }, + { + "description": "Which direction to sort by (default: asc)", + "explode": true, + "in": "query", + "name": "dir", + "required": false, + "schema": { + "$ref": "#/components/schemas/SortDirection" + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/vnd.api+json": { + "example": { + "data": [ + { + "category": "HYPERVISOR", + "measurements": [ + 42, + null, + 1 + ], + "next_event_date": "2020-04-01T00:00:00Z", + "next_event_type": "Subscription Begin", + "product_name": "Red Hat Enterprise Linux Server, Premium (Physical and 4 Virtual Nodes)(L3 Only)", + "quantity": 3, + "service_level": "Premium", + "sku": "RH00011", + "subscriptions": [ + { + "id": "1234567890", + "number": "1234567891" + }, + { + "id": "1234567892", + "number": "1234567893" + }, + { + "id": "1234567894", + "number": "1234567895" + } + ], + "usage": "Production" + } + ], + "meta": { + "count": 1, + "measurements": [ + "Cores", + "Sockets", + "Instance-hours" + ] + } + }, + "schema": { + "$ref": "#/components/schemas/SkuCapacityReport" + } + } + }, + "description": "The request for the account's subscription capacities was successful." + }, + "400": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "The server could could not process the current request." + }, + "403": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "The request was valid, but the request was refused by the server." + }, + "404": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "The requested resource was not found." + }, + "500": { + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + }, + "description": "An internal server error has occurred and is not recoverable." + } + }, + "summary": "Returns the total capacity by SKU for all of the org's active subscriptions for given Swatch product ID.", + "tags": [ + "subscriptions" + ] + } + } + }, + "security": [ + { + "3ScaleIdentity": [] + } + ], + "servers": [ + { + "url": "/{PATH_PREFIX}/{APP_NAME}", + "variables": { + "APP_NAME": { + "default": "rhsm-subscriptions" + }, + "PATH_PREFIX": { + "default": "api" + } + } + }, + { + "url": "https://{HOSTNAME}/{PATH_PREFIX}/{APP_NAME}", + "variables": { + "APP_NAME": { + "default": "rhsm-subscriptions" + }, + "HOSTNAME": { + "default": "console.redhat.com", + "enum": [ + "qa.console.redhat.com", + "stage.console.redhat.com", + "console.redhat.com" + ] + }, + "PATH_PREFIX": { + "default": "api" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/common/config/apis/hcc-insights/vulnerability/content.json b/packages/common/config/apis/hcc-insights/vulnerability/content.json index 498bbf74..0dfe58fc 100644 --- a/packages/common/config/apis/hcc-insights/vulnerability/content.json +++ b/packages/common/config/apis/hcc-insights/vulnerability/content.json @@ -3985,7 +3985,7 @@ }, "info": { "title": "Vulnerability Engine Manager", - "version": "2.40.6" + "version": "2.40.7" }, "openapi": "3.0.0", "paths": {