Deleting Certificates
Use the remove operation to remove one or more certificates within one repository, whether it is a particular site repository or Administrator’s repository.
Request Packet Structure
A request XML packet that deletes certificate should include the remove operation node:
<packet>
<certificate>
<remove>
...
</remove>
</certificate>
</packet>
The remove node does not have a separate type, it is nested within
type CertificateActionRequest (certificate_input.xsd
). The
remove node has the following graphical representation:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
- The filter, required. It contains rules defining which certificates should be deleted. Data type: none.
- The name, required. It specifies the name of certificate that should be deleted. Data type: string.
- The webspace, required. It specifies from which subscription storage the certificate is deleted. Data type: string.
- The admin, required. It specifies that the certificate is deleted from Administrator’s repository . Data type: none.
Remarks
1. The filter node allows specifying multiple certificate names, which gives you opportunity to delete several certificates within one remove operation.
<packet>
<certificate>
<remove>
<filter>
<name>cert_1</name>
<name>cert_2</name>
<name>cert_3</name>
<name>cert_4</name>
</filter>
...
</remove>
</certificate>
</packet>
2. With a single remove operation, you can delete certificates from only one repository which is defined with required webspace or admin node. In other words, you should use either webspace node, or admin node within remove operation nodes:
<packet>
<certificate>
<remove>
<filter> ... </filter>
<webspace>site1.com</webspace>
</remove>
</certificate>
</packet>
or
<packet>
<certificate>
<remove>
<filter> ... </filter>
<admin/>
</remove>
</certificate>
</packet>
3. With one packet, you can remove multiple different certificates from any of the repositories you own. To do this, use the required number of remove nodes in the packet:
<packet>
<certificate>
<remove>
...
</remove>
<remove>
...
</remove>
</certificate>
</packet>
Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The remove node of the output XML packet is structured as follows:
Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.
- The result node is required. It wraps the response retrieved
from the server. Data type: resultType (
common.xsd
). - The status node is required. Specifies the execution status of the remove operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. It is used to return the error code when the remove operation fails. Data type: unsignedInt.
- The errtext node is optional. It is used to return the error message if the remove operation fails. Data type: string.
- The name node is optional. Returns the certificate name if the certificate is not found on the server. Data type: string.
Samples
Removing certificate
This packet removes the certificate called common from repository of the subscription doe.de.
<packet>
<certificate>
<remove>
<filter>
<name>common</name>
</filter>
<webspace>doe.de</webspace>
</remove>
</certificate>
</packet>
Response:
<packet version="1.6.7.0">
<certificate>
<remove>
<result>
<status>ok</status>
</result>
</remove>
</certificate>
</packet>
Removing several certificates
This packet removes three certificates: general, personal, sample.
Certificate general is installed to the Administrator’s repository. Certificates personal and sample are installed to the repository of the subscription johndoe.org.
<packet>
<certificate>
<remove>
<filter>
<name>general</name>
</filter>
<admin/>
</remove>
<remove>
<filter>
<name>personal</name>
<name>sample</name>
</filter>
<webspace>johndoe.org</webspace>
</remove>
</certificate>
</packet>
Response:
<packet version="1.6.7.0">
<certificate>
<remove>
<result>
<status>ok</status>
</result>
</remove>
<remove>
<result>
<status>ok</status>
</result>
<result>
<status>ok</status>
</result>
</remove>
</certificate>
</packet>