Skip to content

delete_inventory

delete_inventory(
    type_name: InventoryItemTypeName,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    schema_delete_option: Optional[InventorySchemaDeleteOption] = None,
    dry_run: Optional[DryRun] = None,
    client_token: Optional[UUID] = None,
) -> DeleteInventoryResult

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.

Parameters:

  • type_name (InventoryItemTypeName) –

    The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself.

  • schema_delete_option (Optional[InventorySchemaDeleteOption], default: None ) –

    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.

  • dry_run (Optional[DryRun], default: None ) –

    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.

  • client_token (Optional[UUID], default: None ) –

    User-provided idempotency token.

Raises:

Source code in docs_src/capo_ssm/_services/ssm.py
def delete_inventory(
    self,
    type_name: "capo_ssm.types.inventory_item_type_name.InventoryItemTypeName",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    schema_delete_option: Optional[
        "capo_ssm.types.inventory_schema_delete_option.InventorySchemaDeleteOption"
    ] = None,
    dry_run: Optional["capo_ssm.types.dry_run.DryRun"] = None,
    client_token: Optional["capo_ssm.types.uuid.UUID"] = None,
) -> "capo_ssm.types.delete_inventory_result.DeleteInventoryResult":
    """<p>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.</p>

    Args:
        type_name: <p>The name of the custom inventory type for which you want to delete either all previously collected data or the inventory type itself. </p>
        schema_delete_option: <p>Use the <code>SchemaDeleteOption</code> 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:</p> <p>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 <code>PutInventory</code> operation for a version greater than the disabled version.</p> <p>DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.</p>
        dry_run: <p>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 <code>DryRun</code> option.</p>
        client_token: <p>User-provided idempotency token.</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_delete_inventory_parameters_exception.InvalidDeleteInventoryParametersException: <p>One or more of the parameters specified for the delete operation isn't valid. Verify all parameters and try again.</p>
        capo_ssm.errors.invalid_inventory_request_exception.InvalidInventoryRequestException: <p>The request isn't valid.</p>
        capo_ssm.errors.invalid_option_exception.InvalidOptionException: <p>The delete inventory option specified isn't valid. Verify the option and try again.</p>
        capo_ssm.errors.invalid_type_name_exception.InvalidTypeNameException: <p>The parameter type name isn't valid.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.delete_inventory_request.DeleteInventoryRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.delete_inventory_result.DeleteInventoryResult"
    ]:
        import capo_ssm._operations.amazon_ssm.delete_inventory

        output, http_response = (
            capo_ssm._operations.amazon_ssm.delete_inventory.delete_inventory(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteInventory")
    )
    input_: capo_ssm.types.delete_inventory_request.DeleteInventoryRequest = {
        "type_name": type_name
    }
    if schema_delete_option is not None:
        input_["schema_delete_option"] = schema_delete_option
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output