Documentation ¶
Index ¶
- Constants
- Variables
- type BaseRole
- type BulkCreateUserSummary
- type NRAccount
- type NRClient
- func (nr *NRClient) BulkCreateUser(ctx context.Context, data ...ParamCreateUser) []BulkCreateUserSummary
- func (nr *NRClient) CreateUser(ctx context.Context, param ParamCreateUser) error
- func (nr *NRClient) FindUserAccount(ctx context.Context, email string) ([]NRUser, error)
- func (nr *NRClient) GetAccountList(ctx context.Context) ([]NRAccount, error)
- func (nr *NRClient) GetAddOnRoles(ctx context.Context, nrAccountID int64) ([]NRUserRoles, error)
- func (nr *NRClient) GetAllUserUnderAccount(ctx context.Context, nrAccountID int64) ([]NRUser, error)
- func (nr *NRClient) GetUserUnderAccount(ctx context.Context, email string, nrAccountID int64) (NRUser, error)
- func (nr *NRClient) RemoveUserFromAccount(ctx context.Context, email string, nrAccountID int64) error
- func (nr *NRClient) UpdateUserAddOnRoles(ctx context.Context, nrAccountID int64, userID int64, roles []int64) error
- type NRUser
- type NRUserRoles
- type Option
- type ParamCreateUser
- type UserType
Constants ¶
View Source
const ( UserTypeBasic UserType = 1 UserTypeFull UserType = 0 UserBaseRoleAdmin BaseRole = "admin" UserBaseRoleUser BaseRole = "user" UserBaseRoleRestricted BaseRole = "restricted" )
View Source
const (
DeleteUsers = `https://rpm.newrelic.com/user_management/accounts/%v/users/%v`
)
Variables ¶
View Source
var (
ErrUserNotFound = errors.New("user not found")
)
Functions ¶
This section is empty.
Types ¶
type BulkCreateUserSummary ¶
type BulkCreateUserSummary struct { Data ParamCreateUser `json:"data"` Success bool `json:"success"` Err error `json:"err"` }
BulkCreateUserSummary struct
type NRClient ¶
type NRClient struct {
// contains filtered or unexported fields
}
NRClient client
func (*NRClient) BulkCreateUser ¶
func (nr *NRClient) BulkCreateUser(ctx context.Context, data ...ParamCreateUser) []BulkCreateUserSummary
BulkCreateUser create new user in bulk
func (*NRClient) CreateUser ¶
func (nr *NRClient) CreateUser(ctx context.Context, param ParamCreateUser) error
CreateUser create new user
func (*NRClient) FindUserAccount ¶
FindUserAccount find user from all available account
func (*NRClient) GetAccountList ¶
GetAccountList get all available nr accounts
func (*NRClient) GetAddOnRoles ¶
GetAddOnRoles get available addon roles under account
func (*NRClient) GetAllUserUnderAccount ¶ added in v1.7.0
func (*NRClient) GetUserUnderAccount ¶
func (nr *NRClient) GetUserUnderAccount(ctx context.Context, email string, nrAccountID int64) (NRUser, error)
GetUserUnderAccount get user under specific account
type NRUser ¶
type NRUser struct { UserID int64 `json:"user_id"` AccountID int64 `json:"account_id"` AccountName string `json:"account_name,omitempty"` FullName string `json:"full_name"` Email string `json:"email"` LastAccessAt int64 `json:"last_access_at"` LastAccessTime time.Time `json:"last_access_time"` Title interface{} `json:"title"` Status string `json:"status"` Roles []NRUserRoles `json:"roles"` UserTierID int `json:"user_tier_id"` }
NRUser new relic user
type NRUserRoles ¶
type NRUserRoles struct { ID int64 `json:"id"` AccountID interface{} `json:"account_id"` Name string `json:"name"` DisplayName string `json:"display_name"` Type string `json:"type"` BatchIds []int `json:"batch_ids"` GrantCount int `json:"grant_count"` }
NRUserRoles struct
Click to show internal directories.
Click to hide internal directories.