{
    "openapi": "3.0.1",
    "info": {
        "title": "IBM License Service",
        "description": "IBM License Service API schema",
        "version": "4.2.12"
    },
    "tags": [
        {
            "name": "Audit snapshot",
            "description": "Retrieving audit snapshot package"
        },
        {
            "name": "Health",
            "description": "Shows information about License Service health condition."
        },
        {
            "name": "Parent workloads",
            "description": "Get workloads running on cluster."
        },
        {
            "name": "Services",
            "description": "Retrieving information about the license metric contribution of the services included in the Cloud Paks."
        },
        {
            "name": "Version",
            "description": "Retrieving information about version"
        }
    ],
    "paths": {
        "/workloads": {
            "get": {
                "tags": [
                    "Parent workloads"
                ],
                "summary": "Returns the .zip package containing the workloads snapshot.",
                "description": "The .zip package contains contains information about all workloads running on cluster. Reporter Workloads are\nDeployment, ReplicaSet, DaemonSet, StatefulSet, CronJob, Job, ReplicationController na Pod.\n\nWorkloads snapshot also contains ScannerResults - file containing all workloads which containers have IBM SWIDTAG\nfiles in their filesystems. This file is generated only when License Service Scanner is available on cluster\nrecognize not annotated IBM Workload.\n",
                "operationId": "getWorkloads",
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Authentication token.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Query successful",
                        "content": {
                            "application/zip": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token not provided or invalid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/version": {
            "get": {
                "tags": [
                    "Version"
                ],
                "summary": "Returns information about License Service version.",
                "description": "Returns information about IBM License Service version and its details.",
                "operationId": "getVersionInfo",
                "responses": {
                    "200": {
                        "description": "Query successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Version"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "500": {
                        "description": "Internal server error"
                    }
                }
            }
        },
        "/snapshot": {
            "get": {
                "tags": [
                    "Audit snapshot"
                ],
                "summary": "Returns the .zip package containing the audit snapshot.",
                "description": "The .zip package contains license information that is required during the software audit, such as the highest\nlicense usage for each product deployed on the cluster.\n\nBy default the query returns audit snapshot from the last 30 days for all products. To query other period,\nset the startDate and endDate parameters. To filter the data and retrieve only information about the products\nthat use specific metric, set the metricName parameter.\n",
                "operationId": "getAuditSnapshot",
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Authentication token.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "startDate",
                        "in": "query",
                        "description": "Optional: Provide start date in the following format: YYYY-MM-DD. If you provide the start date, you must also set the end date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "endDate",
                        "in": "query",
                        "description": "Optional: Provide end date in the following format: YYYY-MM-DD. If you provide the end date, you must also set the start date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "metricName",
                        "in": "query",
                        "description": "Optional: Specify the name of the metric or metrics to filter the data and retrieve only information about\nthe products that use the specified metrics. You can filter by multiple metrics. Provide the full metric name,\n for example, metricName=VIRTUAL_PROCESSOR_CORE. To retrieve multiple metrics, use the following logic:\n- To execute the API in Swagger, separate the metrics with a comma, for example: VIRTUAL_PROCESSOR_CORE,PROCESSOR_VALUE_UNIT\n- To retrieve the data through API URL, use the &, for example: metricName=VIRTUAL_PROCESSOR_CORE&metricName=PROCESSOR_VALUE_UNIT\n\nThis parameter is optional and if it is empty, or not specified, the API retrieves data for all available metrics.\n",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Query successful",
                        "content": {
                            "application/zip": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token not provided or invalid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/services": {
            "get": {
                "tags": [
                    "Services"
                ],
                "summary": "Returns information about license metric contribution of the services.",
                "description": "Returns array of json objects containing rounded license metric contribution of services.\nBy default the query returns the license usage from the last 30 days for all services. \nTo query other period, set the startDate and endDate parameters. To filter the data and\nretrieve only information about the services that use specific metric, set the metricName parameter.",
                "operationId": "getServices",
                "parameters": [
                    {
                        "name": "startDate",
                        "in": "query",
                        "description": "Optional: Provide start date in the following format: YYYY-MM-DD. If you provide the start date, you must also set the end date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "endDate",
                        "in": "query",
                        "description": "Optional: Provide end date in the following format: YYYY-MM-DD. If you provide the end date, you must also set the start date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Authentication token.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "metricName",
                        "in": "query",
                        "description": "Optional: Specify the name of the metric or metrics to filter the data and retrieve only information about\nthe products that use the specified metrics. You can filter by multiple metrics. Provide the full metric\nname, for example, metricName=VIRTUAL_PROCESSOR_CORE. To retrieve multiple metrics, use the following logic:\n- To execute the API in Swagger, separate the metrics with a comma, for example: VIRTUAL_PROCESSOR_CORE,PROCESSOR_VALUE_UNIT\n- To retrieve the data through API URL, use the &, for example: metricName=VIRTUAL_PROCESSOR_CORE&metricName=PROCESSOR_VALUE_UNIT\n\nThis parameter is optional and if it is empty, or not specified, the API retrieves data for all available metrics.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "groupName",
                        "in": "query",
                        "description": "Optional: Specify the name of the reporting group to filter the data and retrieve only information about the products that belong to this group.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Optional: By default, the output is displayed in json. To download results in a csv file, set this parameter to csv.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Query successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/LsServiceApi"
                                    }
                                }
                            },
                            "text/csv": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/LsServiceApi"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token not provided or invalid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/products": {
            "get": {
                "tags": [
                    "Products"
                ],
                "summary": "Returns information about license metric utilization of the products deployed on the cluster.",
                "description": "Returns array of json objects containing license metric utilization of the products deployed on the cluster.\nBy default the query returns the use from the last 30 days for all products. To query other period, set the\nstartDate and endDate parameters. To filter the data and retrieve only information about the products that\nuse specific metric, set the metricName parameter.",
                "operationId": "getProducts",
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Authentication token.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "startDate",
                        "in": "query",
                        "description": "Optional: Provide start date in the following format: YYYY-MM-DD. If you provide the start date, you must also set the end date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "endDate",
                        "in": "query",
                        "description": "Optional: Provide end date in the following format: YYYY-MM-DD. If you provide the end date, you must also set the start date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "metricName",
                        "in": "query",
                        "description": "Optional: Specify the name of the metric or metrics to filter the data and retrieve only information\nabout the products that use the specified metrics. You can filter by multiple metrics. Provide the full\nmetric name, for example, metricName=VIRTUAL_PROCESSOR_CORE. To retrieve multiple metrics, use the\nfollowing logic:\n- To execute the API in Swagger, separate the metrics with a comma, for example: VIRTUAL_PROCESSOR_CORE,PROCESSOR_VALUE_UNIT\n- To retrieve the data through API URL, use the &, for example: metricName=VIRTUAL_PROCESSOR_CORE&metricName=PROCESSOR_VALUE_UNIT\n\nThis parameter is optional and if it is empty, or not specified, the API retrieves data for all available metrics.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "groupName",
                        "in": "query",
                        "description": "Optional: Specify the name of the reporting group to filter the data and retrieve only information about the products that belong to this group.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Optional: By default, the output is displayed in json. To download results in a csv file, set this parameter to csv.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Query successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ProductContributionApi"
                                    }
                                }
                            },
                            "text/csv": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/ProductContributionApi"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token not provided or invalid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/health": {
            "get": {
                "tags": [
                    "Health"
                ],
                "summary": "Returns information about License Service health status.",
                "description": "Returns json object with License Service health status containing information about incomplete annotated pods.",
                "operationId": "getHealth",
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Authentication token.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Query successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Health"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token not provided or invalid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/bundled_products": {
            "get": {
                "tags": [
                    "Bundled products"
                ],
                "summary": "Returns information about license metric utilization of the bundled products.",
                "description": "Returns array of json objects containing license metric utilization of bundled products.\nBy default the query returns the license usage from the last 30 days for all products. \nTo query other period, set the startDate and endDate parameters. To filter the data and retrieve only\ninformation about the products that use specific metric, set the metricName parameter.",
                "operationId": "getProductsDetails",
                "parameters": [
                    {
                        "name": "startDate",
                        "in": "query",
                        "description": "Optional: Provide start date in the following format: YYYY-MM-DD. If you provide the start date, you must also set the end date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "endDate",
                        "in": "query",
                        "description": "Optional: Provide end date in the following format: YYYY-MM-DD. If you provide the end date, you must also set the start date.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "token",
                        "in": "query",
                        "description": "Authentication token.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "metricName",
                        "in": "query",
                        "description": "Optional: Specify the name of the metric or metrics to filter the data and retrieve only information\nabout the products that use the specified metrics. You can filter by multiple metrics. Provide the full\n metric name, for example, metricName=VIRTUAL_PROCESSOR_CORE. To retrieve multiple metrics, use the following logic:\n- To execute the API in Swagger, separate the metrics with a comma, for example: VIRTUAL_PROCESSOR_CORE,PROCESSOR_description_UNIT\n- To retrieve the data through API URL, use the &, for example: metricName=VIRTUAL_PROCESSOR_CORE&metricName=PROCESSOR_VALUE_UNIT\n\nThis parameter is optional and if it is empty, or not specified, the API retrieves data for all available metrics.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "groupName",
                        "in": "query",
                        "description": "Optional: Specify the name of the reporting group to filter the data and retrieve only information about the products that belong to this group.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Optional: By default, the output is displayed in json. To download results in a csv file, set this parameter to csv.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Query successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/BundledProductApi"
                                    }
                                }
                            },
                            "text/csv": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/BundledProductApi"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token not provided or invalid",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "Internal server error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiResponseDto"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ApiResponseDto": {
                "type": "object",
                "properties": {
                    "title": {
                        "type": "string"
                    },
                    "statusCode": {
                        "type": "integer",
                        "format": "int32"
                    },
                    "message": {
                        "type": "string"
                    },
                    "timestamp": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "path": {
                        "type": "string"
                    }
                },
                "description": "Object representing response from the server"
            },
            "Version": {
                "type": "object",
                "properties": {
                    "version": {
                        "type": "string"
                    },
                    "buildDate": {
                        "type": "string"
                    },
                    "commit": {
                        "type": "string"
                    }
                }
            },
            "LsServiceApi": {
                "type": "object",
                "properties": {
                    "cloudpakId": {
                        "type": "string",
                        "description": "Cloudpak identifier."
                    },
                    "cloudpakMetricName": {
                        "type": "string",
                        "description": "Cloudpak metric name.."
                    },
                    "productName": {
                        "type": "string",
                        "description": "Product name."
                    },
                    "productId": {
                        "type": "string",
                        "description": "Product identifier."
                    },
                    "metricName": {
                        "type": "string",
                        "description": "Product metric name."
                    },
                    "serviceName": {
                        "type": "string",
                        "description": "Service name."
                    },
                    "serviceId": {
                        "type": "string",
                        "description": "Service identifier."
                    },
                    "serviceMetricValue": {
                        "type": "number",
                        "description": "The highest metric units value with which service contributes to product metric value."
                    },
                    "metricDate": {
                        "type": "string",
                        "description": "Date when the highest metric usage occurred. Date format: YYYY-MM-DD."
                    }
                }
            },
            "ProductContributionApi": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Product name."
                    },
                    "id": {
                        "type": "string",
                        "description": "Product identifier."
                    },
                    "metricPeakDate": {
                        "type": "string",
                        "description": "Date when the highest metric usage occurred. Date format: YYYY-MM-DD."
                    },
                    "metricName": {
                        "type": "string",
                        "description": "Product metricName."
                    },
                    "metricQuantity": {
                        "type": "number",
                        "description": "The highest metric units value used by product, or if group name provided then metric units value contributed by chosen group."
                    }
                }
            },
            "Health": {
                "type": "object",
                "properties": {
                    "incompleteAnnotations": {
                        "$ref": "#/components/schemas/IncompleteAnnotations"
                    }
                }
            },
            "IncompleteAnnotations": {
                "type": "object",
                "properties": {
                    "count": {
                        "type": "integer",
                        "description": "Count of pods with incomplete annotations.",
                        "format": "int64"
                    },
                    "pods": {
                        "type": "array",
                        "description": "List of pods with incomplete annotations.",
                        "items": {
                            "type": "string",
                            "description": "List of pods with incomplete annotations."
                        }
                    }
                },
                "description": "Information about incomplete pods annotations"
            },
            "BundledProductApi": {
                "type": "object",
                "properties": {
                    "productName": {
                        "type": "string",
                        "description": "Bundled product name."
                    },
                    "productId": {
                        "type": "string",
                        "description": "Bundled product identifier."
                    },
                    "cloudpakId": {
                        "type": "string",
                        "description": "Cloudpak identifier."
                    },
                    "cloudpakVersion": {
                        "type": "string",
                        "description": "Cloudpak version."
                    },
                    "cloudpakMetricName": {
                        "type": "string",
                        "description": "Cloudpak metricName"
                    },
                    "metricName": {
                        "type": "string",
                        "description": "Bundled product metricName"
                    },
                    "metricPeakDate": {
                        "type": "string",
                        "description": "Date when the highest metric usage occured. Date format: YYYY-MM-DD."
                    },
                    "metricMeasuredQuantity": {
                        "type": "integer",
                        "description": "The highest metric units value used by bundled product.",
                        "format": "int64"
                    },
                    "metricConversion": {
                        "type": "string",
                        "description": "Cloudpak conversion ratio."
                    },
                    "metricConvertedQuantity": {
                        "type": "integer",
                        "description": "Bundled product cloudpak metric quantity contribution",
                        "format": "int64"
                    }
                }
            }
        }
    }
}