v20180813

package
v1.0.81 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 4 Imported by: 40

Documentation

Index

Constants

View Source
const APIVersion = "2018-08-13"

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {

	// 密钥ID
	SecretId *string `json:"SecretId,omitempty" name:"SecretId"`

	// 创建时间(时间戳)
	CreateTime *uint64 `json:"CreateTime,omitempty" name:"CreateTime"`

	// 状态(2:有效, 3:禁用, 4:已删除)
	Status *uint64 `json:"Status,omitempty" name:"Status"`
}

type AssumeRoleRequest

type AssumeRoleRequest struct {
	*tchttp.BaseRequest

	// 角色的资源描述,可在[访问管理](https://console.cloud.tencent.com/cam/role),点击角色名获取。
	// 普通角色:
	// qcs::cam::uin/12345678:role/4611686018427397919、qcs::cam::uin/12345678:roleName/testRoleName
	// 服务角色:
	// qcs::cam::uin/12345678:role/tencentcloudServiceRole/4611686018427397920、qcs::cam::uin/12345678:role/tencentcloudServiceRoleName/testServiceRoleName
	RoleArn *string `json:"RoleArn,omitempty" name:"RoleArn"`

	// 临时会话名称,由用户自定义名称。
	// 长度在2到128之间,可包含大小写字符,数字以及特殊字符:=,.@_-。 正则为:[\w+=,.@_-]*
	RoleSessionName *string `json:"RoleSessionName,omitempty" name:"RoleSessionName"`

	// 指定临时证书的有效期,单位:秒,默认 7200 秒,最长可设定有效期为 43200 秒
	DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"`

	// 策略描述
	// 注意:
	// 1、policy 需要做 urlencode(如果通过 GET 方法请求云 API,发送请求前,所有参数都需要按照[云 API 规范](https://cloud.tencent.com/document/api/598/33159#1.-.E6.8B.BC.E6.8E.A5.E8.A7.84.E8.8C.83.E8.AF.B7.E6.B1.82.E4.B8.B2)再 urlencode 一次)。
	// 2、策略语法参照[ CAM 策略语法](https://cloud.tencent.com/document/product/598/10603)。
	// 3、策略中不能包含 principal 元素。
	Policy *string `json:"Policy,omitempty" name:"Policy"`

	// 角色外部ID,可在[访问管理](https://console.cloud.tencent.com/cam/role),点击角色名获取。
	// 长度在2到128之间,可包含大小写字符,数字以及特殊字符:=,.@:/-。 正则为:[\w+=,.@:\/-]*
	ExternalId *string `json:"ExternalId,omitempty" name:"ExternalId"`
}

func NewAssumeRoleRequest

func NewAssumeRoleRequest() (request *AssumeRoleRequest)

func (*AssumeRoleRequest) FromJsonString

func (r *AssumeRoleRequest) FromJsonString(s string) error

func (*AssumeRoleRequest) ToJsonString

func (r *AssumeRoleRequest) ToJsonString() string

type AssumeRoleResponse

type AssumeRoleResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 临时安全证书
		Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"`

		// 证书无效的时间,返回 Unix 时间戳,精确到秒
		ExpiredTime *int64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"`

		// 证书无效的时间,以 iso8601 格式的 UTC 时间表示
		Expiration *string `json:"Expiration,omitempty" name:"Expiration"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewAssumeRoleResponse

func NewAssumeRoleResponse() (response *AssumeRoleResponse)

func (*AssumeRoleResponse) FromJsonString

func (r *AssumeRoleResponse) FromJsonString(s string) error

func (*AssumeRoleResponse) ToJsonString

func (r *AssumeRoleResponse) ToJsonString() string

type AssumeRoleWithSAMLRequest

type AssumeRoleWithSAMLRequest struct {
	*tchttp.BaseRequest

	// base64 编码的 SAML 断言信息
	SAMLAssertion *string `json:"SAMLAssertion,omitempty" name:"SAMLAssertion"`

	// 扮演者访问描述名
	PrincipalArn *string `json:"PrincipalArn,omitempty" name:"PrincipalArn"`

	// 角色访问描述名
	RoleArn *string `json:"RoleArn,omitempty" name:"RoleArn"`

	// 会话名称
	RoleSessionName *string `json:"RoleSessionName,omitempty" name:"RoleSessionName"`

	// 指定临时证书的有效期,单位:秒,默认 7200 秒,最长可设定有效期为 43200 秒
	DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"`
}

func NewAssumeRoleWithSAMLRequest

func NewAssumeRoleWithSAMLRequest() (request *AssumeRoleWithSAMLRequest)

func (*AssumeRoleWithSAMLRequest) FromJsonString

func (r *AssumeRoleWithSAMLRequest) FromJsonString(s string) error

func (*AssumeRoleWithSAMLRequest) ToJsonString

func (r *AssumeRoleWithSAMLRequest) ToJsonString() string

type AssumeRoleWithSAMLResponse

type AssumeRoleWithSAMLResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 对象里面包含 Token,TmpSecretId,TmpSecretKey 三元组
		Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"`

		// 证书无效的时间,返回 Unix 时间戳,精确到秒
		ExpiredTime *uint64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"`

		// 证书无效的时间,以 ISO8601 格式的 UTC 时间表示
		Expiration *string `json:"Expiration,omitempty" name:"Expiration"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewAssumeRoleWithSAMLResponse

func NewAssumeRoleWithSAMLResponse() (response *AssumeRoleWithSAMLResponse)

func (*AssumeRoleWithSAMLResponse) FromJsonString

func (r *AssumeRoleWithSAMLResponse) FromJsonString(s string) error

func (*AssumeRoleWithSAMLResponse) ToJsonString

func (r *AssumeRoleWithSAMLResponse) ToJsonString() string

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

Deprecated

func (*Client) AssumeRole

func (c *Client) AssumeRole(request *AssumeRoleRequest) (response *AssumeRoleResponse, err error)

申请扮演角色

func (*Client) AssumeRoleWithSAML

func (c *Client) AssumeRoleWithSAML(request *AssumeRoleWithSAMLRequest) (response *AssumeRoleWithSAMLResponse, err error)

本接口(AssumeRoleWithSAML)用于根据 SAML 断言申请角色临时凭证。

func (*Client) GetFederationToken

func (c *Client) GetFederationToken(request *GetFederationTokenRequest) (response *GetFederationTokenResponse, err error)

获取联合身份临时访问凭证

func (*Client) QueryApiKey

func (c *Client) QueryApiKey(request *QueryApiKeyRequest) (response *QueryApiKeyResponse, err error)

拉取API密钥列表

type Credentials

type Credentials struct {

	// token。token长度和绑定的策略有关,最长不超过4096字节。
	Token *string `json:"Token,omitempty" name:"Token"`

	// 临时证书密钥ID。最长不超过1024字节。
	TmpSecretId *string `json:"TmpSecretId,omitempty" name:"TmpSecretId"`

	// 临时证书密钥Key。最长不超过1024字节。
	TmpSecretKey *string `json:"TmpSecretKey,omitempty" name:"TmpSecretKey"`
}

type GetFederationTokenRequest

type GetFederationTokenRequest struct {
	*tchttp.BaseRequest

	// 您可以自定义调用方英文名称,由字母组成。
	Name *string `json:"Name,omitempty" name:"Name"`

	// 授予该临时证书权限的CAM策略
	// 注意:
	// 1、策略语法参照[ CAM 策略语法](https://cloud.tencent.com/document/product/598/10603)。
	// 2、策略中不能包含 principal 元素。
	// 3、该参数需要做urlencode。
	Policy *string `json:"Policy,omitempty" name:"Policy"`

	// 指定临时证书的有效期,单位:秒,默认1800秒,主账号最长可设定有效期为7200秒,子账号最长可设定有效期为129600秒。
	DurationSeconds *uint64 `json:"DurationSeconds,omitempty" name:"DurationSeconds"`
}

func NewGetFederationTokenRequest

func NewGetFederationTokenRequest() (request *GetFederationTokenRequest)

func (*GetFederationTokenRequest) FromJsonString

func (r *GetFederationTokenRequest) FromJsonString(s string) error

func (*GetFederationTokenRequest) ToJsonString

func (r *GetFederationTokenRequest) ToJsonString() string

type GetFederationTokenResponse

type GetFederationTokenResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 临时证书
		Credentials *Credentials `json:"Credentials,omitempty" name:"Credentials"`

		// 临时证书有效的时间,返回 Unix 时间戳,精确到秒
		ExpiredTime *uint64 `json:"ExpiredTime,omitempty" name:"ExpiredTime"`

		// 证书有效的时间,以 iso8601 格式的 UTC 时间表示
		// 注意:此字段可能返回 null,表示取不到有效值。
		Expiration *string `json:"Expiration,omitempty" name:"Expiration"`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewGetFederationTokenResponse

func NewGetFederationTokenResponse() (response *GetFederationTokenResponse)

func (*GetFederationTokenResponse) FromJsonString

func (r *GetFederationTokenResponse) FromJsonString(s string) error

func (*GetFederationTokenResponse) ToJsonString

func (r *GetFederationTokenResponse) ToJsonString() string

type QueryApiKeyRequest

type QueryApiKeyRequest struct {
	*tchttp.BaseRequest

	// 待查询的账号(不填默认查当前账号)
	TargetUin *uint64 `json:"TargetUin,omitempty" name:"TargetUin"`
}

func NewQueryApiKeyRequest

func NewQueryApiKeyRequest() (request *QueryApiKeyRequest)

func (*QueryApiKeyRequest) FromJsonString

func (r *QueryApiKeyRequest) FromJsonString(s string) error

func (*QueryApiKeyRequest) ToJsonString

func (r *QueryApiKeyRequest) ToJsonString() string

type QueryApiKeyResponse

type QueryApiKeyResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// 密钥ID列表
		IdKeys []*ApiKey `json:"IdKeys,omitempty" name:"IdKeys" list`

		// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewQueryApiKeyResponse

func NewQueryApiKeyResponse() (response *QueryApiKeyResponse)

func (*QueryApiKeyResponse) FromJsonString

func (r *QueryApiKeyResponse) FromJsonString(s string) error

func (*QueryApiKeyResponse) ToJsonString

func (r *QueryApiKeyResponse) ToJsonString() string

Jump to

Keyboard shortcuts

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