MCPcopy Index your code
hub / github.com/apache/cloudstack-go / RevokeCertificate

Method RevokeCertificate

cloudstack/CertificateService.go:936–963  ·  view source on GitHub ↗

Revokes certificate using configured CA plugin

(p *RevokeCertificateParams)

Source from the content-addressed store, hash-verified

934
935// Revokes certificate using configured CA plugin
936func (s *CertificateService) RevokeCertificate(p *RevokeCertificateParams) (*RevokeCertificateResponse, error) {
937 resp, err := s.cs.newPostRequest("revokeCertificate", p.toURLValues())
938 if err != nil {
939 return nil, err
940 }
941
942 var r RevokeCertificateResponse
943 if err := json.Unmarshal(resp, &r); err != nil {
944 return nil, err
945 }
946
947 // If we have a async client, we need to wait for the async result
948 if s.cs.async {
949 b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
950 if err != nil {
951 if err == AsyncTimeoutErr {
952 return &r, err
953 }
954 return nil, err
955 }
956
957 if err := json.Unmarshal(b, &r); err != nil {
958 return nil, err
959 }
960 }
961
962 return &r, nil
963}
964
965type RevokeCertificateResponse struct {
966 Displaytext string `json:"displaytext"`

Callers

nothing calls this directly

Calls 3

newPostRequestMethod · 0.80
GetAsyncJobResultMethod · 0.80
toURLValuesMethod · 0.45

Tested by

no test coverage detected