
Delete a user for an instance - go
Delete a user for an instance.
(mqcloud *MqcloudV1) DeleteUser(deleteUserOptions *DeleteUserOptions) (response *core.DetailedResponse, err error)
(mqcloud *MqcloudV1) DeleteUserWithContext(ctx context.Context, deleteUserOptions *DeleteUserOptions) (response *core.DetailedResponse, err error)
Request
Instantiate the DeleteUserOptions struct and set the fields to provide parameter
values for the DeleteUser 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. |
| DeleteUserOptions | The DeleteUser 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: |
UserIDRequired*
string |
The id of the user. Possible values: length = 32, Value must match regular
expression 31a413dd84346effc8895b6ba4641641 |
Example request
deleteUserOptions := mqcloudService.NewDeleteUserOptions(
"a2b4d4bc-dadb-4637-bcec-9b7d1e723af8",
"31a413dd84346effc8895b6ba4641641",
)
response, err := mqcloudService.DeleteUser(deleteUserOptions)
if err != nil {
panic(err)
}
if response.StatusCode != 204 {
fmt.Printf("\nUnexpected response status code received from DeleteUser(): %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 |