api

package
v0.9.185 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 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"
	URI_ENTITY    = "/entity"
	URI_ACCESSKEY = "/accesskey"
	URI_ROLE      = "/role"

	SUB_USER = "/subUser"

	POLICY_TYPE_SYSTEM = "System"
	POLICY_TYPE_CUSTOM = "Custom"

	ACCESSKEY_STATUS_ENABLE  = "enable"
	ACCESSKEY_STATUS_DISABLE = "disable"
)

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 AttachPolicyToRole added in v0.9.137

func AttachPolicyToRole(cli bce.Client, args *AttachPolicyToRoleArgs) error

func AttachPolicyToUser

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

func DeleteAccessKey added in v0.9.137

func DeleteAccessKey(cli bce.Client, userName, accessKeyId string) error

func DeleteGroup

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

func DeletePolicy

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

func DeleteRole added in v0.9.137

func DeleteRole(cli bce.Client, roleName 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 DetachPolicyFromRole added in v0.9.137

func DetachPolicyFromRole(cli bce.Client, args *DetachPolicyToRoleArgs) error

func DetachPolicyFromUser

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

func UserOperationMfaSwitch added in v0.9.144

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

Types

type AccessKeyModel added in v0.9.137

type AccessKeyModel struct {
	Id           string    `json:"id"`
	Secret       string    `json:"secret"`
	CreateTime   time.Time `json:"createTime"`
	LastUsedTime time.Time `json:"lastUsedTime"`
	Enabled      bool      `json:"enabled"`
	Description  string    `json:"description"`
}

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,omitempty"`
	Grantee    []Grantee `json:"grantee,omitempty"`
	Effect     string    `json:"effect"`
}

type AttachPolicyToGroupArgs

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

type AttachPolicyToRoleArgs added in v0.9.137

type AttachPolicyToRoleArgs struct {
	RoleName   string `json:"roleName"`
	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 CreateAccessKeyResult added in v0.9.137

type CreateAccessKeyResult AccessKeyModel

func CreateAccessKey added in v0.9.137

func CreateAccessKey(cli bce.Client, userName string) (*CreateAccessKeyResult, error)

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 CreateRoleArgs added in v0.9.137

type CreateRoleArgs struct {
	Name                     string `json:"name"`
	Description              string `json:"description,omitempty"`
	AssumeRolePolicyDocument string `json:"assumeRolePolicyDocument"`
}

type CreateRoleResult added in v0.9.137

type CreateRoleResult RoleModel

func CreateRole added in v0.9.137

func CreateRole(cli bce.Client, body *bce.Body) (*CreateRoleResult, 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 DetachPolicyToRoleArgs added in v0.9.137

type DetachPolicyToRoleArgs struct {
	RoleName   string `json:"roleName"`
	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 GetRoleResult added in v0.9.137

type GetRoleResult RoleModel

func GetRole added in v0.9.137

func GetRole(cli bce.Client, roleName string) (*GetRoleResult, 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 Grantee added in v0.9.137

type Grantee struct {
	ID string `json:"id"`
}

type GroupModel

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

type ListAccessKeyResult added in v0.9.137

type ListAccessKeyResult struct {
	AccessKeys []AccessKeyModel `json:"accessKeys"`
}

func ListAccessKey added in v0.9.137

func ListAccessKey(cli bce.Client, userName string) (*ListAccessKeyResult, error)

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 ListPolicyAttachedEntityResult added in v0.9.175

type ListPolicyAttachedEntityResult struct {
	PolicyAttachedEntities []PolicyAttachedEntity `json:"entities"`
}

func ListPolicyAttachedEntities added in v0.9.175

func ListPolicyAttachedEntities(cli bce.Client, policyId string) (*ListPolicyAttachedEntityResult, 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 ListRoleAttachedPolicies added in v0.9.137

func ListRoleAttachedPolicies(cli bce.Client, roleName string) (*ListPolicyResult, error)

func ListUserAttachedPolicies

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

type ListRoleResult added in v0.9.137

type ListRoleResult struct {
	Roles []RoleModel `json:"roles"`
}

func ListRole added in v0.9.137

func ListRole(cli bce.Client) (*ListRoleResult, 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"`
	EnabledLogin      bool   `json:"enabledLogin"`
	EnabledLoginMfa   bool   `json:"enabledLoginMfa"`
	LoginMfaType      string `json:"loginMfaType,omitempty"`
	ThirdPartyType    bool   `json:"thirdPartyType,omitempty"`
	ThirdPartyAccount bool   `json:"thirdPartyAccount,omitempty"`
}

type PolicyAttachedEntity added in v0.9.175

type PolicyAttachedEntity struct {
	Id         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Type       string    `json:"type,omitempty"`
	AttachTime time.Time `json:"attachTime,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 RoleModel added in v0.9.137

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

type UpdateAccessKeyResult added in v0.9.137

type UpdateAccessKeyResult AccessKeyModel

func DisableAccessKey added in v0.9.137

func DisableAccessKey(cli bce.Client, userName, accessKeyId string) (*UpdateAccessKeyResult, error)

func EnableAccessKey added in v0.9.137

func EnableAccessKey(cli bce.Client, userName, accessKeyId string) (*UpdateAccessKeyResult, error)

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 UpdateRoleArgs added in v0.9.137

type UpdateRoleArgs struct {
	Description              string `json:"description"`
	AssumeRolePolicyDocument string `json:"assumeRolePolicyDocument,omitempty"`
}

type UpdateRoleResult added in v0.9.137

type UpdateRoleResult RoleModel

func UpdateRole added in v0.9.137

func UpdateRole(cli bce.Client, roleName string, body *bce.Body) (*UpdateRoleResult, error)

type UpdateSubUserArgs added in v0.9.144

type UpdateSubUserArgs struct {
	Password string `json:"password,omitempty"`
	Provider string `json:"provider,omitempty"`
	Enable   bool   `json:"enable"`
}

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 SubUserUpdate added in v0.9.144

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

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"`
}

type UserSwitchMfaArgs added in v0.9.144

type UserSwitchMfaArgs struct {
	UserName   string `json:"userName,omitempty"`
	EnabledMfa bool   `json:"enabledMfa"`
	MfaType    string `json:"mfaType,omitempty"`
}

Jump to

Keyboard shortcuts

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