Deprecated: Exclusion of instances from pricing calculations

You use the POST operation on the api/sam/swinventory/exclude element to exclude instances from pricing calculations.

Important: This REST API is deprecated. Use REST API for classifying software (v2).

Before you begin

9.2.34 Starting from application update 9.2.34, this REST API is disabled by default. To enable it, change the value of the expose_deprecated_api parameter on the Advanced Server Settings panel to true. For more information, see: Advanced server settings.

Important: Deprecated REST APIs are going to be removed at the end of 2024. After that period, these REST APIs are going to be unsupported. Switch to version 2 of the REST APIs as soon as convenient.

Permissions

An icon representing a user. You must have the Manage Software Classification permission to perform this task.

Resource URL

https://hostname:port/api/sam/swinventory/exclude

Resource information

Table 1. Resource information
Operation details Description
Purpose Excludes instances from a pricing calculation.
HTTP method POST
Resource URI https://hostname:port/api/sam/swinventory/exclude
URI query parameters For a list of applicable query parameters, see: Query parameters.
Request headers
Accept-Language (optional)
  • Use: Used to negotiate the language of the response. If this header is not specified, the content is returned in the server language.
  • Values: en-US (only English is supported)
Token
  • Use: Used to authenticate REST API requests. The header is required when you set the value of the api_token_in_url_enabled parameter to false. Otherwise, you can specify the token in the request header or in the URL. For more information, see: Authenticating REST API requests.
  • Values: an alphanumeric string that is generated in License Metric Tool
Request payload n/a
Request Content-Type n/a
Response headers
Content-Type
  • Use: Specifies the content type of the response.
  • Values: application/json
Content-Language
  • Use: Specifies the language of the response content. If this header is not specified, the content is returned in the server language.
  • Values: en-US, …
Response payload n/a
Response Content-Type n/a
Normal HTTP response codes
  • 204 – No content
Error HTTP response codes
  • 400 – “Bad Request” if a query parameter contains errors or is missing
  • 401 – “Unauthorized” if the user is not authorized to perform the operation
  • 404 – “Not Found” if a release or instance of the product or version that the user requested does not exist
  • 422 – “Unprocessable Entity” if the request was well-formed but was unable to be followed due to semantic errors

Message body excludes an error message with details.

Query parameters

You can use query parameters to narrow down the results of your search. The following table presents query parameters that you can use for the POST/swinventory/exclude element.
Table 2. Query parameters for excluding instances from pricing calculations
Parameter Description Required Value
productInventoryId A list of unique identifiers of instances to be excluded from the calculation separated with a comma. At least one identifier must be specified. Yes Numeric
reason The reason for excluding an instance from the pricing calculations. Yes backup
beta
component
evaluation
no_licensing
not_compatible
other
comment Additional comments for the reason of exclusion. Only when reason is other String
updateTime A list of timestamps of the last modification time of the instances expressed in milliseconds. Each timestamp is separated with a comma. The first timestamp in the list corresponds to the first instance, and so on. This parameter is used to handle concurrent actions.

Use the GET operation on the swinventory/release/{release_id}/instances element to get the update times.

Yes Numeric

Example HTTP conversation

Request
POST https://hostname:port/api/sam/swinventory/exclude
?productInventoryId=300001,500001&updateTime=1349237658578,1349237658588
&reason=no_licensing
Request header
Accept: application/json
Accept-Language: en-US
Token: <token>
Response header
HTTP/1.1 204 OK
Content-Type: application/json
Content-Language: en-US