iam

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRegion          = base.RegionApSingapore
	ServiceVersion20180101 = "2018-01-01"
	ServiceName            = "iam"
)

Variables

View Source
var (
	ServiceInfo = &base.ServiceInfo{
		Timeout: 5 * time.Second,
		Host:    "open.byteplusapi.com",
		Header: http.Header{
			"Accept": []string{"application/json"},
		},
	}

	ApiInfoList = map[string]*base.ApiInfo{

		"ListAccessKeys": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListAccessKeys"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"CreateAccessKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreateAccessKey"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"UpdateAccessKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"UpdateAccessKey"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"DeleteAccessKey": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteAccessKey"},
				"Version": []string{ServiceVersion20180101},
			},
		},

		"CreatePolicy": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreatePolicy"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"GetPolicy": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetPolicy"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"ListPolicies": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListPolicies"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"DeletePolicy": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeletePolicy"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"AttachRolePolicy": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"AttachRolePolicy"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"DetachRolePolicy": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DetachRolePolicy"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"ListAttachedRolePolicies": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListAttachedRolePolicies"},
				"Version": []string{ServiceVersion20180101},
			},
		},

		"CreateRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreateRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"GetRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"UpdateRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"UpdateRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"DeleteRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"ListRoles": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListRoles"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"ListUsersForRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListUsersForRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"AddUserToRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"AddUserToRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"RemoveUserFromRole": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"RemoveUserFromRole"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"ListRolesForUser": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListRolesForUser"},
				"Version": []string{ServiceVersion20180101},
			},
		},

		"CreateUser": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"CreateUser"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"GetUser": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"GetUser"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"ListUsers": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"ListUsers"},
				"Version": []string{ServiceVersion20180101},
			},
		},
		"DeleteUser": {
			Method: http.MethodGet,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"DeleteUser"},
				"Version": []string{ServiceVersion20180101},
			},
		},
	}
)
View Source
var DefaultInstance = NewInstance()

DefaultInstance 默认的实例

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	AccessKey AccessKeyStructure
}

type AccessKeyList

type AccessKeyList struct {
	AccessKeyMetadata []*AccessKeyStructure
}

type AccessKeyListResp

type AccessKeyListResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *AccessKeyList `json:",omitempty"`
}

type AccessKeyResp

type AccessKeyResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *AccessKey `json:",omitempty"`
}

type AccessKeyStructure

type AccessKeyStructure struct {
	base.BaseResp
	AccessKeyId     string
	SecretAccessKey string `json:",omitempty"`
	UserName        string
}

accessKey

type AddedUserList

type AddedUserList struct {
	AddedUserMetadata []*AddedUserStructure
	Limit             int
	Offset            int
	Total             int
}

type AddedUserListResp

type AddedUserListResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *AddedUserList `json:",omitempty"`
}

type AddedUserResp

type AddedUserResp struct {
	AddedUser AddedUserStructure
}

type AddedUserStructure

type AddedUserStructure struct {
	UserName   string
	CreateDate string
}

type AttachedPolicyList

type AttachedPolicyList struct {
	AttachedPolicyMetadata []*AttachedPolicyStructure
	Limit                  int
	Offset                 int
	Total                  int
}

type AttachedPolicyListResp

type AttachedPolicyListResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *AttachedPolicyList `json:",omitempty"`
}

type AttachedPolicyStructure

type AttachedPolicyStructure struct {
	PolicyTrn   string
	PolicyName  string
	PolicyType  string
	CreateDate  string
	Description string
}

type IAM

type IAM struct {
	Client *base.Client
}

IAM .

func NewInstance

func NewInstance() *IAM

NewInstance 创建一个实例

func (*IAM) AddUserToRole

func (p *IAM) AddUserToRole(query url.Values) (*NullResultResp, int, error)

func (*IAM) AttachRolePolicy

func (p *IAM) AttachRolePolicy(query url.Values) (*NullResultResp, int, error)

func (*IAM) CreateAccessKey

func (p *IAM) CreateAccessKey(query url.Values) (*AccessKeyResp, int, error)

func (*IAM) CreatePolicy

func (p *IAM) CreatePolicy(query url.Values) (*NullResultResp, int, error)

Policy

func (*IAM) CreateRole

func (p *IAM) CreateRole(query url.Values) (*RoleResp, int, error)

Role

func (*IAM) CreateUser

func (p *IAM) CreateUser(query url.Values) (*UserResp, int, error)

user

func (*IAM) DeleteAccessKey

func (p *IAM) DeleteAccessKey(query url.Values) (*AccessKeyResp, int, error)

func (*IAM) DeletePolicy

func (p *IAM) DeletePolicy(query url.Values) (*NullResultResp, int, error)

func (*IAM) DeleteRole

func (p *IAM) DeleteRole(query url.Values) (*NullResultResp, int, error)

func (*IAM) DeleteUser

func (p *IAM) DeleteUser(query url.Values) (*NullResultResp, int, error)

func (*IAM) DetachRolePolicy

func (p *IAM) DetachRolePolicy(query url.Values) (*NullResultResp, int, error)

func (*IAM) GetAPIInfo

func (p *IAM) GetAPIInfo(api string) *base.ApiInfo

GetAPIInfo interface

func (*IAM) GetPolicy

func (p *IAM) GetPolicy(query url.Values) (*PolicyStructure, int, error)

func (*IAM) GetRole

func (p *IAM) GetRole(query url.Values) (*RoleResp, int, error)

func (*IAM) GetServiceInfo

func (p *IAM) GetServiceInfo() *base.ServiceInfo

GetServiceInfo interface

func (*IAM) GetUser

func (p *IAM) GetUser(query url.Values) (*UserResp, int, error)

func (*IAM) ListAccessKeys

func (p *IAM) ListAccessKeys(query url.Values) (*AccessKeyListResp, int, error)

AccessKey

func (*IAM) ListAttachedRolePolicies

func (p *IAM) ListAttachedRolePolicies(query url.Values) (*AttachedPolicyListResp, int, error)

func (*IAM) ListPolicies

func (p *IAM) ListPolicies(query url.Values) (*PolicyListResp, int, error)

func (*IAM) ListRoles

func (p *IAM) ListRoles(query url.Values) (*RoleListResp, int, error)

func (*IAM) ListRolesForUser

func (p *IAM) ListRolesForUser(query url.Values) (*RoleListResp, int, error)

func (*IAM) ListUsers

func (p *IAM) ListUsers(query url.Values) (*UserListResp, int, error)

func (*IAM) ListUsersForRole

func (p *IAM) ListUsersForRole(query url.Values) (*AddedUserListResp, int, error)

func (*IAM) RemoveUserFromRole

func (p *IAM) RemoveUserFromRole(query url.Values) (*NullResultResp, int, error)

func (*IAM) SetHost

func (p *IAM) SetHost(host string)

SetHost .

func (*IAM) SetRegion

func (p *IAM) SetRegion(region string)

SetHost .

func (*IAM) SetSchema

func (p *IAM) SetSchema(schema string)

SetSchema .

func (*IAM) UpdateAccessKey

func (p *IAM) UpdateAccessKey(query url.Values) (*AccessKeyResp, int, error)

func (*IAM) UpdateRole

func (p *IAM) UpdateRole(query url.Values) (*NullResultResp, int, error)

type NullResultResp

type NullResultResp struct {
	ResponseMetadata *base.ResponseMetadata
}

type Policy

type Policy struct {
	Policy PolicyStructure
}

type PolicyList

type PolicyList struct {
	PolicyMetadata []*PolicyStructure
	Limit          int
	Offset         int
	Total          int
}

type PolicyListResp

type PolicyListResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *PolicyList `json:",omitempty"`
}

type PolicyResp

type PolicyResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *Policy `json:",omitempty"`
}

type PolicyStructure

type PolicyStructure struct {
	base.BaseResp
	PolicyTrn      string
	PolicyName     string
	PolicyType     string
	CreateDate     string
	UpdateDate     string
	Description    string
	PolicyId       string
	PolicyDocument string
}

policy

type RoLeList

type RoLeList struct {
	RoleMetadata []*RoleStructure
	Limit        int
	Offset       int
	Total        int
}

type Role

type Role struct {
	Role RoleStructure
}

type RoleListResp

type RoleListResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *RoLeList `json:",omitempty"`
}

type RoleResp

type RoleResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *Role `json:",omitempty"`
}

type RoleStructure

type RoleStructure struct {
	base.BaseResp
	Trn                 string
	RoleName            string
	RoleId              uint
	TrustPolicyDocument string `json:",omitempty"`
	Description         string
}

role

type User

type User struct {
	User UserStructure
}

type UserList

type UserList struct {
	UserMetadata []*UserStructure
	Limit        int
	Offset       int
	Total        int
}

type UserListResp

type UserListResp struct {
	ResponseMetadata base.ResponseMetadata
	Result           *UserList `json:",omitempty"`
}

type UserResp

type UserResp struct {
	ResponseMetadata *base.ResponseMetadata
	Result           *User `json:",omitempty"`
}

type UserStructure

type UserStructure struct {
	base.BaseResp
	Id                  uint `json:",omitempty"`
	Trn                 string
	UserName            string
	Description         string
	DisplayName         string
	Email               string
	EmailIsVerify       bool
	MobilePhone         string
	MobilePhoneIsVerify bool
	Source              string
}

user

Jump to

Keyboard shortcuts

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