user

package
v1.5.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAccessJoinRequest

type APIAccessJoinRequest struct {
	// ID of the user whose membership will be updated.
	// Required: true
	UserID string `url:"userId" json:"userId" validate:"required"`

	// ID of the API access group to join
	// Required: true
	APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"`
}

Request struct for joining user into apiaccess group.

type APIAccessLeaveRequest

type APIAccessLeaveRequest struct {
	// ID of the user whose membership will be updated.
	// Required: true
	UserID string `url:"userId" json:"userId" validate:"required"`

	// ID of the API access group to leave.
	// Required: true
	APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"`
}

Request struct for leaving user from apiaccess group.

type APIAccessListRequest

type APIAccessListRequest struct {
	// ID of the user to list API access groups for.
	// Required: true
	UserID string `url:"userId" json:"userId" validate:"required"`
}

Request struct for showing list of dicts with information about apiaccess groups contains to the user.

type APIListRequest

type APIListRequest struct {
	// ID of the user.
	// Required: true
	UserID string `url:"userId" json:"userId" validate:"required"`
}

Request struct for getting API list.

type APIsEndpoints

type APIsEndpoints struct {
	// CloudAPI endpoints
	CloudAPI CloudAPIEndpoints `json:"cloudapi,omitempty"`

	// CloudBroker endpoints
	CloudBroker CloudBrokerEndpoints `json:"cloudbroker,omitempty"`

	// LibCloud endpoints
	LibCloud LibCloudEndpoints `json:"libcloud,omitempty"`

	// System endpoints
	System SystemEndpoints `json:"system,omitempty"`
}

type CloudAPIEndpoints

type CloudAPIEndpoints struct {
	Account        []string `json:"account,omitempty"`
	BService       []string `json:"bservice,omitempty"`
	CloudSpace     []string `json:"cloudspace,omitempty"`
	Compute        []string `json:"compute,omitempty"`
	ComputeCI      []string `json:"computeci,omitempty"`
	Disks          []string `json:"disks,omitempty"`
	ExtNet         []string `json:"extnet,omitempty"`
	FLIPGroup      []string `json:"flipgroup,omitempty"`
	GPU            []string `json:"gpu,omitempty"`
	Image          []string `json:"image,omitempty"`
	K8CI           []string `json:"k8ci,omitempty"`
	K8S            []string `json:"k8s,omitempty"`
	KVMPPC         []string `json:"kvmppc,omitempty"`
	KVMX86         []string `json:"kvmx86,omitempty"`
	LB             []string `json:"lb,omitempty"`
	Loactions      []string `json:"locations,omitempty"`
	Machine        []string `json:"machine,omitempty"`
	Openshift      []string `json:"openshift,omitempty"`
	OpenshiftCI    []string `json:"openshiftci,omitempty"`
	PCIDevice      []string `json:"pcidevice,omitempty"`
	PortForwarding []string `json:"portforwarding,omitempty"`
	Prometheus     []string `json:"prometheus,omitempty"`
	RG             []string `json:"rg,omitempty"`
	Sizes          []string `json:"sizes,omitempty"`
	Tasks          []string `json:"tasks,omitempty"`
	User           []string `json:"user,omitempty"`
	VGPU           []string `json:"vgpu,omitempty"`
	VINS           []string `json:"vins,omitempty"`
	All            bool     `json:"ALL,omitempty"`
}

type CloudBrokerEndpoints

type CloudBrokerEndpoints struct {
	Account        []string `json:"account,omitempty"`
	APIAccess      []string `json:"apiaccess,omitempty"`
	Audit          []string `json:"audit,omitempty"`
	AuditBeat      []string `json:"auditbeat,omitempty"`
	AuditCollector []string `json:"auditcollector,omitempty"`
	BackupCreator  []string `json:"backupcreator,omitempty"`
	BService       []string `json:"bservice,omitempty"`
	CloudSpace     []string `json:"cloudspace,omitempty"`
	Compute        []string `json:"compute,omitempty"`
	ComputeCI      []string `json:"computeci,omitempty"`
	Desnode        []string `json:"desnode,omitempty"`
	Diagnostics    []string `json:"diagnostics,omitempty"`
	Disks          []string `json:"disks,omitempty"`
	Eco            []string `json:"eco,omitempty"`
	ExtNet         []string `json:"extnet,omitempty"`
	FlIPgroup      []string `json:"flipgroup,omitempty"`
	Grid           []string `json:"grid,omitempty"`
	Group          []string `json:"group,omitempty"`
	Health         []string `json:"health,omitempty"`
	IaaS           []string `json:"iaas,omitempty"`
	Image          []string `json:"image,omitempty"`
	Job            []string `json:"job,omitempty"`
	K8CI           []string `json:"k8ci,omitempty"`
	K8S            []string `json:"k8s,omitempty"`
	KVMPPC         []string `json:"kvmppc,omitempty"`
	KVMX86         []string `json:"kvmx86,omitempty"`
	LB             []string `json:"lb,omitempty"`
	Machine        []string `json:"machine,omitempty"`
	Metering       []string `json:"metering,omitempty"`
	Milestones     []string `json:"milestones,omitempty"`
	Node           []string `json:"node,omitempty"`
	Openshift      []string `json:"openshift,omitempty"`
	OpenshiftCI    []string `json:"openshiftci,omitempty"`
	Ovsnode        []string `json:"ovsnode,omitempty"`
	PCIDevice      []string `json:"pcidevice,omitempty"`
	PGPU           []string `json:"pgpu,omitempty"`
	Prometheus     []string `json:"prometheus,omitempty"`
	QOS            []string `json:"qos,omitempty"`
	Resmon         []string `json:"resmon,omitempty"`
	RG             []string `json:"rg,omitempty"`
	Sep            []string `json:"sep,omitempty"`
	Stack          []string `json:"stack,omitempty"`
	Tasks          []string `json:"tasks,omitempty"`
	TLock          []string `json:"tlock,omitempty"`
	User           []string `json:"user,omitempty"`
	VGPU           []string `json:"vgpu,omitempty"`
	VINS           []string `json:"vins,omitempty"`
	VNFDev         []string `json:"vnfdev,omitempty"`
	ZeroAccess     []string `json:"zeroaccess,omitempty"`
	All            bool     `json:"ALL,omitempty"`
}

type CreateRequest

type CreateRequest struct {
	// ID of user.
	// Required: true
	Username string `url:"username" json:"username" validate:"required"`

	// Email addresses of the user.
	// Required: true
	EmailAddress []string `url:"emailaddress" json:"emailaddress" validate:"required"`

	// Password of user
	// Required: false
	Password string `url:"password,omitempty" json:"password,omitempty"`

	// List of groups this user belongs to.
	// Required: false
	Groups []string `url:"groups,omitempty" json:"groups,omitempty"`

	// List of apiaccess groups this user belongs to.
	// Required: false
	APIAccess []uint64 `url:"apiaccess,omitempty" json:"apiaccess,omitempty"`
}

Request struct for creating a user.

type DeleteByGUIDRequest

type DeleteByGUIDRequest struct {
	// GUID of user.
	// Required: true
	GUID string `url:"userguid" json:"userguid" validate:"required"`
}

Request struct for deleting a user using user's GUID.

type DeleteRequest

type DeleteRequest struct {
	// ID of user.
	// Required: true
	Username string `url:"username" json:"username" validate:"required"`
}

Request struct for deleting a user.

type DeleteUsersRequest

type DeleteUsersRequest struct {
	// List of user ids
	UserIDs string
}

Request struct for bulk delete a list of users.

type GetAuditRequest

type GetAuditRequest struct {
	// Name of user (get audits for current user if set to empty).
	// Required: false
	Username string `url:"username,omitempty" json:"username,omitempty"`

	// Page number.
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size, maximum - 100.
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

Request struct for getting user's audits.

type GetMatchingUsernamesRequest

type GetMatchingUsernamesRequest struct {
	// Regex of the usernames to searched for.
	// Required: true
	UsernameRegex string `url:"usernameregex" json:"usernameregex" validate:"required"`

	// The number of usernames to return.
	// Required: true
	Limit uint64 `url:"limit" json:"limit" validate:"required"`
}

Request struct for getting a list of the matching usernames for a given string.

type GetRequest

type GetRequest struct {
	// ID of the user.
	// Required: true
	UserID string `url:"userId" json:"userId" validate:"required"`
}

Request struct for getting user details.

type ItemAPIAccess

type ItemAPIAccess struct {
	// Description
	Description string `json:"desc"`

	// ID
	ID uint64 `json:"id"`

	// Name
	Name string `json:"name"`
}

type ItemAudit

type ItemAudit struct {
	// Call
	Call string `json:"Call"`

	// Response time
	ResponseTime ResponseTime `json:"Response Time"`

	// StatusCode
	StatusCode StatusCode `json:"Status Code"`

	// Time
	Time float64 `json:"Time"`
}

type ItemMatchingUsername

type ItemMatchingUsername struct {
	// Gravatar URL
	GravatarURL string `json:"gravatarurl"`

	// Username
	Username string `json:"username"`
}

type ItemUser

type ItemUser struct {
	// CKey
	CKey string `json:"_ckey"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// Is active
	Active bool `json:"active"`

	// APIAccess
	APIAccess []uint64 `json:"apiaccess"`

	// AuthKey
	AuthKey string `json:"authkey"`

	// AuthKeys
	AuthKeys []interface{}

	// Data
	Data string `json:"data"`

	// Description
	Description string `json:"description"`

	// Domain
	Domain string `json:"domain"`

	// Emails
	Emails []string `json:"emails"`

	// GID
	GID uint64 `json:"gid"`

	// Groups
	Groups []string `json:"groups"`

	// GUID
	GUID string `json:"guid"`

	// ID
	ID string `json:"id"`

	// LastCheck
	LastCheck uint64 `json:"lastcheck"`

	// Mobile
	Mobile []interface{} `json:"mobile"`

	// Password
	Password string `json:"password"`

	// Protected
	Protected bool `json:"protected"`

	// Roles
	Roles []interface{} `json:"roles"`

	// ServiceAccount
	ServiceAccount bool `json:"serviceaccount"`

	// XMPP
	XMPP []interface{} `json:"xmpp"`
}

type LibCloudEndpoints

type LibCloudEndpoints struct {
	Libvirt []string `json:"libvirt,omitempty"`
	All     bool     `json:"ALL,omitempty"`
}

type ListAPIAccess

type ListAPIAccess []ItemAPIAccess

type ListAudits

type ListAudits []ItemAudit

type ListMatchingUsernames

type ListMatchingUsernames []ItemMatchingUsername

type ListRequest

type ListRequest struct {
	// Find by ID.
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by active. True or False.
	// Required: false
	Active bool `url:"active,omitempty" json:"active,omitempty"`

	// Find by serviceaccount. True or False.
	// Required: false
	ServiceAccount bool `url:"serviceaccount,omitempty" json:"serviceaccount,omitempty"`

	// Page number.
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size, maximum - 100.
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

Request struct for getting all non deleted user instances.

type ListUsers

type ListUsers struct {
	Data []ItemUser `json:"data"`

	EntryCount uint64 `json:"entryCount"`
}

type ResponseTime

type ResponseTime float64

func (*ResponseTime) UnmarshalJSON

func (r *ResponseTime) UnmarshalJSON(b []byte) error

type StatusCode

type StatusCode int64

func (*StatusCode) UnmarshalJSON

func (s *StatusCode) UnmarshalJSON(b []byte) error

type SystemEndpoints

type SystemEndpoints struct {
	AgentController       []string `json:"agentcontroller,omitempty"`
	Alerts                []string `json:"alerts,omitempty"`
	Audits                []string `json:"audits,omitempty"`
	ContentManager        []string `json:"contentmanager,omitempty"`
	DocGenerator          []string `json:"docgenerator,omitempty"`
	EmailSender           []string `json:"emailsender,omitempty"`
	ErrorConditionHandler []string `json:"errorconditionhandler,omitempty"`
	GridManager           []string `json:"gridmanager,omitempty"`
	Health                []string `json:"health,omitempty"`
	Info                  []string `json:"info,omitempty"`
	InfoMGR               []string `json:"infomgr,omitempty"`
	Job                   []string `json:"job,omitempty"`
	Log                   []string `json:"log,omitempty"`
	Oauth                 []string `json:"oauth,omitempty"`
	Task                  []string `json:"task,omitempty"`
	UserManager           []string `json:"usermanager,omitempty"`
	All                   bool     `json:"ALL,omitempty"`
}

type User

type User struct {
	// contains filtered or unexported fields
}

Structure for creating request to User

func New

func New(client interfaces.Caller) *User

Builder for User endpoints

func (User) APIAccessJoin

func (u User) APIAccessJoin(ctx context.Context, req APIAccessJoinRequest) (bool, error)

APIAccessJoin joins user into apiaccess group.

func (User) APIAccessLeave

func (u User) APIAccessLeave(ctx context.Context, req APIAccessLeaveRequest) (bool, error)

APIAccessLeave leaves user from apiaccess group.

func (User) APIAccessList

func (u User) APIAccessList(ctx context.Context, req APIAccessListRequest) (ListAPIAccess, error)

APIAccessList shows list of dicts with information about apiaccess groups contains to the user.

func (User) APIList

func (u User) APIList(ctx context.Context, req APIListRequest) (*APIsEndpoints, error)

APIList gets a list of all API functions that a given user has access to according to their apiaccess group membership.

func (User) Create

func (u User) Create(ctx context.Context, req CreateRequest) (bool, error)

Create creates a user.

func (User) Delete

func (u User) Delete(ctx context.Context, req DeleteRequest) (bool, error)

Delete deletes a user.

func (User) DeleteByGUID

func (u User) DeleteByGUID(ctx context.Context, req DeleteByGUIDRequest) (bool, error)

DeleteByGUID deletes a user using user's GUID. Note: This actor can also be called using username instead of guid to workaround CBGrid allowing userguid or username.

func (User) DeleteUsers

func (u User) DeleteUsers(ctx context.Context, req DeleteUsersRequest) (bool, error)

DeleteUsers bulk delete a list of users.

func (User) Get

func (u User) Get(ctx context.Context, req GetRequest) (*ItemUser, error)

Get gets user details.

func (User) GetAudit

func (u User) GetAudit(ctx context.Context, req GetAuditRequest) (ListAudits, error)

GetAudits gets user's audits.

func (User) GetMatchingUsernames

func (u User) GetMatchingUsernames(ctx context.Context, req GetMatchingUsernamesRequest) (ListMatchingUsernames, error)

GetMatchingUsernames gets a list of the matching usernames for a given string.

func (User) List

func (u User) List(ctx context.Context, req ListRequest) (*ListUsers, error)

List gets all non deleted user instances.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL