ram

package
v0.0.0-...-f8f9ceb Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RAMDefaultEndpoint is the default API endpoint of RAM services
	RAMDefaultEndpoint = "https://ram.aliyuncs.com"
	RAMAPIVersion      = "2015-05-01"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	AccessKeyId     string
	AccessKeySecret string
	Status          State
	CreateDate      string
}

type AccessKeyListResponse

type AccessKeyListResponse struct {
	RamCommonResponse
	AccessKeys struct {
		AccessKey []AccessKey
	}
}

type AccessKeyResponse

type AccessKeyResponse struct {
	RamCommonResponse
	AccessKey AccessKey
}

type AccountAlias

type AccountAlias string

AccountAlias 类型:String 必须:是 描述:指定云账号的别名, 长度限制为3-63个字符 限制:^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$

type AccountAliasResponse

type AccountAliasResponse struct {
	RamCommonResponse
	AccountAlias string
}

TODO implement ram api about security

SetAccountAlias()
GetAccountAlias()
ClearAccountAlias()
SetPasswordPolicy()
GetPasswordPolicy()

type AssumeRolePolicyDocument

type AssumeRolePolicyDocument struct {
	Statement []AssumeRolePolicyItem
	Version   string
}

type AssumeRolePolicyItem

type AssumeRolePolicyItem struct {
	Action    string
	Effect    string
	Principal AssumeRolePolicyPrincpal
}

type AssumeRolePolicyPrincpal

type AssumeRolePolicyPrincpal struct {
	RAM []string
}

type AttachPolicyRequest

type AttachPolicyRequest struct {
	PolicyRequest
	UserName string
}

type AttachPolicyToRoleRequest

type AttachPolicyToRoleRequest struct {
	PolicyRequest
	RoleName string
}

type Group

type Group struct {
}

type ListRoleResponse

type ListRoleResponse struct {
	RamCommonResponse
	Roles struct {
		Role []Role
	}
}

type ListUserRequest

type ListUserRequest struct {
	Marker   string
	MaxItems int8
}

type ListUserResponse

type ListUserResponse struct {
	RamCommonResponse
	IsTruncated bool
	Marker      string
	Users       struct {
		User []User
	}
}

type LoginProfile

type LoginProfile struct {
}

type MFADevice

type MFADevice struct {
}

type PasswordPolicy

type PasswordPolicy struct {
	MinimumPasswordLength      int8
	RequireLowercaseCharacters bool
	RequireUppercaseCharacters bool
	RequireNumbers             bool
	RequireSymbols             bool
}

type PasswordPolicyRequest

type PasswordPolicyRequest struct {
	PasswordPolicy
}

type PasswordPolicyResponse

type PasswordPolicyResponse struct {
	RamCommonResponse
	PasswordPolicy
}

type Policy

type Policy struct {
	PolicyName      string
	PolicyType      string
	Description     string
	DefaultVersion  string
	CreateDate      string
	UpdateDate      string
	AttachmentCount int64
}

type PolicyDocument

type PolicyDocument struct {
	Statement []PolicyItem
	Version   string
}

type PolicyItem

type PolicyItem struct {
	Action   string
	Effect   string
	Resource string
}

type PolicyListResponse

type PolicyListResponse struct {
	RamCommonResponse
	Policies struct {
		Policy []Policy
	}
}

type PolicyQueryRequest

type PolicyQueryRequest struct {
	PolicyType string
	Marker     string
	MaxItems   int8
}

type PolicyQueryResponse

type PolicyQueryResponse struct {
	IsTruncated bool
	Marker      string
	Policies    struct {
		Policy []Policy
	}
}

type PolicyRequest

type PolicyRequest struct {
	PolicyName     string
	PolicyType     string
	Description    string
	PolicyDocument string
	SetAsDefault   string
	VersionId      string
}

type PolicyResponse

type PolicyResponse struct {
	RamCommonResponse
	Policy Policy
}

type PolicyVersionResponse

type PolicyVersionResponse struct {
	RamCommonResponse
	IsDefaultVersion bool
	VersionId        string
	CreateDate       string
	PolicyDocument   string
}

type RamClient

type RamClient struct {
	common.Client
}

func (*RamClient) AddUserToGroup

func (client *RamClient) AddUserToGroup()

func (*RamClient) AttachPolicyToRole

func (client *RamClient) AttachPolicyToRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error)

Role related

func (*RamClient) AttachPolicyToUser

func (client *RamClient) AttachPolicyToUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error)

func (*RamClient) BindMFADevice

func (client *RamClient) BindMFADevice()

func (*RamClient) ClearAccountAlias

func (client *RamClient) ClearAccountAlias() (RamCommonResponse, error)

func (*RamClient) CreateAccessKey

func (client *RamClient) CreateAccessKey(userQuery UserQueryRequest) (AccessKeyResponse, error)

func (*RamClient) CreateGroup

func (client *RamClient) CreateGroup()

func (*RamClient) CreateLoginProfile

func (client *RamClient) CreateLoginProfile()

func (*RamClient) CreatePolicy

func (client *RamClient) CreatePolicy(policyReq PolicyRequest) (PolicyResponse, error)

func (*RamClient) CreatePolicyVersion

func (client *RamClient) CreatePolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error)

func (*RamClient) CreateRole

func (client *RamClient) CreateRole(role RoleRequest) (RoleResponse, error)

func (*RamClient) CreateUser

func (client *RamClient) CreateUser(user UserRequest) (UserResponse, error)

func (*RamClient) CreateVirtualMFADevices

func (client *RamClient) CreateVirtualMFADevices()

func (*RamClient) DeleteAccessKey

func (client *RamClient) DeleteAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error)

func (*RamClient) DeleteGroup

func (client *RamClient) DeleteGroup()

func (*RamClient) DeleteLoginProfile

func (client *RamClient) DeleteLoginProfile()

func (*RamClient) DeletePolicy

func (client *RamClient) DeletePolicy(policyReq PolicyRequest) (RamCommonResponse, error)

func (*RamClient) DeletePolicyVersion

func (client *RamClient) DeletePolicyVersion(policyReq PolicyRequest) (RamCommonResponse, error)

func (*RamClient) DeleteRole

func (client *RamClient) DeleteRole(roleQuery RoleQueryRequest) (RamCommonResponse, error)

func (*RamClient) DeleteUser

func (client *RamClient) DeleteUser(userQuery UserQueryRequest) (RamCommonResponse, error)

func (*RamClient) DeleteVirtualMFADevices

func (client *RamClient) DeleteVirtualMFADevices()

func (*RamClient) DetachPolicyFromRole

func (client *RamClient) DetachPolicyFromRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error)

func (*RamClient) DetachPolicyFromUser

func (client *RamClient) DetachPolicyFromUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error)

func (*RamClient) GetAccountAlias

func (client *RamClient) GetAccountAlias() (AccountAliasResponse, error)

func (*RamClient) GetGroup

func (client *RamClient) GetGroup()

func (*RamClient) GetLoginProfile

func (client *RamClient) GetLoginProfile()

func (*RamClient) GetPasswordPolicy

func (client *RamClient) GetPasswordPolicy(accountAlias AccountAlias) (PasswordPolicyResponse, error)

func (*RamClient) GetPolicy

func (client *RamClient) GetPolicy(policyReq PolicyRequest) (PolicyResponse, error)

func (*RamClient) GetPolicyVersion

func (client *RamClient) GetPolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error)

func (*RamClient) GetRole

func (client *RamClient) GetRole(roleQuery RoleQueryRequest) (RoleResponse, error)

func (*RamClient) GetUser

func (client *RamClient) GetUser(userQuery UserQueryRequest) (UserResponse, error)

func (*RamClient) GetUserMFAInfo

func (client *RamClient) GetUserMFAInfo()

func (*RamClient) ListAccessKeys

func (client *RamClient) ListAccessKeys(userQuery UserQueryRequest) (AccessKeyListResponse, error)

func (*RamClient) ListEnitiesForPolicy

func (client *RamClient) ListEnitiesForPolicy()

TODO

func (*RamClient) ListGroup

func (client *RamClient) ListGroup()

func (*RamClient) ListGroupsForUser

func (client *RamClient) ListGroupsForUser()

func (*RamClient) ListPolicies

func (client *RamClient) ListPolicies(policyQuery PolicyQueryRequest) (PolicyQueryResponse, error)

func (*RamClient) ListPoliciesForGroup

func (client *RamClient) ListPoliciesForGroup()

Group related

TODO

func (*RamClient) ListPoliciesForRole

func (client *RamClient) ListPoliciesForRole(roleQuery RoleQueryRequest) (PolicyListResponse, error)

func (*RamClient) ListPoliciesForUser

func (client *RamClient) ListPoliciesForUser(userQuery UserQueryRequest) (PolicyListResponse, error)

func (*RamClient) ListPolicyVersions

func (client *RamClient) ListPolicyVersions(policyReq PolicyRequest) (PolicyVersionResponse, error)

func (*RamClient) ListRoles

func (client *RamClient) ListRoles() (ListRoleResponse, error)

func (*RamClient) ListUsers

func (client *RamClient) ListUsers(listParams ListUserRequest) (ListUserResponse, error)

func (*RamClient) ListUsersForGroup

func (client *RamClient) ListUsersForGroup()

func (*RamClient) ListVirtualMFADevices

func (client *RamClient) ListVirtualMFADevices()

func (*RamClient) RemoveUserFromGroup

func (client *RamClient) RemoveUserFromGroup()

func (*RamClient) SetAccountAlias

func (client *RamClient) SetAccountAlias(accountalias AccountAlias) (RamCommonResponse, error)

func (*RamClient) SetDefaultPolicyVersion

func (client *RamClient) SetDefaultPolicyVersion()

TODO

func (*RamClient) SetPasswordPolicy

func (client *RamClient) SetPasswordPolicy(passwordPolicy PasswordPolicyRequest) (PasswordPolicyResponse, error)

func (*RamClient) UpdateAccessKey

func (client *RamClient) UpdateAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error)

func (*RamClient) UpdateGroup

func (client *RamClient) UpdateGroup()

func (*RamClient) UpdateLoginProfile

func (client *RamClient) UpdateLoginProfile()

func (*RamClient) UpdateRole

func (client *RamClient) UpdateRole(newRole UpdateRoleRequest) (RoleResponse, error)

func (*RamClient) UpdateUser

func (client *RamClient) UpdateUser(newUser UpdateUserRequest) (UserResponse, error)

type RamClientInterface

type RamClientInterface interface {
	//ram user
	CreateUser(user UserRequest) (UserResponse, error)
	GetUser(userQuery UserQueryRequest) (UserResponse, error)
	UpdateUser(newUser UpdateUserRequest) (UserResponse, error)
	DeleteUser(userQuery UserQueryRequest) (RamCommonResponse, error)
	ListUsers(listParams ListUserRequest) (ListUserResponse, error)

	//TODO login ram console
	CreateLoginProfile()
	GetLoginProfile()
	DeleteLoginProfile()
	UpdateLoginProfile()

	//ram ak
	CreateAccessKey(userQuery UserQueryRequest) (AccessKeyResponse, error)
	UpdateAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error)
	DeleteAccessKey(accessKeyRequest UpdateAccessKeyRequest) (RamCommonResponse, error)
	ListAccessKeys(userQuery UserQueryRequest) (AccessKeyListResponse, error)

	//TODO MFA
	CreateVirtualMFADevices()
	ListVirtualMFADevices()
	DeleteVirtualMFADevices()
	BindMFADevice()
	GetUserMFAInfo()

	//TODO group
	CreateGroup()
	GetGroup()
	UpdateGroup()
	ListGroup()
	DeleteGroup()
	AddUserToGroup()
	RemoveUserFromGroup()
	ListGroupsForUser()
	ListUsersForGroup()

	CreateRole(role RoleRequest) (RoleResponse, error)
	GetRole(roleQuery RoleQueryRequest) (RoleResponse, error)
	UpdateRole(newRole UpdateRoleRequest) (RoleResponse, error)
	ListRoles() (ListRoleResponse, error)
	DeleteRole(roleQuery RoleQueryRequest) (RamCommonResponse, error)

	//DONE policy
	CreatePolicy(policyReq PolicyRequest) (PolicyResponse, error)
	GetPolicy(policyReq PolicyRequest) (PolicyResponse, error)
	DeletePolicy(policyReq PolicyRequest) (RamCommonResponse, error)
	ListPolicies(policyQuery PolicyQueryRequest) (PolicyQueryResponse, error)
	ListPoliciesForUser(userQuery UserQueryRequest) (PolicyListResponse, error)

	//TODO policy
	CreatePolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error)
	GetPolicyVersion(policyReq PolicyRequest) (PolicyVersionResponse, error)
	DeletePolicyVersion(policyReq PolicyRequest) (RamCommonResponse, error)
	ListPolicyVersions(policyReq PolicyRequest) (PolicyVersionResponse, error)
	AttachPolicyToUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error)
	DetachPolicyFromUser(attachPolicyRequest AttachPolicyRequest) (RamCommonResponse, error)
	ListEnitiesForPolicy()
	SetDefaultPolicyVersion()
	ListPoliciesForGroup()
	AttachPolicyToRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error)
	DetachPolicyFromRole(attachPolicyRequest AttachPolicyToRoleRequest) (RamCommonResponse, error)
	ListPoliciesForRole(roleQuery RoleQueryRequest) (PolicyListResponse, error)

	//TODO security apis
	SetAccountAlias(accountAlias AccountAlias) (RamCommonResponse, error)
	GetAccountAlias() (AccountAliasResponse, error)
	ClearAccountAlias() (RamCommonResponse, error)
	SetPasswordPolicy(passwordPolicy PasswordPolicyRequest) (PasswordPolicyResponse, error)
	GetPasswordPolicy(accountAlias AccountAlias) (PasswordPolicyResponse, error)
}

func NewClient

func NewClient(accessKeyId string, accessKeySecret string) RamClientInterface

func NewClientWithEndpoint

func NewClientWithEndpoint(endpoint string, accessKeyId string, accessKeySecret string) RamClientInterface

type RamCommonResponse

type RamCommonResponse struct {
	common.Response
}

type Role

type Role struct {
	RoleId                   string
	RoleName                 string
	Arn                      string
	Description              string
	AssumeRolePolicyDocument string
	CreateDate               string
	UpdateDate               string
}

type RoleQueryRequest

type RoleQueryRequest struct {
	RoleName string
}

type RoleRequest

type RoleRequest struct {
	RoleName                 string
	AssumeRolePolicyDocument string
	Description              string
}

type RoleResponse

type RoleResponse struct {
	RamCommonResponse
	Role Role
}

type State

type State string

CreateAccessKey() UpdateAccessKey() DeleteAccessKey() ListAccessKeys()

const (
	Active   State = "Active"
	Inactive State = "Inactive"
)

type UpdateAccessKeyRequest

type UpdateAccessKeyRequest struct {
	UserAccessKeyId string
	Status          State
	UserName        string
}

type UpdateRoleRequest

type UpdateRoleRequest struct {
	RoleName                    string
	NewAssumeRolePolicyDocument string
}

type UpdateUserRequest

type UpdateUserRequest struct {
	UserName       string
	NewUserName    string
	NewDisplayName string
	NewMobilePhone string
	NewEmail       string
	NewComments    string
}

type User

type User struct {
	UserId        string
	UserName      string
	DisplayName   string
	MobilePhone   string
	Email         string
	Comments      string
	CreateDate    string
	UpdateDate    string
	LastLoginDate string
}

type UserQueryRequest

type UserQueryRequest struct {
	UserName string
}

type UserRequest

type UserRequest struct {
	User
}

type UserResponse

type UserResponse struct {
	RamCommonResponse
	User User
}

type VirtualMFADevice

type VirtualMFADevice struct {
}

Jump to

Keyboard shortcuts

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