access

package
v0.51.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MPL-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLGetResponseBody

type ACLGetResponseBody struct {
	Data []*ACLGetResponseData `json:"data,omitempty"`
}

ACLGetResponseBody contains the body from an access control list response.

type ACLGetResponseData

type ACLGetResponseData struct {
	Path          string            `json:"path"`
	Propagate     *types.CustomBool `json:"propagate,omitempty"`
	RoleID        string            `json:"roleid"`
	Type          string            `json:"type"`
	UserOrGroupID string            `json:"ugid"`
}

ACLGetResponseData contains the data from an access control list response.

type ACLUpdateRequestBody

type ACLUpdateRequestBody struct {
	Delete    *types.CustomBool `json:"delete,omitempty"    url:"delete,omitempty,int"`
	Groups    []string          `json:"groups,omitempty"    url:"groups,omitempty,comma"`
	Path      string            `json:"path"                url:"path"`
	Propagate *types.CustomBool `json:"propagate,omitempty" url:"propagate,omitempty,int"`
	Roles     []string          `json:"roles"               url:"roles,comma"`
	Users     []string          `json:"users,omitempty"     url:"users,omitempty,comma"`
}

ACLUpdateRequestBody contains the data for an access control list update request.

type Client

type Client struct {
	api.Client
}

Client is an interface for performing requests against the Proxmox 'access' API.

func (*Client) ChangeUserPassword

func (c *Client) ChangeUserPassword(ctx context.Context, id, password string) error

ChangeUserPassword changes a user's password.

func (*Client) CreateGroup

func (c *Client) CreateGroup(ctx context.Context, d *GroupCreateRequestBody) error

CreateGroup creates an access group.

func (*Client) CreateRole

func (c *Client) CreateRole(ctx context.Context, d *RoleCreateRequestBody) error

CreateRole creates an access role.

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, d *UserCreateRequestBody) error

CreateUser creates a user.

func (*Client) DeleteGroup

func (c *Client) DeleteGroup(ctx context.Context, id string) error

DeleteGroup deletes an access group.

func (*Client) DeleteRole

func (c *Client) DeleteRole(ctx context.Context, id string) error

DeleteRole deletes an access role.

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, id string) error

DeleteUser deletes an user.

func (*Client) ExpandPath

func (c *Client) ExpandPath(path string) string

ExpandPath expands a path relative to the client's base path.

func (*Client) GetACL

func (c *Client) GetACL(ctx context.Context) ([]*ACLGetResponseData, error)

GetACL retrieves the access control list.

func (*Client) GetGroup

func (c *Client) GetGroup(ctx context.Context, id string) (*GroupGetResponseData, error)

GetGroup retrieves an access group.

func (*Client) GetRole

func (c *Client) GetRole(ctx context.Context, id string) (*types.CustomPrivileges, error)

GetRole retrieves an access role.

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, id string) (*UserGetResponseData, error)

GetUser retrieves a user.

func (*Client) ListGroups

func (c *Client) ListGroups(ctx context.Context) ([]*GroupListResponseData, error)

ListGroups retrieves a list of access groups.

func (*Client) ListRoles

func (c *Client) ListRoles(ctx context.Context) ([]*RoleListResponseData, error)

ListRoles retrieves a list of access roles.

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context) ([]*UserListResponseData, error)

ListUsers retrieves a list of users.

func (*Client) UpdateACL

func (c *Client) UpdateACL(ctx context.Context, d *ACLUpdateRequestBody) error

UpdateACL updates the access control list.

func (*Client) UpdateGroup

func (c *Client) UpdateGroup(ctx context.Context, id string, d *GroupUpdateRequestBody) error

UpdateGroup updates an access group.

func (*Client) UpdateRole

func (c *Client) UpdateRole(ctx context.Context, id string, d *RoleUpdateRequestBody) error

UpdateRole updates an access role.

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, id string, d *UserUpdateRequestBody) error

UpdateUser updates a user.

type GroupCreateRequestBody

type GroupCreateRequestBody struct {
	Comment *string `json:"comment,omitempty" url:"comment,omitempty"`
	ID      string  `json:"groupid"           url:"groupid"`
}

GroupCreateRequestBody contains the data for an access group create request.

type GroupGetResponseBody

type GroupGetResponseBody struct {
	Data *GroupGetResponseData `json:"data,omitempty"`
}

GroupGetResponseBody contains the body from an access group get response.

type GroupGetResponseData

type GroupGetResponseData struct {
	Comment *string  `json:"comment,omitempty"`
	Members []string `json:"members"`
}

GroupGetResponseData contains the data from an access group get response.

type GroupListResponseBody

type GroupListResponseBody struct {
	Data []*GroupListResponseData `json:"data,omitempty"`
}

GroupListResponseBody contains the body from an access group list response.

type GroupListResponseData

type GroupListResponseData struct {
	Comment *string `json:"comment,omitempty"`
	ID      string  `json:"groupid"`
}

GroupListResponseData contains the data from an access group list response.

type GroupUpdateRequestBody

type GroupUpdateRequestBody struct {
	Comment *string `json:"comment,omitempty" url:"comment,omitempty"`
}

GroupUpdateRequestBody contains the data for an access group update request.

type RoleCreateRequestBody

type RoleCreateRequestBody struct {
	ID         string                 `json:"roleid" url:"roleid"`
	Privileges types.CustomPrivileges `json:"privs"  url:"privs,comma"`
}

RoleCreateRequestBody contains the data for an access group create request.

type RoleGetResponseBody

type RoleGetResponseBody struct {
	Data *types.CustomPrivileges `json:"data,omitempty"`
}

RoleGetResponseBody contains the body from an access group get response.

type RoleListResponseBody

type RoleListResponseBody struct {
	Data []*RoleListResponseData `json:"data,omitempty"`
}

RoleListResponseBody contains the body from an access group list response.

type RoleListResponseData

type RoleListResponseData struct {
	ID         string                  `json:"roleid"`
	Privileges *types.CustomPrivileges `json:"privs,omitempty"`
	Special    *types.CustomBool       `json:"special,omitempty"`
}

RoleListResponseData contains the data from an access group list response.

type RoleUpdateRequestBody

type RoleUpdateRequestBody struct {
	Privileges types.CustomPrivileges `json:"privs" url:"privs,comma"`
}

RoleUpdateRequestBody contains the data for an access group update request.

type UserChangePasswordRequestBody

type UserChangePasswordRequestBody struct {
	ID       string `json:"userid"   url:"userid"`
	Password string `json:"password" url:"password"`
}

UserChangePasswordRequestBody contains the data for a user password change request.

type UserCreateRequestBody

type UserCreateRequestBody struct {
	Comment        *string           `json:"comment,omitempty"   url:"comment,omitempty"`
	Email          *string           `json:"email,omitempty"     url:"email,omitempty"`
	Enabled        *types.CustomBool `json:"enable,omitempty"    url:"enable,omitempty,int"`
	ExpirationDate *int64            `json:"expire,omitempty"    url:"expire,omitempty"`
	FirstName      *string           `json:"firstname,omitempty" url:"firstname,omitempty"`
	Groups         []string          `json:"groups,omitempty"    url:"groups,omitempty,comma"`
	ID             string            `json:"userid"              url:"userid"`
	Keys           *string           `json:"keys,omitempty"      url:"keys,omitempty"`
	LastName       *string           `json:"lastname,omitempty"  url:"lastname,omitempty"`
	Password       string            `json:"password"            url:"password,omitempty"`
}

UserCreateRequestBody contains the data for a user create request.

type UserGetResponseBody

type UserGetResponseBody struct {
	Data *UserGetResponseData `json:"data,omitempty"`
}

UserGetResponseBody contains the body from a user get response.

type UserGetResponseData

type UserGetResponseData struct {
	Comment        *string           `json:"comment,omitempty"`
	Email          *string           `json:"email,omitempty"`
	Enabled        *types.CustomBool `json:"enable,omitempty"`
	ExpirationDate *int64            `json:"expire,omitempty"`
	FirstName      *string           `json:"firstname,omitempty"`
	Groups         *[]string         `json:"groups,omitempty"`
	Keys           *string           `json:"keys,omitempty"`
	LastName       *string           `json:"lastname,omitempty"`
}

UserGetResponseData contains the data from an user get response.

type UserListResponseBody

type UserListResponseBody struct {
	Data []*UserListResponseData `json:"data,omitempty"`
}

UserListResponseBody contains the body from a user list response.

type UserListResponseData

type UserListResponseData struct {
	Comment        *string           `json:"comment,omitempty"`
	Email          *string           `json:"email,omitempty"`
	Enabled        *types.CustomBool `json:"enable,omitempty"`
	ExpirationDate *int64            `json:"expire,omitempty"`
	FirstName      *string           `json:"firstname,omitempty"`
	Groups         *[]string         `json:"groups,omitempty"`
	ID             string            `json:"userid"`
	Keys           *string           `json:"keys,omitempty"`
	LastName       *string           `json:"lastname,omitempty"`
}

UserListResponseData contains the data from an user list response.

type UserUpdateRequestBody

type UserUpdateRequestBody struct {
	Append         *types.CustomBool `json:"append,omitempty"    url:"append,omitempty"`
	Comment        *string           `json:"comment,omitempty"   url:"comment,omitempty"`
	Email          *string           `json:"email,omitempty"     url:"email,omitempty"`
	Enabled        *types.CustomBool `json:"enable,omitempty"    url:"enable,omitempty,int"`
	ExpirationDate *int64            `json:"expire,omitempty"    url:"expire,omitempty,int"`
	FirstName      *string           `json:"firstname,omitempty" url:"firstname,omitempty"`
	Groups         []string          `json:"groups,omitempty"    url:"groups,omitempty,comma"`
	Keys           *string           `json:"keys,omitempty"      url:"keys,omitempty"`
	LastName       *string           `json:"lastname,omitempty"  url:"lastname,omitempty"`
}

UserUpdateRequestBody contains the data for an user update request.

Jump to

Keyboard shortcuts

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