Delete
This method can be used to delete entities, based on the identity properties stated in an input file.
Syntax
Importexportcli.exe delete -con <ARA-url> -usr <user> -pwd <password> -format <xml|csv> -fi <file> [-ct <customtype>] [-failonerror]
Important! To delete an entity, you can only specify attributes which identify it (for example, you cannot specify the owner of the folder).
Parameters
- -con: URL of the import/export service of the web application
Example:
https://www.mycompany.com/WebUI
- -usr: Name of the user (syntax: system name / client number / user name / department)
Note: When only one client is installed, the system name is optional.
-
-pwd: Password of the user specified in -usr or the token that is returned by the Java API
-
-mt: Name of the main type you want to delete
Can be one of the following:
- Application
- Artifact
- ArtifactSource
- Component
- DeploymentTarget
- Environment
- Package
- PackageDependency
- Reservation
- StackProvider
- StackTemplate
- Workflow
- -format: Format of input file
Options:
- XML
- CSV
Note: See also Formats in Serialization.
- -fi: Path name to the input file that contains the unique id's of the entities that should be deleted
Important! The input file must contain identity properties only. If the input file contains non-identity properties, the delete method will fail.
-
-failonerror: Flag indicating whether the processing of the command shall continue or abort in an error:If ‑failonerror option is present, the processing of the command will stop if an error occursIf ‑failonerror option is not present, the processing will continue even if there is an error
XML Example
<?xml version="1.0" encoding="utf-8"?> <Sync xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sync.xsd"> <Entity mainType="Workflow" customType="Install" typeVersion="1.0"> <Property name="system_name" isIdentity="true"> <Value>Install</Value> </Property> <Property name="system_application.system_name" isIdentity="true"> <Value>CRM</Value> </Property> </Entity> <Entity mainType="Workflow" customType="Uninstall" typeVersion="1.0"> <Property name="system_name" isIdentity="true"> <Value>Uninstall</Value> </Property> <Property name="system_application.system_name" isIdentity="true"> <Value>CRM</Value> </Property> </Entity> </Sync>
CSV Example
system_identity_properties,system_name,system_application.system_name system_name#;#system_application.system_name,Install,CRM
Pre-Conditions
To delete a entity, the entity itself must fulfill certain conditions. Otherwise, an error message will appear. The specific conditions depend on the entity type.
Conditions to delete entities of type Application
- Not referenced by any Package
- Not referenced by any environment Snapshot
- All assigned Components can be deleted - that is the case when the conditions to delete the Components are fulfilled for all Components assigned to the application
- All assigned Deployment Profiles can be deleted - that is the case when the conditions to delete the Deployment Profiles are fulfilled for all Deployment Profiles assigned to the Application
Conditions to delete entities of type ArtifactSource
- If an Artifact is assigned: The conditions to delete the Artifacts are fulfilled for all Artifacts that are assigned to the Artifact Source.
Conditions to delete entities of type Artifact
- No referenced by any Executions
- No referenced by any Packages
Conditions to delete entities of type Component
- Not referenced by any packages
- Has no executions
- Has no installation records
- Not referenced by any component links
- Not used by any deployment profiles
- Not installed on any deployment targets
- Not referenced by any deployment target snapshots
Conditions to delete entities of type DeploymentTarget
- Not assigned to any environments
- Not referenced by any snapshots
- Has no installed components
- Has no ad-hoc snapshots that are in progress
- Not used by any deployment profiles
Conditions to delete entities of type Environment
- Not referenced by any Reservations
- Not referenced by Deployment Profiles
- Not referenced by environment Snapshots
Conditions to delete entities of type Package
- Has no executions
- Has no installation records
- Not referenced by a successor package
- No patch packages
- No other packages depends on it
- Has no installed package components
Conditions to delete entities of type Workflow
- Has no executions being processed in a queue run
- Has no executions running
- Is not referenced by any execution templates
Conditions to delete entities of type Stack Providers
- Is not referenced by any Stack Template
Conditions to delete entities of type Stack Template
- Is not referenced by any Stack
Conditions to delete entities of type Deployment Profile
- Has no executions
- Has no queues
- Not referenced by any execution templates
Conditions to delete entities of type ComponentLink
- Not used by any deployment profiles
Conditions to delete entities of type User
- Not referenced by ApprovalRequest, ApprovalRequestGroup, CustomAction, Execution, DeploymentProfile, DeploymentTarget, ExecutionTemplate, LoginObject, Queue, NotificationMessageTemplate, Application, Component, Reservation, Workflow, Environment or Package.
Conditions to delete entities of type UserGroup
- Has no users
Conditions to delete entities of type LoginObject
-
Not referenced by any deployment profiles
To Find and Remove Login References from Deployment Profiles
-
Run the following query against the CDA database
Note: 'loginObjectName' is the name of the login to be deleted.
select LoginId from LoginObject where Name = 'loginObjectName'
This should return a numerical value, for example: 123.
-
Run the following query against the CDA database using the value generated from the previous query:
select * from DeplProfile where LoginId = 123
- The values under the
Name
column indicate the Deployment Profiles where the login is still used. - Delete the Login from the Logins view.
-
- Not referenced by any executions
- Not referenced by any environment snapshots
- Not referenced by any pending adhoc snapshot creation
Conditions to delete entities of type Queue
- Is not running
- Has no executions
- Not used in execution template
Conditions to delete entities of type QueueRun
- Has no executions
- If it is recurring queue run, it must not be in the first five queue runs
- Queue run is not in the past
- Not in the state: processing, waiting, paused, pausingAfterCurrent
Conditions to delete entities of type EnvironmentComparison
- Has no in-progress ad-hoc snapshot creation