api

package
v0.9.123 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	URI_PREFIX = "/v1"
	URI_USER   = "/user"
	URI_GROUP  = "/group"
	URI_POLICY = "/policy"

	POLICY_TYPE_SYSTEM = "System"
	POLICY_TYPE_CUSTOM = "Custom"
)

Variables

This section is empty.

Functions

func AddUserToGroup

func AddUserToGroup(cli bce.Client, userName string, groupName string) error

func AttachPolicyToGroup

func AttachPolicyToGroup(cli bce.Client, args *AttachPolicyToGroupArgs) error

func AttachPolicyToUser

func AttachPolicyToUser(cli bce.Client, args *AttachPolicyToUserArgs) error

func DeleteGroup

func DeleteGroup(cli bce.Client, name string) error

func DeletePolicy

func DeletePolicy(cli bce.Client, name string) error

func DeleteUser

func DeleteUser(cli bce.Client, name string) error

func DeleteUserFromGroup

func DeleteUserFromGroup(cli bce.Client, userName string, groupName string) error

func DeleteUserLoginProfile

func DeleteUserLoginProfile(cli bce.Client, name string) error

func DetachPolicyFromGroup

func DetachPolicyFromGroup(cli bce.Client, args *DetachPolicyFromGroupArgs) error

func DetachPolicyFromUser

func DetachPolicyFromUser(cli bce.Client, args *DetachPolicyFromUserArgs) error

Types

type Acl

type Acl struct {
	Id                string     `json:"id,omitempty"`
	AccessControlList []AclEntry `json:"accessControlList"`
}

type AclEntry

type AclEntry struct {
	Eid        string   `json:"eid,omitempty"`
	Service    string   `json:"service"`
	Region     string   `json:"region"`
	Permission []string `json:"permission"`
	Resource   []string `json:"resource"`
	Effect     string   `json:"effect"`
}

type AttachPolicyToGroupArgs

type AttachPolicyToGroupArgs struct {
	GroupName  string `json:"groupName"`
	PolicyName string `json:"policyName"`
	PolicyType string `json:"policyType,omitempty"`
}

type AttachPolicyToUserArgs

type AttachPolicyToUserArgs struct {
	UserName   string `json:"userName"`
	PolicyName string `json:"policyName"`
	PolicyType string `json:"policyType,omitempty"`
}

type CreateGroupArgs

type CreateGroupArgs struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type CreateGroupResult

type CreateGroupResult GroupModel

func CreateGroup

func CreateGroup(cli bce.Client, body *bce.Body) (*CreateGroupResult, error)

type CreatePolicyArgs

type CreatePolicyArgs struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Document    string `json:"document"`
}

type CreatePolicyResult

type CreatePolicyResult PolicyModel

func CreatePolicy

func CreatePolicy(cli bce.Client, body *bce.Body) (*CreatePolicyResult, error)

type CreateUserArgs

type CreateUserArgs struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type CreateUserResult

type CreateUserResult UserModel

func CreateUser

func CreateUser(cli bce.Client, body *bce.Body) (*CreateUserResult, error)

type DetachPolicyFromGroupArgs

type DetachPolicyFromGroupArgs struct {
	GroupName  string `json:"groupName"`
	PolicyName string `json:"policyName"`
	PolicyType string `json:"policyType,omitempty"`
}

type DetachPolicyFromUserArgs

type DetachPolicyFromUserArgs struct {
	UserName   string `json:"userName"`
	PolicyName string `json:"policyName"`
	PolicyType string `json:"policyType,omitempty"`
}

type GetGroupResult

type GetGroupResult GroupModel

func GetGroup

func GetGroup(cli bce.Client, name string) (*GetGroupResult, error)

type GetPolicyResult

type GetPolicyResult PolicyModel

func GetPolicy

func GetPolicy(cli bce.Client, name, policyType string) (*GetPolicyResult, error)

type GetUserLoginProfileResult

type GetUserLoginProfileResult LoginProfileModel

func GetUserLoginProfile

func GetUserLoginProfile(cli bce.Client, name string) (*GetUserLoginProfileResult, error)

type GetUserResult

type GetUserResult UserModel

func GetUser

func GetUser(cli bce.Client, name string) (*GetUserResult, error)

type GroupModel

type GroupModel struct {
	Id          string    `json:"id"`
	Name        string    `json:"name"`
	CreateTime  time.Time `json:"createTime"`
	Description string    `json:"description"`
}

type ListGroupResult

type ListGroupResult struct {
	Groups []GroupModel `json:"groups"`
}

func ListGroup

func ListGroup(cli bce.Client) (*ListGroupResult, error)

type ListGroupsForUserResult

type ListGroupsForUserResult ListGroupResult

func ListGroupsForUser

func ListGroupsForUser(cli bce.Client, name string) (*ListGroupsForUserResult, error)

type ListPolicyResult

type ListPolicyResult struct {
	Policies []PolicyModel `json:"policies"`
}

func ListGroupAttachedPolicies

func ListGroupAttachedPolicies(cli bce.Client, name string) (*ListPolicyResult, error)

func ListPolicy

func ListPolicy(cli bce.Client, nameFilter, policyType string) (*ListPolicyResult, error)

func ListUserAttachedPolicies

func ListUserAttachedPolicies(cli bce.Client, name string) (*ListPolicyResult, error)

type ListUserResult

type ListUserResult struct {
	Users []UserModel `json:"users"`
}

func ListUser

func ListUser(cli bce.Client) (*ListUserResult, error)

type ListUsersInGroupResult

type ListUsersInGroupResult ListUserResult

func ListUsersInGroup

func ListUsersInGroup(cli bce.Client, name string) (*ListUsersInGroupResult, error)

type LoginProfileModel

type LoginProfileModel struct {
	Password          string `json:"password,omitempty"`
	NeedResetPassword bool   `json:"needResetPassword"`
	EnabledLoginMfa   bool   `json:"enabledLoginMfa"`
	LoginMfaType      string `json:"loginMfaType,omitempty"`
	ThirdPartyType    bool   `json:"thirdPartyType,omitempty"`
	ThirdPartyAccount bool   `json:"thirdPartyAccount,omitempty"`
}

type PolicyModel

type PolicyModel struct {
	Id          string    `json:"id"`
	Name        string    `json:"name"`
	Type        string    `json:"type"`
	CreateTime  time.Time `json:"createTime"`
	Description string    `json:"description"`
	Document    string    `json:"document"`
}

type UpdateGroupArgs

type UpdateGroupArgs struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type UpdateGroupResult

type UpdateGroupResult GroupModel

func UpdateGroup

func UpdateGroup(cli bce.Client, name string, body *bce.Body) (*UpdateGroupResult, error)

type UpdateUserArgs

type UpdateUserArgs struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type UpdateUserLoginProfileArgs

type UpdateUserLoginProfileArgs LoginProfileModel

type UpdateUserLoginProfileResult

type UpdateUserLoginProfileResult LoginProfileModel

func UpdateUserLoginProfile

func UpdateUserLoginProfile(cli bce.Client, name string, body *bce.Body) (*UpdateUserLoginProfileResult, error)

type UpdateUserResult

type UpdateUserResult UserModel

func UpdateUser

func UpdateUser(cli bce.Client, name string, body *bce.Body) (*UpdateUserResult, error)

type UserModel

type UserModel struct {
	Id          string    `json:"id"`
	Name        string    `json:"name"`
	CreateTime  time.Time `json:"createTime"`
	Description string    `json:"description"`
	Enabled     bool      `json:"enabled"`
}

Jump to

Keyboard shortcuts

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