DeleteInventory
Delete a custom inventory type or the data associated with a custom Inventory type. Deleting a custom inventory type is also referred to as deleting a custom inventory schema.
Request Syntax
{
"ClientToken": "string
",
"DryRun": boolean
,
"SchemaDeleteOption": "string
",
"TypeName": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ClientToken
-
User-provided idempotency token.
Type: String
Pattern:
[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
Required: No
- DryRun
-
Use this option to view a summary of the deletion request without deleting any data or the data type. This option is useful when you only want to understand what will be deleted. Once you validate that the data to be deleted is what you intend to delete, you can run the same command without specifying the
DryRun
option.Type: Boolean
Required: No
- SchemaDeleteOption
-
Use the
SchemaDeleteOption
to delete a custom inventory type (schema). If you don't choose this option, the system only deletes existing inventory data associated with the custom inventory type. Choose one of the following options:DisableSchema: If you choose this option, the system ignores all inventory data for the specified version, and any earlier versions. To enable this schema again, you must call the
PutInventory
operation for a version greater than the disabled version.DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.
Type: String
Valid Values:
DisableSchema | DeleteSchema
Required: No
- TypeName
-
The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern:
^(AWS|Custom):.*$
Required: Yes
Response Syntax
{
"DeletionId": "string",
"DeletionSummary": {
"RemainingCount": number,
"SummaryItems": [
{
"Count": number,
"RemainingCount": number,
"Version": "string"
}
],
"TotalCount": number
},
"TypeName": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- DeletionId
-
Every
DeleteInventory
operation is assigned a unique ID. This option returns a unique ID. You can use this ID to query the status of a delete operation. This option is useful for ensuring that a delete operation has completed before you begin other operations.Type: String
Pattern:
[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}
- DeletionSummary
-
A summary of the delete operation. For more information about this summary, see Deleting custom inventory in the AWS Systems Manager User Guide.
Type: InventoryDeletionSummary object
- TypeName
-
The name of the inventory data type specified in the request.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern:
^(AWS|Custom):.*$
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServerError
-
An error occurred on the server side.
HTTP Status Code: 500
- InvalidDeleteInventoryParametersException
-
One or more of the parameters specified for the delete operation isn't valid. Verify all parameters and try again.
HTTP Status Code: 400
- InvalidInventoryRequestException
-
The request isn't valid.
HTTP Status Code: 400
- InvalidOptionException
-
The delete inventory option specified isn't valid. Verify the option and try again.
HTTP Status Code: 400
- InvalidTypeNameException
-
The parameter type name isn't valid.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of DeleteInventory.
Sample Request
POST / HTTP/1.1
Host: ssm.us-west-2.amazonaws.com
Accept-Encoding: identity
X-Amz-Target: AmazonSSM.DeleteInventory
Content-Type: application/x-amz-json-1.1
User-Agent: aws-cli/2.2.25 Python/3.8.8 Windows/10 exe/AMD64 prompt/off command/ssm.delete-inventory
X-Amz-Date: 20240809T230226Z
Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20240809/us-west-2/ssm/aws4_request,
SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature39c3b3042cd2aEXAMPLE
Content-Length: 124
{
"TypeName": "Custom:RackInfo",
"SchemaDeleteOption": "DeleteSchema",
"ClientToken": "a7d4972c-ab3e-4b9a-b5c0-d5aExample"
}
Sample Response
{
"DeletionId": "5bc2ba3b-ee6a-40fa-8d09-5e5Example",
"DeletionSummary": {
"RemainingCount": 1,
"SummaryItems": [
{
"Count": 1,
"RemainingCount": 1,
"Version": "1.0"
}
],
"TotalCount": 1
},
"TypeName": "Custom:RackInfo"
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: