reserved instanceIBM Cloud

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
ctx
Context
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
ServiceInstanceGuid
Required*
string

The GUID that uniquely identifies the IBM® MQ as a Service instance.

Possible values: length = 36, Value must match regular expression ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

Example: a2b4d4bc-dadb-4637-bcec-9b7d1e723af8

UserID
Required*
string

The id of the user.

Possible values: length = 32, Value must match regular expression /^[0-9a-fA-F]{32}$/

Examples: 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