The cpln delete command serves as the opposite of the CLI apply command. While the apply
command creates and updates resources, the delete
command deletes resources. Both the apply
and the delete
commands accept the same options.
copycpln delete --file FILE_NAME [OPTIONS]
The FILE_NAME
is the path for the file and it can be either a JSON or YAML file containing the resource metadata.
To delete an Identity, a Volume Set or a Workload resource you need to specify a GVC in one of the following methods.
Specify a gvc
within your cpln profile. This will add the gvc
to the session context of the profile and will be refered to as the default gvc
when executing any future command including the cpln delete
command.
copycpln profile update PROFILE_NAME --gvc GVC_NAME
Specify a --gvc
flag to the delete
command. This will pass the gvc
as an option and will override the default gvc
that is defined in the session context of the profile.
copycpln delete --file FILE_NAME --gvc GVC_NAME
Specify a gvc
property in the resource definition in the file you wish to run the delete command against.
copykind: identityname: example-identitydescription: example-descriptiontags: {}gvc: example-gvc
Click here to view the CLI reference page for the delete
command.
The CLI has the ability to convert K8s resources into Control Plane resources. By passing the --k8s true
option to the delete
command, the K8s resources will be converted and deleted.
copycpln delete --file FILE_NAME --k8s true
The delete
command will use the logic of the CLI convert command and then delete the resources defined in the output.
In case you would like to pass Control Plane resources through stdin
(Standard Input) and delete them, use the following command.
copyCONTROL_PLANE_RESOURCES | cpln delete --file -
The console has the ability to upload a JSON or YAML file or accept a resource definition in JSON or YAML as input. The functionality is the same as using the CLI. Click the cpln apply
button in the upper right corner of the console. A modal will be displayed containing the upload instructions. Enable the Use as Delete
switch in order to delete a resource.
The cpln apply modal provides the ability to specify in which org
and gvc
a resource will be deleted. The default is your currently selected org
and gvc
.
A file or an input containing an Identity, a Volume Set or a Workload resource will be deleted in the scope of the specified gvc
in the cpln apply modal. In case a gvc
is defined within a resource, the resource will be deleted in the scope of that gvc
.
To delete multiple resources, specify a JSON array or YAML's separated with ---
.
copykind: gvcname: example-gvcdescription: example-gvctags: {}spec:staticPlacement:locationLinks:- /org/ORG_NAME/location/aws-eu-central-1---kind: identityname: example-identitydescription: example-identitytags: {}gvc: example-gvc