
Download a trust store certificate - go
Download the specified trust store certificate PEM file from the queue manager.
(mqcloud *MqcloudV1) DownloadTrustStoreCertificate(downloadTrustStoreCertificateOptions *DownloadTrustStoreCertificateOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
(mqcloud *MqcloudV1) DownloadTrustStoreCertificateWithContext(ctx context.Context, downloadTrustStoreCertificateOptions *DownloadTrustStoreCertificateOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
Request
Instantiate the DownloadTrustStoreCertificateOptions struct and set the fields
to provide parameter values for the DownloadTrustStoreCertificate method.
| parameter | WithContext method only |
|---|---|
ctxContext
|
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request. |
| DownloadTrustStoreCertificateOptions | The DownloadTrustStoreCertificate options. |
|---|---|
ServiceInstanceGuidRequired*
string |
The GUID that uniquely identifies the IBM® MQ as a Service instance. Possible values: length = 36, Value must match regular expression
Example: |
QueueManagerIDRequired*
string |
The id of the queue manager to retrieve its full details. Possible values:
length = 32, Value must match regular expression
b8e1aeda078009cf3db74e90d5d42328 |
CertificateFileRequired*
io.ReadCloser |
The filename and path of the certificate to be uploaded. Possible values: 1500 ≤ length ≤ 65537 Examples:[B@36ab3814 |
Example request
downloadTrustStoreCertificateOptions := mqcloudService.NewDownloadTrustStoreCertificateOptions(
"a2b4d4bc-dadb-4637-bcec-9b7d1e723af8",
"b8e1aeda078009cf3db74e90d5d42328",
"9b7d1e723af8233",
)
result, response, err := mqcloudService.DownloadTrustStoreCertificate(downloadTrustStoreCertificateOptions)
if err != nil {
panic(err)
}
if result != nil {
defer result.Close()
outFile, err := os.Create("result.out")
if err != nil { panic(err) }
defer outFile.Close()
_, err = io.Copy(outFile, result)
if err != nil { panic(err) }
}
Response
| Status code | |
|---|---|
| 200 | OK |
| 301 | URI has permanently Moved |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Resource not found |
| 429 | Service Is Overused |
| 500 | Internal Server Error |