
Delete an application from an instance - go
Delete an application from an instance.
(mqcloud *MqcloudV1) DeleteApplication(deleteApplicationOptions *DeleteApplicationOptions) (response *core.DetailedResponse, err error)
(mqcloud *MqcloudV1) DeleteApplicationWithContext(ctx context.Context, deleteApplicationOptions *DeleteApplicationOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteApplicationOptions struct and set the fields to provide
parameter values for the DeleteApplication 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. |
| DeleteApplicationOptions | The DeleteApplication 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: |
ApplicationIDRequired*
string |
The id of the application. Possible values: length = 32, Value must match regular expression
Example: |
Example request
deleteApplicationOptions := mqcloudService.NewDeleteApplicationOptions(
"a2b4d4bc-dadb-4637-bcec-9b7d1e723af8",
"0123456789ABCDEF0123456789ABCDEF",
)
response, err := mqcloudService.DeleteApplication(deleteApplicationOptions)
if err != nil {
panic(err)
}
if response.StatusCode != 204 {
fmt.Printf("\nUnexpected response status code received from DeleteApplication(): %d\n", response.StatusCode)
}
Response
| Status code | |
|---|---|
| 204 | Resource was deleted successfully |
| 301 | URI has permanently Moved |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Resource not found |
| 429 | Service Is Overused |
| 500 | Internal Server Error |