All URIs are relative to https://api.au.sumologic.com/api
Method | HTTP request | Description |
---|---|---|
CreateUser | Post /v1/users | Create a new user. |
DeleteUser | Delete /v1/users/{id} | Delete a user. |
DisableMfa | Put /v1/users/{id}/mfa/disable | Disable MFA for user. |
GetUser | Get /v1/users/{id} | Get a user. |
ListUsers | Get /v1/users | Get a list of users. |
RequestChangeEmail | Post /v1/users/{id}/email/requestChange | Change email address. |
ResetPassword | Post /v1/users/{id}/password/reset | Reset password. |
UnlockUser | Post /v1/users/{id}/unlock | Unlock a user. |
UpdateUser | Put /v1/users/{id} | Update a user. |
UserModel CreateUser(ctx).CreateUserDefinition(createUserDefinition).Execute()
Create a new user.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
createUserDefinition := *openapiclient.NewCreateUserDefinition("John", "Doe", "johndoe@acme.com", []string{"RoleIds_example"}) // CreateUserDefinition | Information about the new user.
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.CreateUser(context.Background()).CreateUserDefinition(createUserDefinition).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.CreateUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateUser`: UserModel
fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.CreateUser`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
createUserDefinition | CreateUserDefinition | Information about the new user. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteUser(ctx, id).TransferTo(transferTo).DeleteContent(deleteContent).Execute()
Delete a user.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | Identifier of the user to delete.
transferTo := "transferTo_example" // string | Identifier of the user to receive the transfer of content from the deleted user. <br> **Note:** If `deleteContent` is not set to `true`, and no user identifier is specified in `transferTo`, content from the deleted user is transferred to the executing user. (optional)
deleteContent := true // bool | Whether to delete content from the deleted user or not. <br> **Warning:** If `deleteContent` is set to `true`, all of the content for the user being deleted is permanently deleted and cannot be recovered. (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.DeleteUser(context.Background(), id).TransferTo(transferTo).DeleteContent(deleteContent).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.DeleteUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Identifier of the user to delete. |
Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
transferTo | string | Identifier of the user to receive the transfer of content from the deleted user. <br> Note: If `deleteContent` is not set to `true`, and no user identifier is specified in `transferTo`, content from the deleted user is transferred to the executing user. | deleteContent | bool | Whether to delete content from the deleted user or not. <br> Warning: If `deleteContent` is set to `true`, all of the content for the user being deleted is permanently deleted and cannot be recovered. |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DisableMfa(ctx, id).DisableMfaRequest(disableMfaRequest).Execute()
Disable MFA for user.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | Identifier of the user to disable MFA for.
disableMfaRequest := *openapiclient.NewDisableMfaRequest("johndoe@cme.com", "Password_example") // DisableMfaRequest | Email and Password of the user to disable MFA for.
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.DisableMfa(context.Background(), id).DisableMfaRequest(disableMfaRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.DisableMfa``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Identifier of the user to disable MFA for. |
Other parameters are passed through a pointer to a apiDisableMfaRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
disableMfaRequest | DisableMfaRequest | Email and Password of the user to disable MFA for. |
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserModel GetUser(ctx, id).Execute()
Get a user.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | Identifier of user to return.
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.GetUser(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.GetUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetUser`: UserModel
fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.GetUser`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Identifier of user to return. |
Other parameters are passed through a pointer to a apiGetUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUserModelsResponse ListUsers(ctx).Limit(limit).Token(token).SortBy(sortBy).Email(email).Execute()
Get a list of users.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
limit := int32(56) // int32 | Limit the number of users returned in the response. The number of users returned may be less than the `limit`. (optional) (default to 100)
token := "token_example" // string | Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. `token` is set to null when no more pages are left. (optional)
sortBy := "sortBy_example" // string | Sort the list of users by the `firstName`, `lastName`, or `email` field. (optional)
email := "email_example" // string | Find user with the given email address. (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.ListUsers(context.Background()).Limit(limit).Token(token).SortBy(sortBy).Email(email).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.ListUsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListUsers`: ListUserModelsResponse
fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.ListUsers`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListUsersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
limit | int32 | Limit the number of users returned in the response. The number of users returned may be less than the `limit`. | [default to 100] |
token | string | Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. `token` is set to null when no more pages are left. | |
sortBy | string | Sort the list of users by the `firstName`, `lastName`, or `email` field. | |
string | Find user with the given email address. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RequestChangeEmail(ctx, id).ChangeEmailRequest(changeEmailRequest).Execute()
Change email address.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | Identifier of the user to change email address.
changeEmailRequest := *openapiclient.NewChangeEmailRequest("johndoe@acme.com") // ChangeEmailRequest | New email address of the user.
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.RequestChangeEmail(context.Background(), id).ChangeEmailRequest(changeEmailRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.RequestChangeEmail``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Identifier of the user to change email address. |
Other parameters are passed through a pointer to a apiRequestChangeEmailRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
changeEmailRequest | ChangeEmailRequest | New email address of the user. |
(empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ResetPassword(ctx, id).Execute()
Reset password.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | Identifier of the user to reset password.
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.ResetPassword(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.ResetPassword``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Identifier of the user to reset password. |
Other parameters are passed through a pointer to a apiResetPasswordRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UnlockUser(ctx, id).Execute()
Unlock a user.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | The id of the user that needs to be unlocked.
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.UnlockUser(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.UnlockUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | The id of the user that needs to be unlocked. |
Other parameters are passed through a pointer to a apiUnlockUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserModel UpdateUser(ctx, id).UpdateUserDefinition(updateUserDefinition).Execute()
Update a user.
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "id_example" // string | Identifier of the user to update.
updateUserDefinition := *openapiclient.NewUpdateUserDefinition("John", "Doe", true, []string{"RoleIds_example"}) // UpdateUserDefinition | Information to update about the user.
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.UserManagementApi.UpdateUser(context.Background(), id).UpdateUserDefinition(updateUserDefinition).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.UpdateUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateUser`: UserModel
fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.UpdateUser`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
id | string | Identifier of the user to update. |
Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateUserDefinition | UpdateUserDefinition | Information to update about the user. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]